WO2022228032A1 - Image color cast detection method, device, and refrigerator - Google Patents

Image color cast detection method, device, and refrigerator Download PDF

Info

Publication number
WO2022228032A1
WO2022228032A1 PCT/CN2022/084706 CN2022084706W WO2022228032A1 WO 2022228032 A1 WO2022228032 A1 WO 2022228032A1 CN 2022084706 W CN2022084706 W CN 2022084706W WO 2022228032 A1 WO2022228032 A1 WO 2022228032A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
color cast
color
area
cast
Prior art date
Application number
PCT/CN2022/084706
Other languages
French (fr)
Chinese (zh)
Inventor
毕研华
Original Assignee
青岛海尔电冰箱有限公司
海尔智家股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 青岛海尔电冰箱有限公司, 海尔智家股份有限公司 filed Critical 青岛海尔电冰箱有限公司
Publication of WO2022228032A1 publication Critical patent/WO2022228032A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]

Definitions

  • the invention relates to the field of home appliances, and in particular, to a detection method, equipment and refrigerator for image color cast.
  • Color is one of the important features of images, and is usually an important basis for image processing and analysis. It is of great significance for research in computer vision fields such as target recognition and detection, image segmentation, and video retrieval.
  • the color of an object is determined by its reflectivity characteristics. Due to the color constancy of the human visual system, the influence of factors such as lighting conditions on the color can be eliminated to a certain extent.
  • the imaging device does not have this "adjustment" function and will be affected by The influence of factors such as the external light environment and the characteristics of the imaging photosensitive components themselves cause a certain degree of error between the image color and the real color of the object, that is, "color cast".
  • the photosensitive components cannot obtain a normally exposed image, which will also cause the image color to be too dark or too explosive. If the image color cast is not detected and calibrated in a timely and effective manner, the color-based image vision algorithm may not work.
  • the purpose of the present invention is to provide an image color cast detection method, equipment and refrigerator.
  • an embodiment of the present invention provides a method for detecting color cast of an image, the method comprising:
  • performing color cast detection on an area image specifically includes:
  • the method for obtaining the color cast threshold includes:
  • performing color cast detection on an area image specifically includes:
  • the method further includes:
  • the color cast of the image is automatically corrected by adjusting the brightness of the fill light disposed around the camera.
  • the "automatic correction of the color cast of the image by adjusting the brightness of the fill light set around the camera” specifically includes:
  • a photographed image of a yogurt special area inside the refrigerator is obtained as an image to be detected, wherein the yogurt special area includes a bottle holder for placing yogurt.
  • the N ROI regions are distributed around the bottle holder of the image to be detected.
  • an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program that can run on the processor, and the processor executes the program At the same time, the steps in any of the above-mentioned methods for detecting color cast of an image are implemented.
  • an embodiment of the present invention provides a refrigerator, which includes the above-mentioned electronic device.
  • the method for detecting color cast of an image of the present invention cuts out a plurality of ROI regions, and performs color cast detection on these ROI regions respectively, and finally can be fast and accurate according to the color cast detection results of each ROI region.
  • the color cast detection result of the image to be detected is obtained, and the detection efficiency is high and the accuracy rate is high.
  • FIG. 1 is a schematic flowchart of an image color cast detection method of the present invention.
  • FIG. 2 is a schematic diagram of the distribution of the ROI region in the image to be detected according to the present invention.
  • FIG. 3 is a partial structural schematic diagram of the interior of the refrigerator of the present invention.
  • FIG. 4 shows the calculation steps of the color cast factor K of the present invention.
  • refrigerator 1. yogurt area; 3. first bottle holder; 4. second bottle holder; 5. camera and fill light; 6. image to be detected; 7. ROI area.
  • the yogurt area is set up in the refrigerator, and the yogurt can be monitored centrally.
  • the yogurt area is provided with a bottle holder, and the yogurt is placed in the bottle holder.
  • the camera will be blocked by colored plastic bags or the like, causing the color of the light to change, resulting in a color cast in the captured image, which affects the accuracy of image recognition.
  • the present invention provides an image color cast detection method.
  • the method can cut out multiple ROI regions and perform color cast detection on these ROI regions respectively, and finally, according to the color cast detection results of each ROI region, the method can be fast and accurate.
  • the color cast detection result of the image to be detected is obtained, and the detection efficiency is high and the accuracy rate is high.
  • the method includes:
  • Step S100 crop multiple ROI regions of the image to be detected to obtain N ROI regions, where N is a positive integer greater than 1.
  • the present invention mainly detects the color cast of the image of the yogurt special area in the refrigerator. Therefore, the photographed image of the yogurt special area in the refrigerator is obtained as the image to be detected, wherein the yogurt special area includes a bottle holder for placing yogurt.
  • the N ROI regions are distributed around the bottle holder of the image to be detected. Since the inside of the bottle holder is used to place yogurt, after the yogurt is placed, the bottle holder is partially covered by the yogurt, which cannot provide a stable environment for color cast detection. Therefore, the surrounding area of the bottle holder that will not be blocked by yogurt is selected as the ROI area for detection, which will not be affected by the placed yogurt. And because the N ROI areas are distributed around the bottle holder, even if a color cast appears in part of the image, it can be detected, and the detection accuracy is high.
  • Step S200 Perform color cast detection on the N regions respectively, and obtain a color cast detection result of each area.
  • Color cast detection is performed on each of the N areas, respectively, to obtain a color cast detection result of each area.
  • a variety of methods can be used to detect color casts in each area. For example, in order to improve the accuracy of color cast detection, color cast detection based on lab space is used to detect color casts in an area, or in order to perform color cast detection more simply and quickly Color cast detection, you can use the color cast detection based on HSV space to perform color cast detection on an area.
  • performing color cast detection based on lab space on an area image specifically includes:
  • Step S211 Read in the area image in RGB space to obtain the RGB color space of the area image.
  • RGB The RGB color space is based on the three basic colors of R (Red, red), G (Green, green), and B (Blue, blue), which are superimposed to different degrees to produce rich and extensive colors, so it is commonly known as the three-primary color mode.
  • white and black represent the lightness and darkness of the color. Therefore, where there is white or gray-white, the three channels of R, G, and B cannot be black, because there must be three channels of R, G, and B to form these colors.
  • Step S212 Convert the RGB color space of the image into a lab color space.
  • Lab is an uncommon color space. It was established on the basis of the International Standard for Color Measurement developed by the International Commission on Illumination (CIE) in 1931. In 1976, it was officially named CIELab after modification. It is a device-independent color system and a color system based on physiological characteristics. This also means that it uses a digital method to describe human visual perception.
  • the L component in the Lab color space is used to represent the brightness of the pixel, and the value range is [0,100], which means from pure black to pure white; a means the range from red to green, and the value range is [127,-128]; b represents the range from yellow to blue, and the value range is [127,-128].
  • the lightness channel (L) in LAB is specially responsible for the lightness and darkness of the whole picture. Simply put, it is the black and white version of the whole picture.
  • the a channel and the b channel are only responsible for the amount of color.
  • the a channel represents the range from magenta to dark green; b represents the range from burnt yellow to blue.
  • the RGB color space cannot be directly converted to the Lab color space. You need to use the XYZ color space to convert the RGB color space to the XYZ color space, and then convert the XYZ color space to the Lab color space. The specific conversion process is in the prior art, and details are not repeated here.
  • Step S213 Calculate the color cast factor K of the lab chromaticity space. If the color cast factor K is lower than the color cast threshold, it is determined that the regional image has a color cast, otherwise, it is determined that the regional image does not have a color cast .
  • the color cast factor K the average chromaticity D of the image/the chromaticity center distance M.
  • M and N are the width and height of the regional image respectively, in pixels.
  • the color cast factor K The larger the value of the color cast factor K, the more serious the color cast. Therefore, if the color cast factor K is lower than the color cast threshold, it is determined that the area image has color cast, otherwise, it is determined that the area image does not have color cast.
  • the method for obtaining the color cast threshold specifically includes:
  • performing color cast detection based on HSV space on an area image specifically includes:
  • Step S221 Read in the area image in RGB space.
  • Step S222 Convert the image of the RGB color channel to the HSV channel.
  • Step S223 Perform channel segmentation on the image, and segment the image into three channel data of H, S, and V respectively.
  • Step S224 Calculate the average value of the H, S, and V channel data of all the pixels of the image respectively.
  • Calculate the average value of the H channel data, the average value of the S channel data, and the average value of the V channel data of all pixels of the image, and the three average values are used to characterize the area image in the three channels. composite value.
  • Step S225 If at least one of the three average values is not within the set value range, determine that the area image has color cast.
  • the initial average value of all pixels in each area in each channel can be obtained through the captured pictures, and the value of the average value of all pixels in the three channels of the image area can be set through the initial average value. scope.
  • the initial average values of the H, S, and V channel data of all pixels in the image area are obtained, according to the three initial average values. , and set the value range of the average value of all pixels in the three channels of the image area.
  • Step S300 if the number of regions with color casts in the N regions is greater than or equal to a first threshold, it is determined that the to-be-detected image has color casts.
  • the first threshold is preferably 1, that is, as long as a color cast occurs in one area, it is determined that the to-be-detected image has a color cast.
  • the method further comprises:
  • Step S400 After it is determined that the image to be detected has color cast, the color cast of the image is automatically corrected by adjusting the brightness of the fill light disposed around the camera.
  • the fill light of the present invention preferably adopts an LED light that emits white light.
  • the LED light is gradually brightened, the gradually increasing white light will weaken other colored light, so as to achieve the purpose of correcting the color cast.
  • the step S400 includes:
  • Step S410 While gradually increasing the brightness of the fill light, control the camera to periodically capture images and detect whether the captured images have color cast.
  • the brightness of the fill light is gradually increased, and at the same time, images are captured periodically (the interval between two adjacent cycles is short), and the methods of steps S100 to S300 are used to detect whether the newly captured image has a color cast.
  • Step S420 After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light.
  • the yogurt special area includes a first bottle seat, the first bottle seat is used for placing yogurt, and the camera and the fill light are arranged on the second bottle seat.
  • the camera and the fill light are on the same level, and the fill light is a plurality of LED lights distributed around the camera according to a certain rule.
  • the plurality of fill lights are distributed in a rectangle or circle, and the camera is arranged in the middle of the rectangle or circle.
  • the multiple fill lights emit downward parallel beams, which can reduce or prevent the generation of shadows while filling the light.
  • the distance between the fill light and the camera is in the range of 20-40 cm.
  • a camera and a fill light are arranged at the bottom of the second bottle holder of the refrigerator, and the camera is used to capture an image of the yogurt special area located at the bottom of the second bottle holder, and the yogurt special area includes a yogurt area.
  • the first bottle holder. The image captured by the camera is used as the image to be detected, and the area around the bottle holder of the image to be detected is cropped to obtain N ROI regions, and the distribution of the N ROI regions is shown in FIG. 2 . Then, the lab space-based color cast detection is performed on the N regions, and if at least one of the N regions has a color cast, it is determined that the image to be detected has a color cast.
  • the brightness of the fill light is gradually increased, and at the same time, the image is periodically captured, and the above-mentioned color cast detection method is used to continuously detect whether the newly captured image has a color cast. After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light. Finally, when the image recognition is completed, turn off the fill light.
  • the present invention provides an image color cast detection method, by cutting out the area around the bottle holder in the image to be detected, to obtain N ROI areas, then performing color cast detection on these ROI areas, and finally according to the color cast detection results of each ROI area
  • the color cast detection result of the image to be detected is obtained, and the detection method can quickly and accurately detect the image to be detected.
  • the brightness of the fill light can be automatically adjusted, and the color cast of the image can be automatically corrected, so that the accuracy of image recognition is not affected by the color cast.
  • the present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor implements the above-mentioned detection of color cast of the image when the program is executed Any one of the steps in the method, that is, to implement the steps in any one of the technical solutions in the above-mentioned image color cast detection method.
  • the present invention also provides a refrigerator, which includes the above-mentioned electronic device.
  • the refrigerator further includes a special area for yogurt, a first bottle seat and a second bottle seat, and a camera and a fill light are arranged at the bottom of the second bottle seat.
  • the camera and the fill light The lights are on the same horizontal plane, and the fill light is a plurality of LED lights distributed in a rectangle around the camera, and the camera is arranged in the middle of the rectangle.
  • the multiple fill lights emit downward parallel beams, which can reduce or prevent the generation of shadows while filling the light.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed are an image color cast detection method, a device, and a refrigerator, the method comprising: cropping multiple ROIs of an image to be tested, so as to obtain N ROIs; separately carrying out color cast detection on the N regions to obtain a color cast detection result of each region; and if the number of regions that have color cast in the N regions is greater than or equal to a first threshold, then determining that said image has color cast. Thus, detection efficiency and accuracy are high.

Description

图像偏色的检测方法、设备及冰箱Image color cast detection method, equipment and refrigerator 技术领域technical field
本发明涉及家电领域,特别涉及一种图像偏色的检测方法、设备及冰箱。The invention relates to the field of home appliances, and in particular, to a detection method, equipment and refrigerator for image color cast.
背景技术Background technique
颜色是图像的重要特征之一,通常也是图像处理和分析的重要依据,尤其对于目标识别与检测、图像分割和视频检索等计算机视觉领域的研究具有十分重要的意义。物体的颜色由其反射率特性所决定,由于人眼视觉系统具有颜色恒常性,能够在一定程度上消除光照条件等因素对颜色的影响,但成像设备不具备这种“调节”功能,会受到外界光环境、成像感光元器件本身的特性等因素的影响,造成图像色彩与物体真实色彩之间存在一定程度上的误差,即“偏色”。同时,当外界光环境过暗或者过亮时,感光元器件无法获取正常曝光的图像,也会造成图像色彩过暗或者过爆的现象。若不及时有效地检测出并校准图像偏色,则使得基于颜色的图像视觉算法可能无法进行。Color is one of the important features of images, and is usually an important basis for image processing and analysis. It is of great significance for research in computer vision fields such as target recognition and detection, image segmentation, and video retrieval. The color of an object is determined by its reflectivity characteristics. Due to the color constancy of the human visual system, the influence of factors such as lighting conditions on the color can be eliminated to a certain extent. However, the imaging device does not have this "adjustment" function and will be affected by The influence of factors such as the external light environment and the characteristics of the imaging photosensitive components themselves cause a certain degree of error between the image color and the real color of the object, that is, "color cast". At the same time, when the external light environment is too dark or too bright, the photosensitive components cannot obtain a normally exposed image, which will also cause the image color to be too dark or too explosive. If the image color cast is not detected and calibrated in a timely and effective manner, the color-based image vision algorithm may not work.
在冰箱领域,当冰箱内部的灯光被有色塑料袋遮挡,导致光的颜色发生变化时,冰箱内部拍摄的图像会出现严重的偏色,进而影响图像中物体识别的准确率。为了减少上述情况导致的图像识别准确率降低的问题,需要对冰箱内部拍摄的图片进行偏色检测。但是目前现有的偏色检测理论方法,针对冰箱内部拍摄的图像的偏色检测,计算量大且比较耗时,同时准确率低。In the field of refrigerators, when the light inside the refrigerator is blocked by a colored plastic bag, causing the color of the light to change, the image captured inside the refrigerator will have a serious color cast, which in turn affects the accuracy of object recognition in the image. In order to reduce the problem of reducing the accuracy of image recognition caused by the above situation, it is necessary to perform color cast detection on pictures taken inside the refrigerator. However, the current existing theoretical methods for color cast detection, aiming at the color cast detection of images captured inside the refrigerator, require a large amount of calculation and are time-consuming, and at the same time, the accuracy rate is low.
因此,亟待提出一种高效、且准确率高的专门针对冰箱内部图像的偏色检测方法。Therefore, there is an urgent need to propose an efficient and high-accuracy color cast detection method for interior images of refrigerators.
发明内容SUMMARY OF THE INVENTION
本发明的目的在于提供一种图像偏色的检测方法、设备及冰箱。The purpose of the present invention is to provide an image color cast detection method, equipment and refrigerator.
为实现上述发明目的之一,本发明一实施方式提供一种图像偏色的检测方法,所述方法包括:To achieve one of the above purposes of the invention, an embodiment of the present invention provides a method for detecting color cast of an image, the method comprising:
对待检测图像的多个ROI区域进行裁剪,得到N个ROI区域,所述N为大于1的正整数;Cropping multiple ROI regions of the image to be detected to obtain N ROI regions, where N is a positive integer greater than 1;
分别对所述N个区域进行偏色检测,得到每个区域的偏色检测结果;Perform color cast detection on the N regions respectively, and obtain the color cast detection result of each area;
若所述N个区域中出现偏色的区域个数大于或等于第一阈值,则判定所述待检 测图像出现偏色。If the number of regions with color cast in the N regions is greater than or equal to the first threshold, it is determined that the image to be detected has color cast.
作为本发明一实施方式的进一步改进,对一个区域图像进行偏色检测具体包括:As a further improvement of an embodiment of the present invention, performing color cast detection on an area image specifically includes:
以RGB空间读入所述区域图像,得到所述区域图像的RGB颜色空间;Read in the area image in RGB space to obtain the RGB color space of the area image;
将所述图像的RGB颜色空间转换为lab色度空间;Convert the RGB color space of the image to the lab chromaticity space;
计算所述lab色度空间的偏色因子K,若所述偏色因子K低于偏色阈值,则判定所述区域图像存在偏色,否则,判定所述区域图像不存在偏色。Calculate the color cast factor K of the lab chromaticity space. If the color cast factor K is lower than the color cast threshold, it is determined that the regional image has a color cast, otherwise, it is determined that the regional image does not have a color cast.
作为本发明一实施方式的进一步改进,所述偏色阈值的获取方法包括:As a further improvement of an embodiment of the present invention, the method for obtaining the color cast threshold includes:
获取多张不同偏色程度的图像,分别测试及计算其识别率和偏色因子K,通过获取识别率超过识别率阈值的图像对应的偏色因子K的取值范围,选择所述取值范围的最大值作为偏色阈值。Obtain a plurality of images with different degrees of color cast, test and calculate their recognition rate and color cast factor K respectively, and select the value range by obtaining the value range of the color cast factor K corresponding to the image whose recognition rate exceeds the recognition rate threshold. The maximum value is used as the color cast threshold.
作为本发明一实施方式的进一步改进,对一个区域图像进行偏色检测具体包括:As a further improvement of an embodiment of the present invention, performing color cast detection on an area image specifically includes:
以RGB空间读入所述区域图像;read in the area image in RGB space;
将RGB颜色通道的图像转换为HSV通道;Convert an image with RGB color channels to HSV channels;
对图像进行通道分割,分别分割为H、S、V三个通道数据;Perform channel segmentation on the image, and divide it into three channel data of H, S, and V respectively;
计算所述图像所有像素点分别在H、S、V三个通道数据的平均值;Calculate the average value of all the pixel points of the image in the H, S, V three channel data respectively;
若所述三个平均值中至少一个平均值不在设定的取值范围内,则判定所述区域图像存在偏色。If at least one of the three average values is not within the set value range, it is determined that there is color cast in the area image.
作为本发明一实施方式的进一步改进,所述方法还包括:As a further improvement of an embodiment of the present invention, the method further includes:
在判定所述待检测图像出现偏色后,通过调整设置在摄像头周围的补光灯的亮度,对图像的偏色进行自动校正。After it is determined that the image to be detected has color cast, the color cast of the image is automatically corrected by adjusting the brightness of the fill light disposed around the camera.
作为本发明一实施方式的进一步改进,所述“通过调整设置在摄像头周围的补光灯的亮度,对图像的偏色进行自动校正”具体包括:As a further improvement of an embodiment of the present invention, the "automatic correction of the color cast of the image by adjusting the brightness of the fill light set around the camera" specifically includes:
在逐渐增加所述补光灯的亮度的同时,控制所述摄像头周期性拍摄图像并检测所述拍摄的图像是否出现偏色;While gradually increasing the brightness of the fill light, control the camera to periodically capture images and detect whether the captured images have color cast;
在检测到摄像头拍摄的图像没有出现偏色后,停止增加补光灯的亮度。After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light.
作为本发明一实施方式的进一步改进,获取拍摄到的冰箱内部酸奶专区的图像作为待检测图像,其中,所述酸奶专区包括有放置酸奶的瓶座。As a further improvement of an embodiment of the present invention, a photographed image of a yogurt special area inside the refrigerator is obtained as an image to be detected, wherein the yogurt special area includes a bottle holder for placing yogurt.
作为本发明一实施方式的进一步改进,所述N个ROI区域分布在所述待检测图像的瓶座的四周。As a further improvement of an embodiment of the present invention, the N ROI regions are distributed around the bottle holder of the image to be detected.
为实现上述发明目的之一,本发明一实施方式提供一种电子设备,包括存储器和处理器,所述存储器存储有可在所述处理器上运行的计算机程序,所述处理器执 行所述程序时实现上述任意一项所述图像偏色的检测方法中的步骤。To achieve one of the above purposes of the invention, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program that can run on the processor, and the processor executes the program At the same time, the steps in any of the above-mentioned methods for detecting color cast of an image are implemented.
为实现上述发明目的之一,本发明一实施方式提供一种冰箱,所述冰箱包含上述所述的电子设备。In order to achieve one of the above objectives of the present invention, an embodiment of the present invention provides a refrigerator, which includes the above-mentioned electronic device.
与现有技术相比,本发明的图像偏色的检测方法,通过裁剪出多个ROI区域,并分别对这些ROI区域进行偏色检测,最终根据各个ROI区域的偏色检测结果能够快速、准确的得到待检测图像的偏色检测结果,检测效率高且准确率高。Compared with the prior art, the method for detecting color cast of an image of the present invention cuts out a plurality of ROI regions, and performs color cast detection on these ROI regions respectively, and finally can be fast and accurate according to the color cast detection results of each ROI region. The color cast detection result of the image to be detected is obtained, and the detection efficiency is high and the accuracy rate is high.
附图说明Description of drawings
图1是本发明的图像偏色的检测方法的流程示意图。FIG. 1 is a schematic flowchart of an image color cast detection method of the present invention.
图2是本发明的ROI区域在待检测图像的分布示意图。FIG. 2 is a schematic diagram of the distribution of the ROI region in the image to be detected according to the present invention.
图3是本发明的冰箱内部的部分结构示意图。FIG. 3 is a partial structural schematic diagram of the interior of the refrigerator of the present invention.
图4是本发明的偏色因子K的计算步骤。FIG. 4 shows the calculation steps of the color cast factor K of the present invention.
其中,1、冰箱;2、酸奶专区;3、第一瓶座;4、第二瓶座;5、摄像头和补光灯;6、待检测图像;7、ROI区域。Among them, 1. refrigerator; 2. yogurt area; 3. first bottle holder; 4. second bottle holder; 5. camera and fill light; 6. image to be detected; 7. ROI area.
具体实施方式Detailed ways
以下将结合附图所示的具体实施方式对本发明进行详细描述。但这些实施方式并不限制本发明,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本发明的保护范围内。The present invention will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and structural, method, or functional changes made by those skilled in the art according to these embodiments are all included in the protection scope of the present invention.
在冰箱中设置酸奶专区,可以对酸奶进行集中监控。一般酸奶专区设置有瓶座,酸奶放置在瓶座内。在对瓶座内的酸奶进行监控的过程中,需要对酸奶专区进行图像拍摄及识别。但是有时候摄像头会被有色塑料袋之类的遮挡,导致光的颜色发生变化,从而导致拍摄的图像出现偏色,影响图像识别的准确率。The yogurt area is set up in the refrigerator, and the yogurt can be monitored centrally. Generally, the yogurt area is provided with a bottle holder, and the yogurt is placed in the bottle holder. In the process of monitoring the yogurt in the bottle holder, it is necessary to photograph and identify the image of the yogurt area. However, sometimes the camera will be blocked by colored plastic bags or the like, causing the color of the light to change, resulting in a color cast in the captured image, which affects the accuracy of image recognition.
因此,本发明提供一种图像偏色的检测方法,所述方法通过裁剪出多个ROI区域,并分别对这些ROI区域进行偏色检测,最终根据各个ROI区域的偏色检测结果能够快速、准确的得到待检测图像的偏色检测结果,检测效率高且准确率高。Therefore, the present invention provides an image color cast detection method. The method can cut out multiple ROI regions and perform color cast detection on these ROI regions respectively, and finally, according to the color cast detection results of each ROI region, the method can be fast and accurate. The color cast detection result of the image to be detected is obtained, and the detection efficiency is high and the accuracy rate is high.
如图1所示,所述方法包括:As shown in Figure 1, the method includes:
步骤S100:对待检测图像的多个ROI区域进行裁剪,得到N个ROI区域,所述N为大于1的正整数。Step S100 : crop multiple ROI regions of the image to be detected to obtain N ROI regions, where N is a positive integer greater than 1.
由于对整张图像进行偏色检测时,检测效率低,且准确率低(比如只是1/3区域出现偏色,基于整张图像的偏色检测无法检测出偏色),因此对待检测图像的多个 ROI区域(感兴趣区域)进行裁剪,得到大于1的N个ROI区域。由于裁剪后的ROI区域图像尺寸远小于整张图像的尺寸,因此,对这些ROI区域图像进行偏色检测的效率高,检测速度快,且准确率高。Since color cast detection is performed on the entire image, the detection efficiency is low and the accuracy rate is low (for example, only 1/3 of the area has color cast, and color cast detection based on the entire image cannot detect color cast). Multiple ROI regions (regions of interest) are cropped to obtain N ROI regions greater than 1. Since the size of the cropped ROI region image is much smaller than the size of the entire image, the color cast detection on these ROI region images has high efficiency, high detection speed, and high accuracy.
本发明中主要针对冰箱内酸奶专区的图像的偏色进行检测,因此,获取拍摄到的冰箱内部酸奶专区的图像作为待检测图像,其中,所述酸奶专区包括有放置酸奶的瓶座。The present invention mainly detects the color cast of the image of the yogurt special area in the refrigerator. Therefore, the photographed image of the yogurt special area in the refrigerator is obtained as the image to be detected, wherein the yogurt special area includes a bottle holder for placing yogurt.
进一步的,如图2所示,所述N个ROI区域分布在所述待检测图像的瓶座的四周。由于瓶座内部用于放置酸奶,在放置酸奶后,瓶座部分被酸奶遮挡,无法为偏色检测提供稳定的环境。因此,选取不会被酸奶遮挡的瓶座的四周区域作为ROI区域进行检测,不会受到放置的酸奶的影响。并且由于这N个ROI区域分布在瓶座的四周,即使图像的部分出现偏色也可检测到,检测的准确率高。Further, as shown in FIG. 2 , the N ROI regions are distributed around the bottle holder of the image to be detected. Since the inside of the bottle holder is used to place yogurt, after the yogurt is placed, the bottle holder is partially covered by the yogurt, which cannot provide a stable environment for color cast detection. Therefore, the surrounding area of the bottle holder that will not be blocked by yogurt is selected as the ROI area for detection, which will not be affected by the placed yogurt. And because the N ROI areas are distributed around the bottle holder, even if a color cast appears in part of the image, it can be detected, and the detection accuracy is high.
步骤S200:分别对所述N个区域进行偏色检测,得到每个区域的偏色检测结果。Step S200: Perform color cast detection on the N regions respectively, and obtain a color cast detection result of each area.
分别对所述N个区域的每个区域进行偏色检测,得到每个区域的偏色检测结果。具体的,可以使用多种方法对每个区域进行偏色检测,例如为了提高偏色检测的准确度,使用基于lab空间的偏色检测对一个区域进行偏色检测,或者为了更加简单快速的进行偏色检测,可以使用基于HSV空间的偏色检测对一个区域进行偏色检测。Color cast detection is performed on each of the N areas, respectively, to obtain a color cast detection result of each area. Specifically, a variety of methods can be used to detect color casts in each area. For example, in order to improve the accuracy of color cast detection, color cast detection based on lab space is used to detect color casts in an area, or in order to perform color cast detection more simply and quickly Color cast detection, you can use the color cast detection based on HSV space to perform color cast detection on an area.
在一优选的实施方式中,对一个区域图像进行基于lab空间的偏色检测具体包括:In a preferred embodiment, performing color cast detection based on lab space on an area image specifically includes:
步骤S211:以RGB空间读入所述区域图像,得到所述区域图像的RGB颜色空间。Step S211: Read in the area image in RGB space to obtain the RGB color space of the area image.
RGB颜色空间以R(Red,红)、G(Green,绿)、B(Blue,蓝)三种基本色为基础,进行不同程度的叠加,产生丰富而广泛的颜色,所以俗称三基色模式。具体的,RGB由R、G、B三通道组成,最亮的红色+最亮的绿色+最亮的蓝色=白色;最暗的红色+最暗的绿色+最暗的蓝色=黑色;而在最亮和最暗之间,相同明暗度的红色+相同明暗度的绿色+相同明暗度的蓝色=灰色。在RGB的任意一个通道内,白和黑表示这个颜色的明暗度。所以,有白色或者灰白色的地方,R、G、B三个通道都不可能是黑色的,因为必须要有R、G、B三个通道来构成这些颜色。The RGB color space is based on the three basic colors of R (Red, red), G (Green, green), and B (Blue, blue), which are superimposed to different degrees to produce rich and extensive colors, so it is commonly known as the three-primary color mode. Specifically, RGB consists of three channels: R, G, and B, the brightest red + the brightest green + the brightest blue = white; the darkest red + the darkest green + the darkest blue = black; And between the brightest and the darkest, the same shade of red + the same shade of green + the same shade of blue = gray. In any channel of RGB, white and black represent the lightness and darkness of the color. Therefore, where there is white or gray-white, the three channels of R, G, and B cannot be black, because there must be three channels of R, G, and B to form these colors.
步骤S212:将所述图像的RGB颜色空间转换为lab色度空间。Step S212: Convert the RGB color space of the image into a lab color space.
Lab是一种不常用的色彩空间。它是在1931年国际照明委员会(CIE)制定的颜色度量国际标准的基础上建立起来的。1976年,经修改后被正式命名为CIELab。它是一种设备无关的颜色系统,也是一种基于生理特征的颜色系统。这也就意味着, 它是用数字化的方法来描述人的视觉感应。Lab颜色空间中的L分量用于表示像素的亮度,取值范围是[0,100],表示从纯黑到纯白;a表示从红色到绿色的范围,取值范围是[127,-128];b表示从黄色到蓝色的范围,取值范围是[127,-128]。LAB中的明度通道(L)专门负责整张图的明暗度,简单的说就是整幅图的黑白版。a通道和b通道只负责颜色的多少。a通道表示从洋红色至深绿色的范围;b表示从焦黄色至袅蓝色的范围。Lab is an uncommon color space. It was established on the basis of the International Standard for Color Measurement developed by the International Commission on Illumination (CIE) in 1931. In 1976, it was officially named CIELab after modification. It is a device-independent color system and a color system based on physiological characteristics. This also means that it uses a digital method to describe human visual perception. The L component in the Lab color space is used to represent the brightness of the pixel, and the value range is [0,100], which means from pure black to pure white; a means the range from red to green, and the value range is [127,-128]; b represents the range from yellow to blue, and the value range is [127,-128]. The lightness channel (L) in LAB is specially responsible for the lightness and darkness of the whole picture. Simply put, it is the black and white version of the whole picture. The a channel and the b channel are only responsible for the amount of color. The a channel represents the range from magenta to dark green; b represents the range from burnt yellow to blue.
RGB颜色空间不能直接转换为Lab颜色空间,需要借助XYZ颜色空间,把RGB颜色空间转换到XYZ颜色空间,之后再把XYZ颜色空间转换到Lab颜色空间。具体的转换过程为现有技术,此处不再赘述。The RGB color space cannot be directly converted to the Lab color space. You need to use the XYZ color space to convert the RGB color space to the XYZ color space, and then convert the XYZ color space to the Lab color space. The specific conversion process is in the prior art, and details are not repeated here.
步骤S213:计算所述lab色度空间的偏色因子K,若所述偏色因子K低于偏色阈值,则判定所述区域图像存在偏色,否则,判定所述区域图像不存在偏色。Step S213: Calculate the color cast factor K of the lab chromaticity space. If the color cast factor K is lower than the color cast threshold, it is determined that the regional image has a color cast, otherwise, it is determined that the regional image does not have a color cast .
偏色因子K=图像平均色度D/色度中心距M,具体的计算过程如图4所示,其中M、N分别为区域图像的宽和高,以像素为单位。在上述计算过程中引入了等效圆的概念,(da,db)为等效圆的中心坐标,等效圆的半径为M,等效圆的中心坐标到a-b色度平面中心轴原点(a=0,b=0)的距离为D。The color cast factor K=the average chromaticity D of the image/the chromaticity center distance M. The specific calculation process is shown in Figure 4, where M and N are the width and height of the regional image respectively, in pixels. In the above calculation process, the concept of equivalent circle is introduced, (da, db) is the center coordinate of the equivalent circle, the radius of the equivalent circle is M, and the center coordinate of the equivalent circle is to the origin of the central axis of the a-b chromaticity plane (a = 0, b = 0) is the distance D.
上述偏色因子K值越大,偏色越严重。因此,若所述偏色因子K低于偏色阈值,则判定所述区域图像存在偏色,否则,判定所述区域图像不存在偏色。The larger the value of the color cast factor K, the more serious the color cast. Therefore, if the color cast factor K is lower than the color cast threshold, it is determined that the area image has color cast, otherwise, it is determined that the area image does not have color cast.
进一步的,所述偏色阈值的获取方法,具体包括:Further, the method for obtaining the color cast threshold specifically includes:
获取多张不同偏色程度的图像,分别测试及计算其识别率和偏色因子K,通过获取识别率超过识别率阈值的图像对应的偏色因子K的取值范围,选择所述取值范围的最大值作为偏色阈值。Obtain a plurality of images with different degrees of color cast, test and calculate their recognition rate and color cast factor K respectively, and select the value range by obtaining the value range of the color cast factor K corresponding to the image whose recognition rate exceeds the recognition rate threshold. The maximum value is used as the color cast threshold.
需要说明的是,上述“获取多张不同偏色程度的图像”,优选针对酸奶专区的多个ROI区域,对每个ROI区域选取多张不同偏色程度的图像,并计算每个ROI区域的图像的识别率和偏色因子,获取每个ROI区域的偏色阈值。It should be noted that, for the above-mentioned "obtaining multiple images with different color casts", it is preferable to select multiple images with different color casts for each ROI area for multiple ROI areas of the yogurt area, and calculate the ROI of each ROI area. The recognition rate and color cast factor of the image are obtained, and the color cast threshold of each ROI area is obtained.
在另一优选的实施方式中,对一个区域图像进行基于HSV空间的偏色检测具体包括:In another preferred embodiment, performing color cast detection based on HSV space on an area image specifically includes:
步骤S221:以RGB空间读入所述区域图像。Step S221: Read in the area image in RGB space.
步骤S222:将RGB颜色通道的图像转换为HSV通道。Step S222: Convert the image of the RGB color channel to the HSV channel.
图像在RGB颜色通道与HSV通道之间的数据转换为现有技术,此处不具体赘述。The data conversion of the image between the RGB color channel and the HSV channel is in the prior art, and details are not described here.
步骤S223:对图像进行通道分割,分别分割为H、S、V三个通道数据。Step S223: Perform channel segmentation on the image, and segment the image into three channel data of H, S, and V respectively.
步骤S224:计算所述图像所有像素点分别在H、S、V三个通道数据的平均值。Step S224: Calculate the average value of the H, S, and V channel data of all the pixels of the image respectively.
计算所述图像所有像素点在H通道数据的平均值、在S通道数据的平均值、和在V通道数据的平均值,所述三个平均值用于表征所述区域图像在三个通道的综合值。Calculate the average value of the H channel data, the average value of the S channel data, and the average value of the V channel data of all pixels of the image, and the three average values are used to characterize the area image in the three channels. composite value.
步骤S225:若所述三个平均值中至少一个平均值不在设定的取值范围内,则判定所述区域图像存在偏色。Step S225: If at least one of the three average values is not within the set value range, determine that the area image has color cast.
判断是否这三个平均值都在预先设定的取值范围内,只要有一个平均值不在预先设定的取值范围内,则判定所述区域图像存在偏色。It is determined whether the three average values are all within the preset value range, and as long as there is one average value that is not within the preset value range, it is determined that there is color cast in the image in the region.
在冰箱出厂前,可以通过拍摄的图片获取各个区域的所有像素点在每个通道的初始平均值,通过所述初始平均值,设定所述图像区域三个通道所有像素点平均值的取值范围。Before the refrigerator leaves the factory, the initial average value of all pixels in each area in each channel can be obtained through the captured pictures, and the value of the average value of all pixels in the three channels of the image area can be set through the initial average value. scope.
在一个具体的实施方式中,获取一个图像区域未出现偏色时,所述图像区域的所有像素点分别在H、S、V三个通道数据的初始平均值,根据所述三个初始平均值,设定所述图像区域三个通道所有像素点平均值的取值范围。In a specific implementation manner, when no color cast occurs in an image area, the initial average values of the H, S, and V channel data of all pixels in the image area are obtained, according to the three initial average values. , and set the value range of the average value of all pixels in the three channels of the image area.
步骤S300:若所述N个区域中出现偏色的区域个数大于或等于第一阈值,则判定所述待检测图像出现偏色。Step S300 : if the number of regions with color casts in the N regions is greater than or equal to a first threshold, it is determined that the to-be-detected image has color casts.
由于即使部分区域出现偏色,也会影响图像识别的准确率,因此,优选所述第一阈值为1,即只要一个区域出现偏色,则判定所述待检测图像出现偏色。Since even if a color cast occurs in a part of the area, the accuracy of image recognition will be affected, therefore, the first threshold is preferably 1, that is, as long as a color cast occurs in one area, it is determined that the to-be-detected image has a color cast.
在检测到图像出现偏色后,可以通知用户手动排除异常情况(例如若是因为有色塑料袋遮挡摄像头,则用户可以去掉有色塑料袋)。也可以在摄像头周围增加补光灯、通过调亮补光灯的形式对偏色进行自动校正。因此,在一个优选的实施方式中,所述方法还包括:After detecting the color cast in the image, the user can be notified to remove the abnormal situation manually (for example, if the colored plastic bag blocks the camera, the user can remove the colored plastic bag). You can also add a fill light around the camera, and automatically correct the color cast by dimming the fill light. Therefore, in a preferred embodiment, the method further comprises:
步骤S400:在判定所述待检测图像出现偏色后,通过调整设置在摄像头周围的补光灯的亮度,对图像的偏色进行自动校正。Step S400: After it is determined that the image to be detected has color cast, the color cast of the image is automatically corrected by adjusting the brightness of the fill light disposed around the camera.
本发明的补光灯优选采用发白光的LED灯,在逐渐调亮LED灯时,逐渐增强的白光会弱化其它的有色光,从而达到对偏色进行校正的目的。The fill light of the present invention preferably adopts an LED light that emits white light. When the LED light is gradually brightened, the gradually increasing white light will weaken other colored light, so as to achieve the purpose of correcting the color cast.
具体的,所述步骤S400包括:Specifically, the step S400 includes:
步骤S410:在逐渐增加所述补光灯的亮度的同时,控制所述摄像头周期性拍摄图像并检测所述拍摄的图像是否出现偏色。Step S410: While gradually increasing the brightness of the fill light, control the camera to periodically capture images and detect whether the captured images have color cast.
首先逐渐增加补光灯的亮度,同时,周期性(相邻两个周期间隔较短)拍摄图像,并采用步骤S100至步骤S300的方法检测最新拍摄的图像是否出现偏色。First, the brightness of the fill light is gradually increased, and at the same time, images are captured periodically (the interval between two adjacent cycles is short), and the methods of steps S100 to S300 are used to detect whether the newly captured image has a color cast.
步骤S420:在检测到摄像头拍摄的图像没有出现偏色后,停止增加补光灯的亮度。Step S420: After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light.
当检测到摄像头拍摄的图像没有出现偏色后,说明目前拍摄的图像质量已经达标,可以正常用于图像识别,因此,停止增加补光灯的亮度。当图像识别完成后,关闭补光灯。When it is detected that the image captured by the camera has no color cast, it means that the quality of the image captured at present has reached the standard and can be used for image recognition normally. Therefore, stop increasing the brightness of the fill light. When the image recognition is complete, turn off the fill light.
在本发明中,摄像头和补光灯的位置,如图3所示,酸奶专区包括第一瓶座,所述第一瓶座用于放置酸奶,摄像头和补光灯设置在第二瓶座的底部,优选摄像头和补光灯在同一水平面上,所述补光灯为多个按一定规律分布在所述摄像头周围的LED灯。具体的,多个补光灯呈矩形或圆形分布,所述摄像头设置在矩形或者圆形的中间。并且多个补光灯发出了向下的平行光束,在补光的同时,减少或预防阴影的产生。In the present invention, the positions of the camera and the fill light, as shown in FIG. 3 , the yogurt special area includes a first bottle seat, the first bottle seat is used for placing yogurt, and the camera and the fill light are arranged on the second bottle seat. At the bottom, preferably the camera and the fill light are on the same level, and the fill light is a plurality of LED lights distributed around the camera according to a certain rule. Specifically, the plurality of fill lights are distributed in a rectangle or circle, and the camera is arranged in the middle of the rectangle or circle. And the multiple fill lights emit downward parallel beams, which can reduce or prevent the generation of shadows while filling the light.
进一步的,优选所述补光灯与摄像头的距离在20~40cm范围内。Further, preferably, the distance between the fill light and the camera is in the range of 20-40 cm.
在一具体实施方式中,在冰箱的第二瓶座的底部设置摄像头和补光灯,所述摄像头用于拍摄位于第二瓶座底部的酸奶专区的图像,所述酸奶专区包括有放置酸奶的第一瓶座。将所述摄像头拍摄的图像作为待检测图像,对待检测图像的瓶座四周的区域进行裁剪,得到N个ROI区域,所述N个ROI区域的分布如图2所示。然后分别对所述N个区域进行基于lab空间的偏色检测,若所述N个区域中至少一个区域出现偏色,则判定所述待检测图像出现偏色。在检测到待检测图像出现偏色后,逐渐增加补光灯的亮度,同时,周期性拍摄图像,并采用上述偏色的检测方法不断检测最新拍摄的图像是否出现偏色。在检测到摄像头拍摄的图像没有出现偏色后,停止增加补光灯的亮度。最终当图像识别完成后,关闭补光灯。In a specific embodiment, a camera and a fill light are arranged at the bottom of the second bottle holder of the refrigerator, and the camera is used to capture an image of the yogurt special area located at the bottom of the second bottle holder, and the yogurt special area includes a yogurt area. The first bottle holder. The image captured by the camera is used as the image to be detected, and the area around the bottle holder of the image to be detected is cropped to obtain N ROI regions, and the distribution of the N ROI regions is shown in FIG. 2 . Then, the lab space-based color cast detection is performed on the N regions, and if at least one of the N regions has a color cast, it is determined that the image to be detected has a color cast. After detecting the color cast of the image to be detected, the brightness of the fill light is gradually increased, and at the same time, the image is periodically captured, and the above-mentioned color cast detection method is used to continuously detect whether the newly captured image has a color cast. After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light. Finally, when the image recognition is completed, turn off the fill light.
本发明的提供图像偏色的检测方法,通过对待检测图片中瓶座四周的区域进行裁剪,得到N个ROI区域,然后对这些ROI区域进行偏色检测,最终根据各个ROI区域的偏色检测结果得到待检测图像的偏色检测结果,所述检测方法能够快速、准确的对待检测图像进行检测。并且在检测出图像出现偏色后,能够自动调整补光灯的亮度,对图像的偏色进行自动校正,从而不因为偏色影响图像识别的准确率。The present invention provides an image color cast detection method, by cutting out the area around the bottle holder in the image to be detected, to obtain N ROI areas, then performing color cast detection on these ROI areas, and finally according to the color cast detection results of each ROI area The color cast detection result of the image to be detected is obtained, and the detection method can quickly and accurately detect the image to be detected. And after detecting the color cast of the image, the brightness of the fill light can be automatically adjusted, and the color cast of the image can be automatically corrected, so that the accuracy of image recognition is not affected by the color cast.
本发明还提供一种电子设备,包括存储器和处理器,所述存储器存储有可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述所述图像偏色的检测方法中的任意一个步骤,也就是说,实现上述所述图像偏色的检测方法中任意一个技术方案中的步骤。The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor implements the above-mentioned detection of color cast of the image when the program is executed Any one of the steps in the method, that is, to implement the steps in any one of the technical solutions in the above-mentioned image color cast detection method.
本发明还提供一种冰箱,包括上述所述的电子设备。The present invention also provides a refrigerator, which includes the above-mentioned electronic device.
优选的,如图3所示,所述冰箱还包括有酸奶专区,第一瓶座和第二瓶座,所述第二瓶座的底部设置有摄像头和补光灯,所述摄像头和补光灯在同一水平面上,并且所述补光灯为多个按矩形分布在所述摄像头周围的LED灯,所述摄像头设置所述矩形的中间。并且多个补光灯发出了向下的平行光束,在补光的同时,减少或预防阴影的产生。Preferably, as shown in FIG. 3 , the refrigerator further includes a special area for yogurt, a first bottle seat and a second bottle seat, and a camera and a fill light are arranged at the bottom of the second bottle seat. The camera and the fill light The lights are on the same horizontal plane, and the fill light is a plurality of LED lights distributed in a rectangle around the camera, and the camera is arranged in the middle of the rectangle. And the multiple fill lights emit downward parallel beams, which can reduce or prevent the generation of shadows while filling the light.
应当理解,虽然本说明书按照实施方式加以描述,但并非每个实施方式仅包含一个独立的技术方案,说明书的这种叙述方式仅仅是为清楚起见,本领域技术人员应当将说明书作为一个整体,各实施方式中的技术方案也可以经适当组合,形成本领域技术人员可以理解的其他实施方式。It should be understood that although this specification is described in terms of embodiments, not every embodiment only includes an independent technical solution, and this description in the specification is only for the sake of clarity, and those skilled in the art should take the specification as a whole, and each The technical solutions in the embodiments can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
上文所列出的一系列的详细说明仅仅是针对本发明的可行性实施方式的具体说明,它们并非用以限制本发明的保护范围,凡未脱离本发明技艺精神所作的等效实施方式或变更均应包含在本发明的保护范围之内。The series of detailed descriptions listed above are only specific descriptions for the feasible embodiments of the present invention, and they are not used to limit the protection scope of the present invention. Changes should all be included within the protection scope of the present invention.

Claims (10)

  1. 一种图像偏色的检测方法,其特征在于,所述方法包括:A method for detecting color cast of an image, characterized in that the method comprises:
    对待检测图像的多个ROI区域进行裁剪,得到N个ROI区域,所述N为大于1的正整数;Cropping multiple ROI regions of the image to be detected to obtain N ROI regions, where N is a positive integer greater than 1;
    分别对所述N个区域进行偏色检测,得到每个区域的偏色检测结果;Perform color cast detection on the N regions respectively, and obtain the color cast detection result of each area;
    若所述N个区域中出现偏色的区域个数大于或等于第一阈值,则判定所述待检测图像出现偏色。If the number of areas with color cast in the N areas is greater than or equal to the first threshold, it is determined that the to-be-detected image has color cast.
  2. 根据权利要求1所述图像偏色的检测方法,其特征在于,对一个区域图像进行偏色检测具体包括:The method for detecting color cast of an image according to claim 1, wherein the color cast detection on an area image specifically comprises:
    以RGB空间读入所述区域图像,得到所述区域图像的RGB颜色空间;Read in the area image in RGB space to obtain the RGB color space of the area image;
    将所述图像的RGB颜色空间转换为lab色度空间;Convert the RGB color space of the image to the lab chromaticity space;
    计算所述lab色度空间的偏色因子K,若所述偏色因子K低于偏色阈值,则判定所述区域图像存在偏色,否则,判定所述区域图像不存在偏色。Calculate the color cast factor K of the lab chromaticity space. If the color cast factor K is lower than the color cast threshold, it is determined that the regional image has a color cast, otherwise, it is determined that the regional image does not have a color cast.
  3. 根据权利要求2所述图像偏色的检测方法,其特征在于:所述偏色阈值的获取方法包括:The method for detecting color cast of an image according to claim 2, wherein the method for obtaining the color cast threshold comprises:
    获取多张不同偏色程度的图像,分别测试及计算其识别率和偏色因子K,通过获取识别率超过识别率阈值的图像对应的偏色因子K的取值范围,选择所述取值范围的最大值作为偏色阈值。Obtain a plurality of images with different degrees of color cast, test and calculate their recognition rate and color cast factor K respectively, and select the value range by obtaining the value range of the color cast factor K corresponding to the image whose recognition rate exceeds the recognition rate threshold. The maximum value is used as the color cast threshold.
  4. 根据权利要求1所述图像偏色的检测方法,其特征在于,对一个区域图像进行偏色检测具体包括:The method for detecting color cast of an image according to claim 1, wherein the color cast detection on an area image specifically comprises:
    以RGB空间读入所述区域图像;read in the area image in RGB space;
    将RGB颜色通道的图像转换为HSV通道;Convert an image with RGB color channels to HSV channels;
    对图像进行通道分割,分别分割为H、S、V三个通道数据;Perform channel segmentation on the image, and divide it into three channel data of H, S, and V respectively;
    计算所述图像所有像素点分别在H、S、V三个通道数据的平均值;Calculate the average value of all the pixel points of the image in the H, S, V three channel data respectively;
    若所述三个平均值中至少一个平均值不在设定的取值范围内,则判定所述区域图像存在偏色。If at least one of the three average values is not within the set value range, it is determined that there is color cast in the area image.
  5. 根据权利要求1所述图像偏色的检测方法,其特征在于,所述方法还包括:The method for detecting color cast of an image according to claim 1, wherein the method further comprises:
    在判定所述待检测图像出现偏色后,通过调整设置在摄像头周围的补光灯的亮度,对图像的偏色进行自动校正。After it is determined that the image to be detected has color cast, the color cast of the image is automatically corrected by adjusting the brightness of the fill light disposed around the camera.
  6. 根据权利要求5所述图像偏色的检测方法,其特征在于,所述“通过调整设置在摄像头周围的补光灯的亮度,对图像的偏色进行自动校正”具体包括:The method for detecting color cast of an image according to claim 5, wherein the "automatically correcting the color cast of an image by adjusting the brightness of a fill light set around the camera" specifically includes:
    在逐渐增加所述补光灯的亮度的同时,控制所述摄像头周期性拍摄图像并检测所述拍摄的图像是否出现偏色;While gradually increasing the brightness of the fill light, control the camera to periodically capture images and detect whether the captured images have color cast;
    在检测到摄像头拍摄的图像没有出现偏色后,停止增加补光灯的亮度。After detecting that the image captured by the camera has no color cast, stop increasing the brightness of the fill light.
  7. 根据权利要求1所述图像偏色的检测方法,其特征在于,所述方法包括:The method for detecting color cast of an image according to claim 1, wherein the method comprises:
    获取拍摄到的冰箱内部酸奶专区的图像作为待检测图像,其中,所述酸奶专区包括有放置酸奶的瓶座。A photographed image of a yogurt special area inside the refrigerator is obtained as an image to be detected, wherein the yogurt special area includes a bottle holder for placing yogurt.
  8. 根据权利要求5所述图像偏色的检测方法,其特征在于:The detection method of image color cast according to claim 5, it is characterized in that:
    所述N个ROI区域分布在所述待检测图像的瓶座的四周。The N ROI regions are distributed around the bottle holder of the image to be detected.
  9. 一种电子设备,包括存储器和处理器,所述存储器存储有可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-8任意一项所述图像偏色的检测方法中的步骤。An electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that, when the processor executes the program, any one of claims 1-8 is implemented The steps in the method for detecting color cast of an image.
  10. 一种冰箱,其特征在于,所述冰箱包含如权利要求9所述的电子设备。A refrigerator, characterized in that, the refrigerator includes the electronic device according to claim 9 .
PCT/CN2022/084706 2021-04-27 2022-04-01 Image color cast detection method, device, and refrigerator WO2022228032A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110459136.9 2021-04-27
CN202110459136.9A CN115249272A (en) 2021-04-27 2021-04-27 Method and equipment for detecting image color cast and refrigerator

Publications (1)

Publication Number Publication Date
WO2022228032A1 true WO2022228032A1 (en) 2022-11-03

Family

ID=83697286

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084706 WO2022228032A1 (en) 2021-04-27 2022-04-01 Image color cast detection method, device, and refrigerator

Country Status (2)

Country Link
CN (1) CN115249272A (en)
WO (1) WO2022228032A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702111A (en) * 2013-12-24 2014-04-02 北京佳讯飞鸿电气股份有限公司 Method for detecting camera video color cast
CN104168478A (en) * 2014-07-29 2014-11-26 银江股份有限公司 Video image off-color detection method based on Lab space and correlation function
CN107644437A (en) * 2016-07-21 2018-01-30 宁波舜宇光电信息有限公司 Color cast detection system and method based on piecemeal
WO2018095412A1 (en) * 2016-11-25 2018-05-31 友好净控科技(浙江)有限公司 Color data analysis-based method and system for detecting substance content

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103702111A (en) * 2013-12-24 2014-04-02 北京佳讯飞鸿电气股份有限公司 Method for detecting camera video color cast
CN104168478A (en) * 2014-07-29 2014-11-26 银江股份有限公司 Video image off-color detection method based on Lab space and correlation function
CN107644437A (en) * 2016-07-21 2018-01-30 宁波舜宇光电信息有限公司 Color cast detection system and method based on piecemeal
WO2018095412A1 (en) * 2016-11-25 2018-05-31 友好净控科技(浙江)有限公司 Color data analysis-based method and system for detecting substance content

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
REN HE, CHEN ZHAOJUN: "Intelligent Analysis-based Video Quality Inspection System Implementation", CHINESE RAILWAYS, no. 7, 15 July 2013 (2013-07-15), XP055982505, ISSN: 1001-683x, DOI: 10.19549/j.issn.1001-683x.2013.07.023 *

Also Published As

Publication number Publication date
CN115249272A (en) 2022-10-28

Similar Documents

Publication Publication Date Title
KR100304663B1 (en) Color illumination color temperature detecting device and method thereof
CN104717432B (en) Handle method, image processing equipment and the digital camera of one group of input picture
US7868930B2 (en) Method and apparatus for automatic white balance
TWI389559B (en) Foreground image separation method
JP2002374539A (en) Camera capable of correcting white balance
US8773545B2 (en) Image processing method for executing color conversion processing, image processing program, image processing device and camera
US6594384B1 (en) Apparatus and method for estimating and converting illuminant chromaticity using perceived illumination and highlight
US20160093034A1 (en) Contrast Based Image Fusion
KR102294622B1 (en) White balance processing method, electronic device and computer readable storage medium
CN108174172B (en) Image pickup method and device, computer readable storage medium and computer equipment
KR101030393B1 (en) Apparatus and method for adjusting white balance of digital image
CN112752023B (en) Image adjusting method and device, electronic equipment and storage medium
US20100321523A1 (en) Method, apparatus, and system for selecting pixels for automatic white balance processing
US9497433B2 (en) Imaging device with color adjustment function, imaging method using the same, and non-transitory storage medium in which imaging program is stored
US20190335150A1 (en) Systems and methods for color balancing
CN108063926B (en) Image processing method and device, computer readable storage medium and computer device
CN107820069A (en) A kind of video monitoring equipment ISP adjustment methods
CN104954772A (en) Image adjacent-grey pixel selection algorithm applied to automatic white balance algorithm
US20050134702A1 (en) Sampling images for color balance information
KR101695246B1 (en) Device for estimating light source and method thereof
US20070041064A1 (en) Image sampling method for automatic white balance
WO2022228032A1 (en) Image color cast detection method, device, and refrigerator
US20200029016A1 (en) Moving object monitoring device and moving object monitoring system
JP4430656B2 (en) Digital image capture device and white balance adjustment method
WO2022228033A1 (en) Image color cast detection and correction method, device, and refrigerator

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22794504

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794504

Country of ref document: EP

Kind code of ref document: A1