[go: up one dir, main page]

CN101957988A - Method and device for obtaining probability distribution of image grey spots and white balance method and device - Google Patents

Method and device for obtaining probability distribution of image grey spots and white balance method and device Download PDF

Info

Publication number
CN101957988A
CN101957988A CN2009100888163A CN200910088816A CN101957988A CN 101957988 A CN101957988 A CN 101957988A CN 2009100888163 A CN2009100888163 A CN 2009100888163A CN 200910088816 A CN200910088816 A CN 200910088816A CN 101957988 A CN101957988 A CN 101957988A
Authority
CN
China
Prior art keywords
color
point
gray
image
histogram
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN2009100888163A
Other languages
Chinese (zh)
Other versions
CN101957988B (en
Inventor
左坤隆
郝韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN 200910088816 priority Critical patent/CN101957988B/en
Publication of CN101957988A publication Critical patent/CN101957988A/en
Application granted granted Critical
Publication of CN101957988B publication Critical patent/CN101957988B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

本发明实施例提供了一种获得图像灰度点概率分布的方法、装置及白平衡方法、装置。其中,一种获得图像灰度点概率分布的方法,包括:拍摄具有彩色色块和灰度色块的参考图像;根据参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据参考图象中灰度色块对应的各像素点的颜色值,建立灰度点直方图;将彩色点直方图和灰度点直方图,分别等同划分为多个区间,根据彩色点直方图和灰度点直方图中的对应区间中的像素点个数,得到参考图像内各像素点的灰度点概率分布图。通过得到参考图像的灰度点概率分布图,使拍摄图像的灰度点判断更加精确,提高了拍摄图像的白平衡增益的准确度。

Figure 200910088816

Embodiments of the present invention provide a method and device for obtaining the probability distribution of image gray points, and a white balance method and device. Wherein, a method for obtaining the probability distribution of image grayscale points includes: taking a reference image with color patches and grayscale patches; establishing color points according to the color values of each pixel corresponding to the color patches in the reference image histogram, and according to the color value of each pixel point corresponding to the gray color block in the reference image, a gray point histogram is established; the color point histogram and the gray point histogram are equally divided into multiple intervals, according to The number of pixels in the corresponding intervals in the color point histogram and the gray point histogram is used to obtain the gray point probability distribution map of each pixel in the reference image. By obtaining the gray point probability distribution map of the reference image, the judgment of the gray point of the captured image is more accurate, and the accuracy of the white balance gain of the captured image is improved.

Figure 200910088816

Description

获得图像灰度点概率分布的方法、装置及白平衡方法、装置 Method and device for obtaining probability distribution of image gray points and white balance method and device

技术领域technical field

本发明涉及图像处理技术领域,尤其涉及一种获得图像灰度点概率分布的方法、装置及白平衡方法、装置。The present invention relates to the technical field of image processing, in particular to a method and device for obtaining the probability distribution of image gray points, and a white balance method and device.

背景技术Background technique

在摄影过程中,从光源发出的光线被物体所反射,摄影器材的影像传感器通过测量这些反射光得到物体的像。In the process of photography, the light emitted from the light source is reflected by the object, and the image sensor of the photographic equipment obtains the image of the object by measuring the reflected light.

可见,摄影的物体成像是与光照情况和物体本身相关的。如,当一个黄色的光源把光投向白色的墙壁上时,由于白色的物体会反射所有入射光,则反射光线对于影像传感器来说也会呈现黄色。这样,摄影的物体成像就与我们人眼所观察到的不一致,也就是白平衡不准确,需要进行白平衡的调节使摄影得到的图像与人眼观察的图像一致。It can be seen that the imaging of objects in photography is related to the lighting conditions and the objects themselves. For example, when a yellow light source shines light on a white wall, the reflected light also appears yellow to the image sensor because the white object reflects all the incident light. In this way, the imaging of the photographed object is inconsistent with what our human eyes observe, that is, the white balance is inaccurate. It is necessary to adjust the white balance to make the image obtained by photography consistent with the image observed by human eyes.

目前,常用的白平衡方法,如通过设定固定的阈值来确定图像中的灰度点。应当知道,灰度点是指在白平衡正确的情况下各颜色通道数值相等的像素点,如红、绿、蓝色(R,G,B)三基色通道R=G=B。这样,通过将确定的灰度点的颜色通道值调整为R=G=B,获得图像各颜色通道增益值,进而调整图像达到白平衡。At present, the commonly used white balance method, for example, determines the gray point in the image by setting a fixed threshold. It should be known that the gray point refers to the pixel point with the same value of each color channel when the white balance is correct, such as the three primary color channels of red, green and blue (R, G, B) R=G=B. In this way, by adjusting the color channel value of the determined gray point to R=G=B, the gain value of each color channel of the image is obtained, and then the image is adjusted to achieve white balance.

在实现本发明过程中,发明人发现现有技术中至少存在如下问题:In the course of realizing the present invention, the inventor finds that there are at least the following problems in the prior art:

由于白平衡的不准确,导致灰度点向某种颜色偏离,但偏离的程度是由光照情况决定的,并不会固定在某个范围内,所以,用固定的阈值来确定灰度点的准确度差,白平衡效果差。Due to the inaccuracy of the white balance, the gray point deviates from a certain color, but the degree of deviation is determined by the lighting conditions and will not be fixed within a certain range. Therefore, a fixed threshold is used to determine the gray point. Poor accuracy and poor white balance.

发明内容Contents of the invention

本发明的实施例提供了一种获得图像灰度点概率分布的方法、装置及白平衡方法、装置,其灰度点的判断准确,白平衡效果好。Embodiments of the present invention provide a method and device for obtaining the probability distribution of image gray points, and a white balance method and device, which can accurately determine gray points and achieve good white balance effects.

一种获得图像灰度点概率分布的方法,包括:A method for obtaining the probability distribution of image gray points, comprising:

拍摄具有彩色色块和灰度色块的参考图像;Take a reference image with color patches and grayscale patches;

根据所述参考图像中彩色色块对应的所各像素点的各颜色值,建立彩色点直方图,以及根据所述参考图象中灰度色块对应的各像素点的颜色值,建立灰度点直方图;Establish a color point histogram according to the color values of each pixel corresponding to the color block in the reference image, and establish a gray scale according to the color values of each pixel corresponding to the gray color block in the reference image point histogram;

将所述彩色点直方图和所述灰度点直方图,分别等同划分为多个区间,根据所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数,得到所述参考图像内各像素点的灰度点概率分布图。Dividing the color point histogram and the gray point histogram into a plurality of intervals respectively, according to the number of pixels in the corresponding intervals in the color point histogram and the gray point histogram, A gray point probability distribution diagram of each pixel point in the reference image is obtained.

一种获得图像灰度点概率分布的装置,包括:A device for obtaining the probability distribution of image gray points, comprising:

图像获取单元,用于拍摄具有彩色色块和灰度色块的参考图像;An image acquisition unit, used for taking reference images with color patches and grayscale patches;

直方图建立单元,用于根据所述参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据所述参考图象中灰度色块对应的各像素点的颜色值,建立灰度点直方图;A histogram building unit, configured to create a color point histogram according to the color values of the pixels corresponding to the color blocks in the reference image, and to create a histogram of color points according to the values of the pixels corresponding to the gray color blocks in the reference image Color value, build gray point histogram;

直方图分析单元,用于将所述彩色点直方图和所述灰度点直方图,分别等同划分为多个区间,获得所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数;a histogram analysis unit, configured to equally divide the color point histogram and the gray point histogram into multiple intervals, and obtain corresponding intervals in the color point histogram and the gray point histogram The number of pixels in

灰度点概率计算单元,用于根据所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数,得到所述参考图像的灰度点概率分布图。The gray point probability calculation unit is configured to obtain the gray point probability distribution map of the reference image according to the number of pixels in the color point histogram and the corresponding interval in the gray point histogram.

一种白平衡方法,包括:A white balance method comprising:

根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图,得到所述拍摄图像中各像素点的灰度点概率值;According to each color value of each pixel point in the captured image, and the gray-scale point probability distribution map of the reference image, the gray-scale point probability value of each pixel point in the captured image is obtained;

根据所述拍摄图像中各像素点的灰度点概率值,获得所述拍摄图像的光照估计;Obtaining an illumination estimate of the captured image according to the gray point probability value of each pixel in the captured image;

根据所述拍摄图像的光照估计,得到所述拍摄图像的各颜色通道的增益值以调整所述拍摄图像实现白平衡。According to the illumination estimation of the captured image, the gain value of each color channel of the captured image is obtained to adjust the captured image to achieve white balance.

一种白平衡装置,包括:A white balance device, comprising:

灰度点概率值获取单元,用于根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图中,得到所述拍摄图像中各像素点的灰度点概率值;A gray-scale point probability value acquisition unit, configured to obtain the gray-scale point probability value of each pixel point in the captured image according to each color value of each pixel point in the captured image and the gray-scale point probability distribution map of the reference image;

光照估计单元,用于根据所述拍摄图像中各像素点的灰度点概率值,获得所述拍摄图像的光照估计;An illumination estimation unit, configured to obtain an illumination estimation of the captured image according to the gray point probability value of each pixel in the captured image;

增益值获取单元,用于根据所述拍摄图像的光照估计,得到所述拍摄图像的各颜色通道的增益值以调整图像实现白平衡。The gain value obtaining unit is configured to obtain the gain value of each color channel of the captured image according to the illumination estimation of the captured image, so as to adjust the image to achieve white balance.

由上述本发明的实施例提供的技术方案可以看出,本发明提供了一种灰度点概率分布的统计方法,用于统计被拍摄图像中的灰度点概率分布,以及基于灰度点概率分布,根据参考图像的灰度点概率分布图确认拍摄得到的图像中各像素点的灰度点概率值,进行白平衡的方法。通过灰度点概率分布,使灰度点的判断更加精确,提高了白平衡增益计算的准确度。It can be seen from the technical solutions provided by the above-mentioned embodiments of the present invention that the present invention provides a statistical method for the probability distribution of gray points, which is used to count the probability distribution of gray points in the captured image, and based on the probability distribution of gray points According to the gray point probability distribution map of the reference image, the gray point probability value of each pixel point in the captured image is confirmed, and the white balance method is performed. Through the probability distribution of gray points, the judgment of gray points is more accurate, and the accuracy of white balance gain calculation is improved.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.

图1为本发明实施例获得图像灰度点概率分布的方法流程示意图;Fig. 1 is a schematic flow chart of a method for obtaining the probability distribution of image gray points according to an embodiment of the present invention;

图2为本发明实施例获得图像灰度点概率分布的方法中彩色点直方图示意图;2 is a schematic diagram of a color point histogram in a method for obtaining the probability distribution of image gray points according to an embodiment of the present invention;

图3为本发明实施例获得图像灰度点概率分布的方法中灰色点直方图示意图;3 is a schematic diagram of a gray point histogram in a method for obtaining the probability distribution of image gray points according to an embodiment of the present invention;

图4为本发明实施例获得图像灰度点概率分布的方法中彩色点直方图、灰色点直方图中区间划分示意图;Fig. 4 is a schematic diagram of interval division in the color point histogram and the gray point histogram in the method for obtaining the probability distribution of image gray points in the embodiment of the present invention;

图5为本发明实施例获得图像灰度点概率分布的方法中灰度点概率分布图示意图;5 is a schematic diagram of a probability distribution diagram of gray points in a method for obtaining the probability distribution of image gray points according to an embodiment of the present invention;

图6为本发明实施例获得图像灰度点概率分布的装置构成示意图;Fig. 6 is a schematic diagram of a device for obtaining the probability distribution of image gray points according to an embodiment of the present invention;

图7为本发明实施例白平衡方法流程示意图一;FIG. 7 is a first schematic flow diagram of a white balance method according to an embodiment of the present invention;

图8为本发明实施例白平衡方法流程示意图二;FIG. 8 is a second schematic flow diagram of a white balance method according to an embodiment of the present invention;

图9为本发明实施例白平衡装置构成示意图一;FIG. 9 is a first schematic diagram of a white balance device according to an embodiment of the present invention;

图10为本发明实施例白平衡装置构成示意图二;Fig. 10 is a second schematic diagram of the composition of the white balance device according to the embodiment of the present invention;

图11为本发明实施例白平衡方法应用场景流程示意图。FIG. 11 is a schematic flow chart of an application scenario of a white balance method according to an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

基于现有技术的白平衡方法,用固定的阈值来确定灰度点的准确度差,白平衡效果差。本发明的实施例提供了一种获得图像灰度点概率分布的方法、装置及白平衡方法、装置。Based on the white balance method in the prior art, the accuracy of determining the gray point with a fixed threshold is poor, and the white balance effect is poor. Embodiments of the present invention provide a method and device for obtaining the probability distribution of image gray points, and a white balance method and device.

在已知光照情况下,拍摄获得参考图像,确认参考图像灰度点的概率分布状况,得到的灰度点的概率分布图。然后,对于拍摄得到的当前图像,可以从灰度点的概率分布图中得到各像素点的灰度点概率值,以估计当前拍摄图像的光照情况,光照估计情况可以通过颜色通道的值来反映。再根据光照估计情况选择合适的颜色通道的增益值,调整当前拍摄图像,实现白平衡正确。Under the known illumination conditions, the reference image is captured by shooting, the probability distribution of the gray points of the reference image is confirmed, and the probability distribution map of the gray points is obtained. Then, for the current image captured, the gray point probability value of each pixel can be obtained from the gray point probability distribution map to estimate the lighting situation of the current captured image, and the lighting estimation situation can be reflected by the value of the color channel . Then select the appropriate gain value of the color channel according to the lighting estimation situation, and adjust the current captured image to achieve the correct white balance.

可以理解,灰度点是指在白平衡正确的情况下各颜色通道值相等的像素点。It can be understood that a grayscale point refers to a pixel point with equal value of each color channel when the white balance is correct.

光照可以包括室外光照或室内光照,室外光照包括:晴天日光、阴天日光或阴影(如,树阴下拍摄得到的图像就是阴影情况),等等,室内光照包括:钨丝灯光、日光灯光或荧光灯光,等等。Lighting can include outdoor lighting or indoor lighting. Outdoor lighting includes: sunny sunlight, cloudy sunlight or shadows (for example, images captured under the shade of trees are shadow situations), etc. Indoor lighting includes: tungsten lighting, daylight lighting or fluorescent lighting Light, wait.

本发明的实施例提供的白平衡方法及装置,白平衡的调节使过程可以通过自动过程完成,属于自动白平衡。In the white balance method and device provided by the embodiments of the present invention, the process of adjusting the white balance can be completed through an automatic process, which belongs to the automatic white balance.

实施例一Embodiment one

如图1所示,本发明的实施例提供一种获得图像灰度点概率分布的方法,包括:As shown in Figure 1, an embodiment of the present invention provides a method for obtaining the probability distribution of image gray points, including:

步骤11、拍摄具有彩色色块和灰度色块参考图像。Step 11, taking a reference image with color patches and grayscale patches.

步骤12、根据参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据参考图像中灰度色块对应的各像素点的颜色值,建立灰度点直方图。Step 12, according to each color value of each pixel point corresponding to the color color block in the reference image, establish a color point histogram, and according to the color value of each pixel point corresponding to the gray color block in the reference image, establish a gray point histogram .

步骤13、将彩色点直方图和灰度点直方图,分别等同划分为多个区间,根据彩色点直方图和灰度点直方图中的对应区间中的像素点个数,得到参考图像内各像素点的灰度点概率分布图。Step 13, the color point histogram and the grayscale point histogram are equally divided into a plurality of intervals respectively, and according to the number of pixels in the corresponding intervals in the color point histogram and the grayscale point histogram, obtain each Probability distribution map of grayscale points of pixels.

可以知道,图像内各像素点的各颜色值可以为RGB色度空间的R、G、B,或者Ycbcr色度空间的Cb、Cr,等等。通常情况下图像的像素点的颜色值为已知,图像的颜色通道值也为已知的。It can be known that each color value of each pixel in the image can be R, G, B in the RGB chromaticity space, or Cb, Cr in the Ycbcr chromaticity space, and so on. Usually, the color value of the pixel point of the image is known, and the color channel value of the image is also known.

具体而言,步骤11中,可选的,参考图像为拍摄具有彩色色块和灰度色块的标准色板而得到的,标准色板可以为标准24色板,或者其他既包含灰度色块又包含彩色色块的标准色板。Specifically, in step 11, optionally, the reference image is obtained by photographing a standard color palette with color patches and grayscale color patches. The standard color palette can be a standard 24 color palette, or other color Blocks in turn contain standard swatches of colored blocks.

如图2、3所示,步骤12中,可选的,彩色点直方图以及灰度点直方图的两个维度可以包括:As shown in Figures 2 and 3, in step 12, optionally, the two dimensions of the color point histogram and the gray point histogram may include:

各像素点在RGB色度空间的R÷G以及B÷G,或者(R-G)÷G以及(B-G)÷G。R÷G and B÷G, or (R-G)÷G and (B-G)÷G of each pixel in the RGB chromaticity space.

或者,各像素点在YCbCr色度空间的Cb以及Cr。Or, each pixel is in Cb and Cr in the YCbCr chromaticity space.

如图4所示,步骤13也就是,可以按照同一划分标准,将彩色点直方图和灰度点直方图分别划分为多个区间,每个区间对应一个落入该区间的像素点的个数,这个像素点的个数就是区间的值。As shown in Figure 4, step 13 is to divide the color point histogram and the gray point histogram into multiple intervals according to the same division standard, and each interval corresponds to the number of pixels falling into the interval , the number of pixels is the value of the interval.

如灰度点直方图内区间的像素点的个数为a,即该区间的值为a,彩色点直方图内对应区间的像素点的个数为b,即该区间的值为b,则该区间内的像素点为灰度点的概率值为p=a÷(a+b),就是指该区间所对应的颜色组合(如RGB)可能是灰度点的概率。这样,可以得到参考图像内各像素点的灰度点概率分布图(如图4所示灰度点概率分布图)。If the number of pixels in the interval in the gray point histogram is a, that is, the value of this interval is a, and the number of pixels in the corresponding interval in the color point histogram is b, that is, the value of this interval is b, then The probability value that the pixels in this interval are grayscale points is p=a÷(a+b), which refers to the probability that the color combination (such as RGB) corresponding to this interval may be grayscale points. In this way, a gray point probability distribution map of each pixel in the reference image (as shown in FIG. 4 ) can be obtained.

当(a+b)=0时,则p=0。另外,当像素点的取值在直方图表达范围之外时,也取p=0。When (a+b)=0, then p=0. In addition, when the value of the pixel point is outside the expression range of the histogram, p=0 is also taken.

可选的,拍摄具有彩色色块和灰度色块的参考图像步骤11,可以为,在预设光照下,拍摄具有彩色色块和灰色色块的标准色板,得到参考图像。Optionally, step 11 of photographing a reference image with color patches and grayscale patches may be, under preset illumination, photographing a standard color palette with color patches and gray patches to obtain a reference image.

预设光照可以包括室外光照或室内光照。室外光照包括:晴天日光、阴天日光或阴影(如,树阴下拍摄得到的图像就是阴影情况),等等,室内光照包括:钨丝灯光、日光灯光或荧光灯光,等等。Preset lighting can include outdoor lighting or indoor lighting. Outdoor lighting includes: sunny daylight, cloudy daylight or shadow (for example, the image captured under the shade of a tree is the shadow situation), etc., and indoor lighting includes: tungsten lighting, daylight lighting or fluorescent lighting, etc.

这样,可以分别存储室外光照或室内光照得到的参考图像的概率分布图,在进行摄影操作时,用户可以选择当前摄影的场景模式为预设光照,如室内光照或室外光照。根据所选择场景模式的预设光照的灰度点概率分布图,可以实现图像自动白平衡。具体可以参见后文叙述。In this way, the probability distribution map of the reference image obtained by outdoor lighting or indoor lighting can be stored respectively. When performing a shooting operation, the user can select the current shooting scene mode as preset lighting, such as indoor lighting or outdoor lighting. According to the gray point probability distribution map of the preset illumination of the selected scene mode, the automatic white balance of the image can be realized. For details, please refer to the following description.

同理,可以分别存储晴天日光、阴天日光或阴影,钨丝灯光、日光灯光或荧光灯光,等等参考图像的概率分布图,在进行摄影操作时,用户可以选择当前摄影的场景模式为预设光照,根据所选择场景模式的预设光照的灰度点概率分布图,可以实现图像自动白平衡。In the same way, the probability distribution maps of reference images such as sunny daylight, cloudy daylight or shadow, tungsten light, daylight light or fluorescent light can be stored separately. When performing photography operations, the user can select the current shooting scene mode as preset Set the lighting, according to the gray point probability distribution map of the preset lighting of the selected scene mode, the automatic white balance of the image can be realized.

本发明的实施例提供一种获得图像灰度点概率分布的方法,还可以对步骤14得到的概率分布图进行滤波,使概率分布图更加平滑。Embodiments of the present invention provide a method for obtaining the probability distribution of image gray points, and may further filter the probability distribution map obtained in step 14 to make the probability distribution map smoother.

由上述本发明的实施例提供的技术方案可以看出,通过获得参考图像的灰度点概率分布图,使灰度点的判断更加精确。通过参考图像的灰度点概率分布状况来确认拍摄图像的各点的灰度点概率,并据此进行光照估计和白平衡,因此不会产生灰度点偏离,产生较好的白平衡效果。It can be seen from the technical solutions provided by the above embodiments of the present invention that by obtaining the probability distribution map of the gray points of the reference image, the judgment of the gray points is more accurate. By referring to the gray point probability distribution of the image, the gray point probability of each point in the captured image is confirmed, and the illumination estimation and white balance are performed based on this, so there will be no gray point deviation and a better white balance effect.

实施例二Embodiment two

如图6所示,对应于实施例一的获得图像灰度点概率分布的方法,本发明的实施例提供一种获得图像灰度点概率分布的装置,包括:As shown in Figure 6, corresponding to the method for obtaining the probability distribution of image gray points in Embodiment 1, an embodiment of the present invention provides a device for obtaining the probability distribution of image gray points, including:

图像获取单元61,用于拍摄具有彩色色块和灰度色块参考图像。The image acquiring unit 61 is configured to capture a reference image having color patches and grayscale patches.

直方图建立单元62,用于根据参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据参考图像中灰度色块对应的各像素点的颜色值,建立灰度点直方图。The histogram building unit 62 is used to establish a color point histogram according to the color values of each pixel point corresponding to the color color block in the reference image, and to establish a color point histogram according to the color values of each pixel point corresponding to the gray color block in the reference image. Histogram of grayscale points.

直方图分析单元63,用于将彩色点直方图和灰度点直方图,分别等同划分为多个区间,获得彩色点直方图和灰度点直方图中的对应区间中的像素点个数。The histogram analysis unit 63 is configured to equally divide the color point histogram and the gray point histogram into a plurality of intervals, and obtain the number of pixels in corresponding intervals in the color point histogram and the gray point histogram.

灰度点概率计算单元64,用于根据彩色点直方图和灰度点直方图对应区间中的像素点个数,得到参考图像的灰度点概率分布图。The gray point probability calculation unit 64 is configured to obtain the gray point probability distribution diagram of the reference image according to the number of pixels in the corresponding intervals of the color point histogram and the gray point histogram.

可选的,图像获取单元61可以拍摄具有彩色色块和灰度色块的标准色板,标准色板可以为标准24色板,或者其他既包含灰度色块又包含彩色色块的标准色板。Optionally, the image acquisition unit 61 can take a standard color palette with color patches and grayscale patches, the standard palette can be a standard 24 color palette, or other standard colors that contain both grayscale patches and color patches plate.

可选的,直方图建立单元62建立的彩色点直方图以及灰度点直方图的两个维度可以包括:Optionally, the two dimensions of the color point histogram and the gray point histogram established by the histogram building unit 62 may include:

各像素点在RGB色度空间的R÷G以及B÷G,或者(R-G)÷G以及(B-G)÷G。R÷G and B÷G, or (R-G)÷G and (B-G)÷G of each pixel in the RGB chromaticity space.

或者,各像素点在YCbCr色度空间的Cb以及Cr。Or, each pixel is in Cb and Cr in the YCbCr chromaticity space.

灰度点概率计算单元64,用于灰度点直方图内区间的值为a,彩色点直方图内对应区间的值为b,计算得到该区间内的像素点为灰度点的概率值为p=a÷(a+b)。当(a+b)=0时,则p=0。当像素点的取值在直方图表达范围之外时,也取p=0。The grayscale point probability calculation unit 64 is used for the value of the interval in the grayscale point histogram to be a, and the value of the corresponding interval in the color point histogram to be b, and the probability value that the pixel point in the interval is calculated as a grayscale point is p=a÷(a+b). When (a+b)=0, then p=0. When the value of the pixel is outside the expression range of the histogram, p=0 is also taken.

可选的,图像获取单元61,还用于在预设光照下,拍摄具有彩色色块和灰度色块的标准色板,得到参考图像。预设光照包括:室外光照或室内光照,室外光照包括:晴天日光、阴天日光或阴影,室内光照包括:钨丝灯光、日光灯光或荧光灯光。Optionally, the image acquisition unit 61 is also configured to capture a standard color palette with color patches and grayscale patches under preset illumination to obtain a reference image. Preset lighting includes: outdoor lighting or indoor lighting, outdoor lighting includes: sunny daylight, cloudy daylight or shadow, and indoor lighting includes: tungsten lighting, daylight lighting or fluorescent lighting.

发明的实施例提供一种获得图像灰度点概率分布图的装置,还可以包括:滤波器(图6中未示),用于对灰度点概率计算单元64得到的概率分布图进行滤波,使概率分布图更加平滑。An embodiment of the invention provides a device for obtaining a probability distribution map of gray-scale points of an image, and may further include: a filter (not shown in FIG. 6 ) for filtering the probability distribution map obtained by the gray-scale point probability calculation unit 64, Make the probability distribution plot smoother.

图像获取单元61,可以是CCD(Charge Couple Device,电荷耦合器件)或CMOS(Complementary Metal-Oxide Semiconductor,互补性氧化金属半导体)感光器件。图像获取单元61输出数字图像信息给直方图分析单元63。The image acquisition unit 61 may be a CCD (Charge Couple Device, charge-coupled device) or a CMOS (Complementary Metal-Oxide Semiconductor, complementary metal oxide semiconductor) photosensitive device. The image acquisition unit 61 outputs digital image information to the histogram analysis unit 63 .

由上述本发明的实施例提供的技术方案可以看出,通过获得参考图像的灰度点概率分布图,使灰度点的判断更加精确。通过参考图像的灰度点概率分布状况来确认拍摄图像的各点的灰度点概率,并据此进行光照估计和白平衡,因此不会产生灰度点偏离,产生较好的白平衡效果。It can be seen from the technical solutions provided by the above embodiments of the present invention that by obtaining the probability distribution map of the gray points of the reference image, the judgment of the gray points is more accurate. By referring to the gray point probability distribution of the image, the gray point probability of each point in the captured image is confirmed, and the illumination estimation and white balance are performed based on this, so there will be no gray point deviation and a better white balance effect.

实施例三Embodiment three

如图7所示,基于上述实施例的获得图像灰度点概率分布的方法,本发明的实施例提供一种白平衡方法,包括:As shown in FIG. 7 , based on the method for obtaining the probability distribution of image gray points in the above embodiment, the embodiment of the present invention provides a white balance method, including:

步骤71、根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图,得到拍摄图像中各像素点的灰度点概率值。Step 71. Obtain the grayscale point probability value of each pixel point in the captured image according to the color values of each pixel point in the captured image and the grayscale point probability distribution map of the reference image.

步骤72、根据拍摄图像中各像素点的灰度点概率值,获得拍摄图像的光照估计。Step 72. According to the gray point probability value of each pixel in the captured image, obtain the illumination estimate of the captured image.

步骤73、根据拍摄图像的光照估计,得到拍摄图像的各颜色通道的增益值以调整拍摄图像实现白平衡。Step 73 , according to the illumination estimation of the captured image, obtain the gain value of each color channel of the captured image to adjust the captured image to achieve white balance.

步骤71中,获得拍摄图像的摄影场景模式与获得参考图像的灰度点概率分布图的预设摄影场景模式一致,如光照均为室外光照或室内光照,不做赘述。In step 71, the photographing scene mode for obtaining the captured image is consistent with the preset photographing scene mode for obtaining the gray point probability distribution map of the reference image. If the lighting is all outdoor lighting or indoor lighting, details will not be described here.

如图8所示,可选的,根据拍摄图像中各像素点的各颜色值,从参考图像的灰度点概率分布图中得到拍摄图像中各像素点的灰度点概率值的步骤71,可以包括:As shown in Figure 8, optionally, according to each color value of each pixel in the captured image, step 71 of obtaining the gray-scale point probability value of each pixel in the captured image from the gray-scale point probability distribution map of the reference image, Can include:

步骤711、根据拍摄图像中各像素点各颜色值,确定各像素点在参考图像的灰度点概率分布图中对应的位置;Step 711, according to each color value of each pixel in the captured image, determine the corresponding position of each pixel in the gray point probability distribution map of the reference image;

步骤712、根据各像素点在参考图像的灰度点概率分布图中对应的位置,得到各像素点对应的灰度点概率值。Step 712 , according to the corresponding position of each pixel in the gray point probability distribution map of the reference image, obtain the gray point probability value corresponding to each pixel.

具体而言,如果在RGB色度空间,Specifically, if in the RGB chromaticity space,

步骤711可以为:根据拍摄图像中各像素点在RGB色度空间的R、G、B颜色值,得到各像素点的R÷G以及B÷G,或者,得到各像素点的(R-G)÷G以及(B-G)÷G,即得到了各像素点在参考图像的灰度点概率分布图中横纵轴的位置,接着,可以确定出各像素点在参考图像的灰度点概率分布图中的具体位置。Step 711 can be: according to the R, G, and B color values of each pixel in the RGB chromaticity space in the captured image, obtain R÷G and B÷G of each pixel, or obtain (R-G)÷G of each pixel G and (B-G)÷G, that is, the position of the horizontal and vertical axes of each pixel point in the gray point probability distribution map of the reference image, and then, it can be determined that each pixel point is in the gray point probability distribution map of the reference image specific location.

步骤712可以为:根据各像素点在参考图像的灰度点概率分布图中对应的位置,可以得到该位置对应的灰度点概率值。Step 712 may be: according to the corresponding position of each pixel point in the gray-scale point probability distribution map of the reference image, the gray-scale point probability value corresponding to the position may be obtained.

或者,如果在YCbCr色度空间,Or, if in YCbCr chromaticity space,

步骤711可以为:根据拍摄图像中各像素点在YCbCr色度空间的Cb、Cr颜色值,得到了各像素点在参考图像的灰度点概率分布图中横纵轴的位置,接着,可以确定出各像素点在参考图像的灰度点概率分布图中的具体位置。Step 711 can be: according to the Cb and Cr color values of each pixel in the YCbCr chromaticity space in the captured image, the position of the horizontal and vertical axes of each pixel in the gray point probability distribution diagram of the reference image is obtained, and then, it can be determined Find out the specific position of each pixel in the gray point probability distribution map of the reference image.

步骤712可以为:根据各像素点在参考图像的灰度点概率分布图中对应的位置,可以得到该位置对应的灰度点概率值。Step 712 may be: according to the corresponding position of each pixel point in the gray-scale point probability distribution map of the reference image, the gray-scale point probability value corresponding to the position may be obtained.

可选的,根据拍摄图像中各像素点的灰度点概率值,获得拍摄图像的光照估计的步骤72,可以包括:Optionally, the step 72 of obtaining the illumination estimation of the captured image according to the gray point probability value of each pixel in the captured image may include:

以拍摄图像中各像素点的灰度点概率值为权重,计算所有像素点各颜色值的加权平均值,获得拍摄图像各颜色通道的平均值即为拍摄图像的光照估计。The gray point probability value of each pixel in the captured image is weighted to calculate the weighted average of each color value of all pixels, and the average value of each color channel of the captured image is obtained as the illumination estimation of the captured image.

具体而言,步骤72中,拍摄图像的光照估计计算公式为

Figure B2009100888163D0000101
Pgray(Ci)为像素点的灰度点概率值,Ci,k为像素点各颜色值,k为R或G或B,i为像素点个数编号。Specifically, in step 72, the illumination estimation calculation formula of the captured image is
Figure B2009100888163D0000101
Pgray(C i ) is the probability value of the gray point of the pixel, C i, k is the color value of each pixel, k is R or G or B, and i is the number of the pixel.

如, L R = Σ i P gray ( C i ) * C i , R Σ i 1 ; like, L R = Σ i P gray ( C i ) * C i , R Σ i 1 ;

LL GG == ΣΣ ii PP graygray (( CC ii )) ** CC ii ,, GG ΣΣ ii 11 ;;

LL BB == ΣΣ ii PP graygray (( CC ii )) ** CC ii ,, BB ΣΣ ii 11 ..

在RGB色度空间,可以通过公式

Figure B2009100888163D0000112
得到拍摄图像R、G、B通道平均值LR、LG、LB,即得到拍摄图像的光照估计结果。In the RGB chromaticity space, the formula
Figure B2009100888163D0000112
Obtain the average values L R , L G , and L B of the R, G , and B channels of the captured image, that is, obtain the illumination estimation result of the captured image.

或者,在YCbCr色度空间,可以将YCbCr转换成RGB,通过公式

Figure B2009100888163D0000113
得到拍摄图像R、G、B通道平均值LR、LG、LB,即得到拍摄图像的光照估计结果。Alternatively, in the YCbCr chromaticity space, YCbCr can be converted to RGB by the formula
Figure B2009100888163D0000113
Obtain the average values L R , L G , and L B of the R, G , and B channels of the captured image, that is, obtain the illumination estimation result of the captured image.

可选的,根据拍摄图像的光照估计,得到拍摄图像的各颜色通道的增益值以调整拍摄图像实现白平衡的步骤73,可以包括:Optionally, according to the illumination estimation of the captured image, the step 73 of obtaining the gain value of each color channel of the captured image to adjust the captured image to achieve white balance may include:

步骤731、将拍摄图像的各颜色通道平均值取倒数,得到各颜色通道的增益值。Step 731: Take the inverse of the average value of each color channel of the captured image to obtain the gain value of each color channel.

步骤732、通过各颜色通道的增益值实现拍摄图像的白平衡调整。Step 732, realize the white balance adjustment of the captured image through the gain value of each color channel.

具体而言,步骤73中,将R通道平均值LR取倒数,得到实现白平衡的R通道的增益值,即Rgain=1/LRSpecifically, in step 73, the R channel average value LR is taken as an inverse number to obtain the gain value of the R channel for achieving white balance, that is, R gain =1/L R .

将G通道平均值LG取倒数,得到实现白平衡的G通道的增益值,即Ggain=1/LGTaking the reciprocal of the average value L G of the G channel, the gain value of the G channel for achieving white balance is obtained, that is, G gain =1/L G .

将所B通道平均值LB取倒数,得到实现白平衡的B通道的增益值,即Bgain=1/LBTaking the reciprocal of the average value L B of the B channel, the gain value of the B channel for realizing white balance is obtained, that is, B gain =1/L B .

这样,将各颜色通道值乘以各颜色通道增益值,可以实现图像的白平衡调整。In this way, the white balance adjustment of the image can be realized by multiplying the value of each color channel by the gain value of each color channel.

由上述本发明的实施例提供的白平衡方法可以看出,由于可以根据参考图像的灰度点概率分布图,得到图像中各像素点的灰度点概率值,使灰度点的判断更加精确,从而提高了白平衡增益计算的准确度。It can be seen from the white balance method provided by the above-mentioned embodiments of the present invention that the gray point probability value of each pixel in the image can be obtained according to the gray point probability distribution map of the reference image, so that the judgment of the gray point is more accurate , thereby improving the accuracy of white balance gain calculation.

而且,本发明的实施例提供的白平衡方法,在得到参考图像的概率分布图前提下,拍摄图像的光照估计计算、拍摄图像的各通道增益计算非常简便,快速,可以满足实时计算,以调整拍摄图像白平衡的需要。Moreover, the white balance method provided by the embodiments of the present invention, on the premise of obtaining the probability distribution map of the reference image, the illumination estimation calculation of the captured image and the gain calculation of each channel of the captured image are very simple and fast, and can meet real-time calculations to adjust Capture image white balance needs.

实施例四Embodiment four

如图9所示,对应于上述实施例的白平衡方法,本发明的实施例提供一种白平衡装置,包括:As shown in FIG. 9, corresponding to the white balance method of the above-mentioned embodiment, an embodiment of the present invention provides a white balance device, including:

灰度点概率值获取单元91,用于根据拍摄图像中各像素点的各颜色值,从参考图像的灰度点概率分布图中得到拍摄图像中各像素点的灰度点概率值。The gray point probability value acquisition unit 91 is configured to obtain the gray point probability value of each pixel in the captured image from the gray point probability distribution map of the reference image according to the color values of each pixel in the captured image.

光照估计单元92,用于根据拍摄图像中各像素点的灰度点概率值,获得拍摄图像的光照估计。The illumination estimation unit 92 is configured to obtain an illumination estimate of the captured image according to the gray point probability value of each pixel in the captured image.

增益值获取单元93,用于根据拍摄图像的光照估计,得到拍摄图像的各颜色通道的增益值以调整拍摄图像实现白平衡。The gain value obtaining unit 93 is configured to obtain the gain value of each color channel of the captured image according to the illumination estimation of the captured image, so as to adjust the captured image to achieve white balance.

可选的,参考图像的灰度点概率分布图可以由实施例二所述装置获得。Optionally, the gray point probability distribution map of the reference image can be obtained by the device described in the second embodiment.

而且,灰度点概率值获取单元91中,获得拍摄图像的摄影场景模式与获得参考图像的灰度点概率分布图的预设摄影场景模式一致,如光照均为室外光照或室内光照,不做赘述。Moreover, in the gray-scale point probability value acquisition unit 91, the shooting scene mode for obtaining the captured image is consistent with the preset shooting scene mode for obtaining the gray-scale point probability distribution map of the reference image. If the lighting is all outdoor lighting or indoor lighting, no repeat.

可选的,如图10所示,本发明实施例的白平衡装置中,灰度点概率值获取单元91,可以包括:Optionally, as shown in FIG. 10, in the white balance device of the embodiment of the present invention, the gray point probability value acquisition unit 91 may include:

第一获取子单元911,用于根据拍摄图像中各像素点各颜色值,确定各像素点在参考图像的灰度点概率分布图中对应的位置。The first acquiring subunit 911 is configured to determine the corresponding position of each pixel in the gray point probability distribution map of the reference image according to each color value of each pixel in the captured image.

第二获取子单元912,用于根据各像素点在参考图像的灰度点概率分布图中对应的位置,得到各像素点对应的灰度点概率值。The second obtaining subunit 912 is configured to obtain the gray point probability value corresponding to each pixel point according to the corresponding position of each pixel point in the gray point probability distribution map of the reference image.

进一步,光照估计单元92,具体用于以拍摄图像中各像素点的灰度点概率值为权重,计算所有像素点各颜色值的加权平均值,获得拍摄图像各颜色通道的平均值即为拍摄图像的光照估计。Further, the illumination estimating unit 92 is specifically used to calculate the weighted average value of each color value of all pixels by using the gray point probability value of each pixel in the captured image as a weight, and obtain the average value of each color channel of the captured image as the captured image. Lighting estimation for images.

可选的,增益值获取单元93,可以包括:Optionally, the gain value obtaining unit 93 may include:

增益值获取子单元931,用于将拍摄图像的各颜色通道平均值取倒数,得到各颜色通道的增益值。The gain value acquisition subunit 931 is configured to take the reciprocal of the average value of each color channel of the captured image to obtain the gain value of each color channel.

增益控制子单元932,用于通过增益值获取子单元931得到的各颜色通道的增益值控制调整拍摄图像实现白平衡。The gain control subunit 932 is configured to control the gain value of each color channel obtained by the gain value acquisition subunit 931 to adjust the captured image to achieve white balance.

本发明实施例的白平衡装置,还可以包括:The white balance device of the embodiment of the present invention may also include:

灰度点概率分布图存储单元94,用于存储参考图像的灰度点概率分布图。The gray point probability distribution map storage unit 94 is configured to store the gray point probability distribution map of the reference image.

图像输出单元95,拍摄图像实现白平衡后,输出图像,供给下一步处理。The image output unit 95 outputs the image for the next step of processing after the captured image is white-balanced.

本发明实施例的白平衡装置,还可以包括:The white balance device of the embodiment of the present invention may also include:

图像获取单元96,可以是CCD(Charge Couple Device,电荷耦合器件)或CMOS(Complementary Metal-Oxide Semiconductor,互补性氧化金属半导体)感光器件。图像获取单元输出数字图像信息给灰度点概率值获取单元91的第一获取子单元911。The image acquisition unit 96 may be a CCD (Charge Couple Device, charge-coupled device) or a CMOS (Complementary Metal-Oxide Semiconductor, complementary metal oxide semiconductor) photosensitive device. The image acquisition unit outputs digital image information to the first acquisition subunit 911 of the gray point probability value acquisition unit 91 .

可以知道,如果本发明实施例的白平衡装置与实施例二的获得图像灰度点概率分布的装置共同配合使用,则本发明实施例的白平衡装置的图像获取单元96可以与获得图像灰度点概率分布的装置的图像获取单元61为同一功能单元,不做赘述。It can be known that if the white balance device of the embodiment of the present invention is used together with the device for obtaining the probability distribution of image gray points in Embodiment 2, the image acquisition unit 96 of the white balance device of the embodiment of the present invention can be used together with the device for obtaining the image gray point probability distribution. The image acquisition unit 61 of the device for point probability distribution is the same functional unit, which will not be repeated here.

具体而言,本发明的实施例提供的白平衡装置:Specifically, the white balance device provided by the embodiments of the present invention:

图像获取单元96获得数字图像信息(以下简称拍摄图像),并发送图像给灰度点概率值获取单元91的第一获取子单元911;The image acquisition unit 96 obtains digital image information (hereinafter referred to as the captured image), and sends the image to the first acquisition subunit 911 of the gray point probability value acquisition unit 91;

第一获取子单元911根据拍摄图像中各像素点各颜色值,以及灰度点概率分布图存储单元94中的参考图像的灰度点概率分布图,确定各像素点在参考图像的灰度点概率分布图中对应的位置,并发送位置信息给第一获取子单元912;The first acquisition subunit 911 determines the gray point of each pixel in the reference image according to the color values of each pixel in the captured image and the gray point probability distribution map of the reference image in the gray point probability distribution map storage unit 94. The corresponding position in the probability distribution map, and send the position information to the first acquisition subunit 912;

第一获取子单元912,根据各像素点在参考图像的灰度点概率分布图中对应的位置,得到各像素点对应的灰度点概率值,并发送灰度点概率值给颜色通道值获取单元92;The first acquisition subunit 912 obtains the gray point probability value corresponding to each pixel point according to the corresponding position of each pixel point in the gray point probability distribution map of the reference image, and sends the gray point probability value to the color channel value acquisition Unit 92;

光照估计单元92,以各像素点的灰度点概率值为权重,计算所有像素点各颜色值的加权平均值,获得拍摄图像各颜色通道平均值,并发送拍摄图像各颜色通道平均值给增益值获取单元93的增益值获取子单元931;The illumination estimating unit 92 calculates the weighted average value of each color value of all pixels with the gray point probability value of each pixel point as the weight, obtains the average value of each color channel of the captured image, and sends the average value of each color channel of the captured image to the gain The gain value acquisition subunit 931 of the value acquisition unit 93;

增益值获取子单元931,将各颜色通道平均值取倒数,得到各颜色通道的增益值,并发送各颜色通道的增益值给增益控制子单元932;The gain value acquisition subunit 931 takes the reciprocal of the average value of each color channel to obtain the gain value of each color channel, and sends the gain value of each color channel to the gain control subunit 932;

增益控制子单元932,根据各颜色通道的增益值控制调整拍摄图像实现白平衡,并将白平衡的拍摄图像发送给图像输出单元95;The gain control subunit 932 controls and adjusts the captured image to achieve white balance according to the gain value of each color channel, and sends the white-balanced captured image to the image output unit 95;

拍摄图像实现白平衡后,可以进行后续步骤,在此不做赘述。After the image is captured to achieve white balance, subsequent steps can be performed, which will not be repeated here.

由上述本发明的实施例提供的白平衡装置可以看出,由于可以根据参考图像的灰度点概率分布图,得到图像中各像素点的灰度点概率值,使灰度点的判断更加精确,从而提高了白平衡增益计算的准确度。It can be seen from the white balance device provided by the above-mentioned embodiments of the present invention that the gray point probability value of each pixel in the image can be obtained according to the gray point probability distribution map of the reference image, so that the judgment of the gray point is more accurate , thereby improving the accuracy of white balance gain calculation.

而且,本发明的实施例提供的白平衡装置,在得到参考图像的概率分布图前提下,图像的各颜色通道增益计算非常简便,快速,能够满足实时计算的需要。Moreover, in the white balance device provided by the embodiments of the present invention, on the premise of obtaining the probability distribution map of the reference image, the gain calculation of each color channel of the image is very simple and fast, and can meet the needs of real-time calculation.

实施例五Embodiment five

参见图1-5、图7、图8所示,以光照估计为RGB色度空间的R、G、B通道值为例,说明本发明的实施例提供的白平衡方法。Referring to Fig. 1-5, Fig. 7, and Fig. 8, the white balance method provided by the embodiment of the present invention is described by taking the R, G, and B channel values of the RGB chromaticity space as an example in which the illumination is estimated.

如图11所示,首先,说明获得参考图像灰度点概率分布图的方法:As shown in Figure 11, first, the method for obtaining the probability distribution map of the gray points of the reference image is described:

步骤001、拍摄标准24色板,得到一幅参考图像。Step 001, photograph the standard 24 color palettes to obtain a reference image.

需要理解的是,在考虑到追求不同等级的调整效果的情况下,或者为了操作方便,参考图像也可以通过拍摄具有彩色色块和灰度色块的其他物体或者图像来获得,比如处于拍摄场所的固定的参照物等其他具有彩色色块和灰度色块的其他便于携带或者便于拍摄的物体。It should be understood that, considering the pursuit of different levels of adjustment effects, or for the convenience of operation, the reference image can also be obtained by shooting other objects or images with color blocks and grayscale blocks, such as in the shooting place Fixed reference objects and other objects that are easy to carry or photograph with color blocks and grayscale blocks.

步骤002、分别得到RGB色度空间参考图像的灰度色块和彩色块直方图。Step 002. Obtain the grayscale color block and color block histogram of the RGB chromaticity space reference image respectively.

对于标准24色板的参考图像的灰度色块和彩色块分别执行以下操作:对色块内的每一个像素点,计算R÷G,B÷G两个值,并且,以R÷G为第一维,B÷G为第二维,计算出对所有该色块内中像素点的二维直方图,参见图2、3所示。For the gray-scale color block and color block of the reference image of the standard 24-color plate, the following operations are performed respectively: For each pixel in the color block, two values of R÷G and B÷G are calculated, and R÷G is The first dimension, B÷G is the second dimension, and calculate the two-dimensional histogram of all the pixels in the color block, as shown in Figures 2 and 3.

步骤003、得到彩色点和灰度点直方图的各区间内像素点的个数。Step 003. Obtain the number of pixels in each interval of the color point and gray point histogram.

参见图2、3所示,直方图中每个坐标轴的取值范围为[0-2.5],每个区间为Delta=0.005,则直方图共有501×501个区间(直方图每个坐标轴最大值为500)。Referring to Figures 2 and 3, the value range of each coordinate axis in the histogram is [0-2.5], and each interval is Delta=0.005, then the histogram has a total of 501×501 intervals (each coordinate axis of the histogram The maximum value is 500).

参见图4直方图中的A区间的值代表所有落入到(2*delta)<R÷G<(3*delta),delta<B÷G<(2*delta)的像素点的个数。Referring to the value of interval A in the histogram in FIG. 4 , it represents the number of all pixels falling into (2*delta)<R÷G<(3*delta), delta<B÷G<(2*delta).

还可以对每个直方图进行归一化,使直方图中所有点的和为1,减少计算量,即对某一点x计算得到

Figure B2009100888163D0000151
It is also possible to normalize each histogram so that the sum of all points in the histogram is 1, reducing the amount of calculation, that is, calculating for a certain point x to get
Figure B2009100888163D0000151

步骤004、得到参考图像各像素点的灰度点概率分布图。Step 004. Obtain a probability distribution map of gray points of each pixel in the reference image.

取灰度点直方图该位置的值为a,彩色点直方图该位置的值为b,则该位置为灰度点的概率值为p=a÷(a+b)。If the value of this position in the grayscale histogram is a, and the value of this position in the color point histogram is b, then the probability value of this position as a grayscale point is p=a÷(a+b).

在出现(a+b)=0的情况时,认为p=0。在直方图表达范围之外的像素点,即超过[0,2.5]所规定的范围时,也取p=0。When the case of (a+b)=0 occurs, it is considered that p=0. When the pixel points outside the histogram expression range, that is, beyond the range specified by [0, 2.5], p=0 is also taken.

最终得到参考图像的灰度点概率分布图。Finally, the gray point probability distribution map of the reference image is obtained.

还可以,对参考灰度点概率分布图进行滤波,使参考概率分布图更加平滑。也可以,将参考灰度点概率分布图存储起来,留待进行白平衡调整时,调用参考灰度点概率分布图。It is also possible to filter the reference gray point probability distribution map to make the reference probability distribution map smoother. Alternatively, the reference gray point probability distribution map may be stored, and the reference gray point probability distribution map may be called when white balance adjustment is performed.

接着,说明白平衡的方法:Next, explain the method of white balance:

步骤005、从参考图像的灰度点概率分布图中得到输入图像的各像素点的灰度点概率值。Step 005. Obtain the gray point probability value of each pixel of the input image from the gray point probability distribution map of the reference image.

输入图像是待进行白平衡调整的图像,输入图像可以是一幅拍摄图像,以下以拍摄图像为例。计算拍摄图像的像素点R÷G值,以及B÷G值,根据R÷G值,以及B÷G值,从参考灰度点概率分布图找到对应的灰度点概率值p,。The input image is an image to be adjusted for white balance, and the input image may be a captured image. The captured image is taken as an example below. Calculate the R÷G value and B÷G value of the pixel point of the captured image, and find the corresponding gray point probability value p from the reference gray point probability distribution map according to the R÷G value and B÷G value.

步骤006、得到拍摄图像的光照估计结果。Step 006. Obtain an illumination estimation result of the captured image.

拍摄图像的光照估计计算公式为

Figure B2009100888163D0000161
Pgray(Ci)为像素点的灰度点概率值,Ci,k为像素点各颜色值,k为R或G或B,i为像素点个数编号。拍摄图像的光照估计为: L R = &Sigma; i P gray ( C i ) * C i , R &Sigma; i 1 , L G = &Sigma; i P gray ( C i ) * C i , G &Sigma; i 1 , L B = &Sigma; i P gray ( C i ) * C i , B &Sigma; i 1 . The calculation formula for the illumination estimation of the captured image is
Figure B2009100888163D0000161
P gray (C i ) is the probability value of the gray point of the pixel, C i, k is the color value of the pixel, k is R or G or B, and i is the number of the pixel. The illumination estimate for the captured image is: L R = &Sigma; i P gray ( C i ) * C i , R &Sigma; i 1 , L G = &Sigma; i P gray ( C i ) * C i , G &Sigma; i 1 , L B = &Sigma; i P gray ( C i ) * C i , B &Sigma; i 1 .

步骤007、得到拍摄图像的R、G、B通道的增益值。Step 007, obtain the gain values of the R, G, and B channels of the captured image.

如,R通道的增益值,Rgain=1/LRFor example, the gain value of the R channel, R gain =1/L R .

如,G通道的增益值Ggain=1/LGFor example, the gain value G gain of the G channel =1/L G .

如,B通道的增益值Bgain=1/LBFor example, the gain value B gain of the B channel =1/L B .

通过对拍摄图像按照R、G、B通道的增益值进行调整,则可以得到准确白平衡的图像。By adjusting the captured image according to the gain values of the R, G, and B channels, an image with accurate white balance can be obtained.

可以知道,在得到参考图像的概率分布图前提下,拍摄图像的各颜色通道增益计算非常简便,快速,能够满足实时计算的需要。It can be known that under the premise of obtaining the probability distribution map of the reference image, the calculation of the gain of each color channel of the captured image is very simple and fast, and can meet the needs of real-time calculation.

步骤008、输出白平衡调整后的拍摄图像。Step 008, outputting the captured image after white balance adjustment.

本领域普通技术人员可以理解,上述步骤中建立的直方图可以采用不同的颜色坐标系,如RGB色度空间的(R-G)÷G,(B-G)÷G坐标,者在Ycbcr空间的Cb,Cr坐标,不做赘述。Those of ordinary skill in the art can understand that the histogram established in the above steps can adopt different color coordinate systems, such as (R-G) ÷ G in RGB chromaticity space, (B-G) ÷ G coordinates, or Cb, Cr in Ycbcr space coordinates, do not repeat them.

实施例六Embodiment six

本实施例与实施例五的不同之处在于,本实施例获得图像灰度点概率分布图的方法中,可以分别获得的室外光照或室内光照条件下,标准24色板的参考图像概率分布图,并可以分别存储室外光照或室内光照的标准24色板的参考图像概率分布图。The difference between this embodiment and the fifth embodiment is that in the method of obtaining the probability distribution map of image gray points in this embodiment, the reference image probability distribution map of the standard 24-color palette can be obtained under outdoor lighting or indoor lighting conditions respectively , and can respectively store the reference image probability distribution map of the standard 24 color palettes for outdoor lighting or indoor lighting.

在进行摄影操作时,用户可以选择当前摄影的场景模式为室外光照或室内光照,这样,根据所选择场景模式的灰度点概率分布图,来实现图像自动白平衡。When performing photography operations, the user can select the current shooting scene mode as outdoor lighting or indoor lighting, so that the automatic white balance of the image can be realized according to the gray point probability distribution map of the selected scene mode.

实施例七Embodiment seven

本实施例与实施例五、实施例六的不同之处在于,本实施例获得图像灰度点概率分布图的方法中,可以分别获得晴天日光、阴天日光或阴影,钨丝灯光、日光灯光或荧光灯光,等等条件下,标准24色板的参考图像概率分布图,并可以分别存储各参考图像的概率分布图。The difference between this embodiment and Embodiment 5 and Embodiment 6 is that in the method of obtaining the probability distribution map of image gray points in this embodiment, sunlight on sunny days, sunlight or shadows on cloudy days, tungsten lighting, and daylight lighting can be respectively obtained. Or fluorescent lighting, etc., the reference image probability distribution map of the standard 24 color plates, and can store the probability distribution map of each reference image separately.

这样,用户可以选择的当前摄影的场景模式更加细化、明确。In this way, the current shooting scene mode that the user can select is more detailed and clear.

在进行摄影操作时,用户可以选择当前摄影的场景模式为晴天日光、阴天日光或阴影,钨丝灯光、日光灯光或荧光灯光,等等,这样,根据所选择场景模式的灰度点概率分布图,来实现图像自动白平衡。When performing photography operations, the user can select the current shooting scene mode as sunny daylight, cloudy daylight or shadow, tungsten light, daylight light or fluorescent light, etc., so that the probability distribution of gray points according to the selected scene mode Figure, to achieve automatic image white balance.

综上所述,本发明的实施例提供的技术方案可以看出,由于获得了标准色板的参考图像灰度点概率分布图,这样,拍摄得到的图像中各像素点的灰度点概率值可以根据参考图像的灰度点概率分布图得到,使灰度点的判断更加精确,提高了白平衡增益计算的准确度。In summary, from the technical solutions provided by the embodiments of the present invention, it can be seen that since the gray point probability distribution map of the reference image of the standard color palette is obtained, the gray point probability value of each pixel in the captured image It can be obtained according to the gray point probability distribution map of the reference image, so that the judgment of the gray point is more accurate, and the accuracy of white balance gain calculation is improved.

易于理解的是,在本发明实施例中所述的各种直方图和分布图,包括图表、绘图、数列等多种可用于表示区域内数值分布的表现形式。It is easy to understand that the various histograms and distribution diagrams described in the embodiments of the present invention include charts, plots, numbers and other forms that can be used to represent the distribution of numerical values in a region.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in a computer-readable storage medium. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.

以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed in the present invention can easily think of changes or Replacement should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (21)

1.一种获得图像灰度点概率分布的方法,其特征在于,包括:1. A method for obtaining the probability distribution of image gray points, characterized in that, comprising: 拍摄具有彩色色块和灰度色块的参考图像;Take a reference image with color patches and grayscale patches; 根据所述参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据所述参考图象中灰度色块对应的各像素点的颜色值,建立灰度点直方图;Establish a color point histogram according to the color values of each pixel corresponding to the color block in the reference image, and establish a gray point according to the color values of each pixel corresponding to the gray color block in the reference image histogram; 将所述彩色点直方图和所述灰度点直方图,分别等同划分为多个区间,根据所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数,得到所述参考图像内各像素点的灰度点概率分布图。Dividing the color point histogram and the gray point histogram into a plurality of intervals respectively, according to the number of pixels in the corresponding intervals in the color point histogram and the gray point histogram, A gray point probability distribution diagram of each pixel point in the reference image is obtained. 2.根据权利要求1所述的获得图像灰度点概率分布的方法,其特征在于,所述彩色点直方图以及所述灰度点直方图的两个维度包括:2. The method for obtaining image gray point probability distribution according to claim 1, wherein the two dimensions of the color point histogram and the gray point histogram include: 所述各像素点在RGB色度空间的R÷G以及B÷G,或者(R-G)÷G以及(B-G)÷G;R÷G and B÷G, or (R-G)÷G and (B-G)÷G of each pixel in the RGB chromaticity space; 或者,所述各像素点在YCbCr色度空间的Cb以及Cr。Alternatively, each pixel is in Cb and Cr in the YCbCr chromaticity space. 3.根据权利要求1或2所述的获得图像灰度点概率分布的方法,其特征在于,根据所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数,得到所述参考图像的灰度点概率分布图,包括:3. The method for obtaining the probability distribution of image grayscale points according to claim 1 or 2, characterized in that, according to the number of pixels in the corresponding intervals in the color point histogram and the grayscale point histogram , to obtain the gray point probability distribution map of the reference image, including: 所述灰度点直方图内区间的像素点的个数为a,所述彩色点直方图内对应区间的像素点的个数为b,则该区间内的像素点为灰度点的概率值为p=a÷(a+b)。The number of pixels in the interval in the grayscale point histogram is a, and the number of pixels in the corresponding interval in the color point histogram is b, then the pixels in the interval are the probability values of grayscale points It is p=a÷(a+b). 4.根据权利要求1或2所述的获得图像灰度点概率分布的方法,其特征在于,所述参考图像为拍摄具有彩色色块和灰度色块的标准色板而得到的。4. The method for obtaining the probability distribution of image gray points according to claim 1 or 2, wherein the reference image is obtained by photographing a standard color palette with color patches and grayscale patches. 5.根据权利要求4所述的获得图像灰度点概率分布的方法,其特征在于,所述拍摄具有彩色色块和灰度色块的参考图像,包括:在预设光照下,拍摄具有彩色色决和灰度色块的标准色板,得到参考图像,所述预设光照包括:室外光照或室内光照,所述室外光照包括:晴天日光、阴天日光或阴影,所述室内光照包括:钨丝灯光、日光灯光或荧光灯光。5. The method for obtaining the probability distribution of image grayscale points according to claim 4, wherein said photographing a reference image with color patches and grayscale patches comprises: under preset illumination, photographing a reference image with color patches The standard color palette of the color decision and the grayscale color block is used to obtain a reference image. The preset lighting includes: outdoor lighting or indoor lighting, the outdoor lighting includes: sunny daylight, cloudy daylight or shadow, and the indoor lighting includes: Tungsten lighting, daylight lighting or fluorescent lighting. 6.一种白平衡方法,其特征在于,包括:6. A white balance method, characterized in that, comprising: 根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图,得到所述拍摄图像中各像素点的灰度点概率值;According to each color value of each pixel point in the captured image, and the gray-scale point probability distribution map of the reference image, the gray-scale point probability value of each pixel point in the captured image is obtained; 根据所述拍摄图像中各像素点的灰度点概率值,获得所述拍摄图像的光照估计;Obtaining an illumination estimate of the captured image according to the gray point probability value of each pixel in the captured image; 根据所述拍摄图像的光照估计,得到所述拍摄图像的各颜色通道的增益值以调整所述拍摄图像实现白平衡。According to the illumination estimation of the captured image, the gain value of each color channel of the captured image is obtained to adjust the captured image to achieve white balance. 7.根据权利要求6所述的白平衡方法,其特征在于,根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图,得到所述拍摄图像中各像素点的灰度点概率值,包括:7. The white balance method according to claim 6, characterized in that, according to each color value of each pixel in the captured image and the gray point probability distribution map of the reference image, the value of each pixel in the captured image is obtained. Gray point probability value, including: 根据拍摄图像中各像素点各颜色值,确定所述各像素点在所述参考图像的灰度点概率分布图中对应的位置;According to each color value of each pixel point in the captured image, determine the corresponding position of each pixel point in the gray point probability distribution map of the reference image; 根据所述各像素点在所述参考图像的灰度点概率分布图中对应的位置,得到所述各像素点对应的灰度点概率值。According to the corresponding position of each pixel point in the gray point probability distribution map of the reference image, the gray point probability value corresponding to each pixel point is obtained. 8.根据权利要求6所述的白平衡方法,其特征在于,根据所述拍摄图像中各像素点的灰度点概率值,获得所述拍摄图像的光照估计,包括:8. The white balance method according to claim 6, wherein the illumination estimation of the captured image is obtained according to the gray point probability value of each pixel in the captured image, comprising: 以所述拍摄图像中各像素点的灰度点概率值为权重,计算所有像素点各颜色值的加权平均值,获得所述拍摄图像各颜色通道的平均值即为拍摄图像的光照估计。Using the gray point probability value of each pixel in the captured image as a weight, calculate the weighted average of each color value of all pixels, and obtain the average value of each color channel of the captured image as the illumination estimate of the captured image. 9.根据权利要求6所述的白平衡方法,其特征在于,根据所述拍摄图像的光照估计,得到所述拍摄图像的各颜色通道的增益值以调整所述拍摄图像实现白平衡,包括:9. The white balance method according to claim 6, wherein the gain value of each color channel of the captured image is obtained according to the illumination estimation of the captured image to adjust the captured image to achieve white balance, comprising: 将所述拍摄图像的各颜色通道平均值取倒数,得到各颜色通道的增益值;Taking the inverse of the average value of each color channel of the captured image to obtain the gain value of each color channel; 通过所述各颜色通道的增益值调整控制所述拍摄图像实现白平衡。The captured image is controlled by adjusting the gain value of each color channel to achieve white balance. 10.根据权利要求6-9中任一所述的白平衡方法,其特征在于,所述图像的颜色通道包括RGB色度空间的R通道、G通道以及B通道,或者,YCbCr色度空间的Cb通道以及Cr通道。10. The white balance method according to any one of claims 6-9, wherein the color channels of the image include the R channel, the G channel and the B channel of the RGB chromaticity space, or the YCbCr chromaticity space Cb channel and Cr channel. 11.一种白平衡装置,其特征在于,包括:11. A white balance device, comprising: 灰度点概率值获取单元,用于根据拍摄图像中各像素点的各颜色值,以及参考图像的灰度点概率分布图,得到所述拍摄图像中各像素点的灰度点概率值;A gray-scale point probability value acquisition unit, configured to obtain the gray-scale point probability value of each pixel in the captured image according to the color values of each pixel in the captured image and the gray-scale point probability distribution map of the reference image; 光照估计单元,用于根据所述拍摄图像中各像素点的灰度点概率值,获得所述拍摄图像的光照估计;An illumination estimation unit, configured to obtain an illumination estimation of the captured image according to the gray point probability value of each pixel in the captured image; 增益值获取单元,用于根据所述拍摄图像的光照估计,得到所述拍摄图像的各颜色通道的增益值以调整图像实现白平衡。The gain value obtaining unit is configured to obtain the gain value of each color channel of the captured image according to the illumination estimation of the captured image, so as to adjust the image to achieve white balance. 12.根据权利要求11所述的白平衡装置,其特征在于,灰度点概率值获取单元,包括:12. The white balance device according to claim 11, wherein the gray point probability value acquisition unit comprises: 第一获取子单元,用于根据拍摄图像中各像素点各颜色值,确定所述各像素点在所述参考图像的灰度点概率分布图中对应的位置;The first acquisition subunit is configured to determine the corresponding position of each pixel in the gray point probability distribution map of the reference image according to each color value of each pixel in the captured image; 第二获取子单元,用于根据所述各像素点在所述参考图像的灰度点概率分布图中对应的位置,得到所述各像素点对应的灰度点概率值。The second obtaining subunit is configured to obtain the gray point probability value corresponding to each pixel point according to the corresponding position of each pixel point in the gray point probability distribution map of the reference image. 13.根据权利要求11所述的白平衡装置,其特征在于,光照估计单元,具体用于以拍摄图像中各像素点的灰度点概率值为权重,计算所有像素点各颜色值的加权平均值,获得拍摄图像各颜色通道的平均值即为图像的光照估计。13. The white balance device according to claim 11, characterized in that the illumination estimation unit is specifically configured to use the gray point probability value of each pixel in the captured image as a weight to calculate the weighted average of each color value of all pixels value, and the average value of each color channel of the captured image is obtained as the illumination estimation of the image. 14.根据权利要求11所述的白平衡装置,其特征在于,增益值获取单元,包括:14. The white balance device according to claim 11, wherein the gain value acquisition unit comprises: 增益值获取子单元,用于将所述拍摄图像的各颜色通道平均值取倒数,得到各颜色通道的增益值;The gain value acquisition subunit is used to take the reciprocal of the average value of each color channel of the captured image to obtain the gain value of each color channel; 增益控制子单元,用于通过增益值获取子单元得到的所述各颜色通道的增益值调整控制所述拍摄图像实现白平衡。The gain control subunit is used to adjust the gain value of each color channel obtained by the gain value acquisition subunit to control the captured image to achieve white balance. 15.根据权利要求11-14中任一所述的白平衡装置,其特征在于,所述图像的颜色通道包括RGB色度空间的R通道、G通道以及B通道,或者,YCbCr色度空间的Cb通道以及Cr通道。15. The white balance device according to any one of claims 11-14, wherein the color channels of the image include the R channel, the G channel and the B channel of the RGB chromaticity space, or the YCbCr chromaticity space Cb channel and Cr channel. 16.根据权利要求11所述的获得图像灰度点概率分布的装置,其特征在于,所述灰度点概率值获取单元包括图像获取单元,用于拍摄具有彩色色块和灰度色块的参考图像;直方图建立单元,用于根据所述参考图象中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据所述参考图像中灰度色块对应的各像素点的颜色值,建立灰度点直方图;直方图分析单元,用于将所述彩色点直方图和所述灰度点直方图,分别等同划分为多个区间,将所述区间内像素点的个数作为区间的值;灰度点概率计算单元,用于根据所述彩色点直方图和所述灰度点直方图对应区间的值,得到所述参考图像的灰度点概率分布图。16. The device for obtaining the probability distribution of image grayscale points according to claim 11, wherein the grayscale point probability value acquisition unit comprises an image acquisition unit for photographing images with color patches and grayscale patches. Reference image: a histogram building unit, used to create a color point histogram according to the color values of each pixel corresponding to the color color block in the reference image, and according to each color point corresponding to the gray color block in the reference image The color value of the pixel point is used to establish a gray point histogram; the histogram analysis unit is used to divide the color point histogram and the gray point histogram into multiple intervals respectively, and divide the pixels in the interval The number of points is used as the value of the interval; the gray point probability calculation unit is used to obtain the gray point probability distribution map of the reference image according to the value of the corresponding interval of the color point histogram and the gray point histogram . 17.根据权利要求16所述的获得图像灰度点概率分布的装置,其特征在于,所述直方图建立单元建立的彩色点直方图以及所述灰度点直方图的两个维度包括:17. The device for obtaining the probability distribution of image gray points according to claim 16, wherein the color point histogram established by the histogram building unit and the two dimensions of the gray point histogram include: 所述各像素点在RGB色度空间的R÷G以及B÷G,或者(R-G)÷G以及(B-G)÷G;R÷G and B÷G, or (R-G)÷G and (B-G)÷G of each pixel in the RGB chromaticity space; 或者,所述各像素点在YCbCr色度空间的Cb以及Cr。Alternatively, each pixel is in Cb and Cr in the YCbCr chromaticity space. 18.根据权利要求16所述的获得图像灰度点概率分布的装置,其特征在于,所述灰度点概率计算单元,用于所述灰度点直方图内区间的像素点的个数为a,所述彩色点直方图内对应区间的像素点的个数为b,计算得到该区间内的像素点为灰度点的概率值为p=a÷(a+b)。18. The device for obtaining the probability distribution of image gray-scale points according to claim 16, wherein the gray-scale point probability calculation unit is used for the number of pixels in the interval of the gray-scale point histogram to be a, the number of pixels in the corresponding interval in the color point histogram is b, and the calculated probability value of the pixel in the interval being a grayscale point is p=a÷(a+b). 19.一种获得图像灰度点概率分布的装置,其特征在于,包括:19. A device for obtaining the probability distribution of image gray points, comprising: 图像获取单元,用于拍摄具有彩色色块和灰度色块的参考图像;An image acquisition unit, used for taking reference images with color patches and grayscale patches; 直方图建立单元,用于根据所述参考图像中彩色色块对应的各像素点的各颜色值,建立彩色点直方图,以及根据所述参考图象中灰度色块对应的各像素点的颜色值,建立灰度点直方图;A histogram building unit, configured to create a color point histogram according to the color values of the pixels corresponding to the color blocks in the reference image, and to establish a histogram of color points according to the color values of the pixels corresponding to the gray color blocks in the reference image. Color value, build gray point histogram; 直方图分析单元,用于将所述彩色点直方图和所述灰度点直方图,分别等同划分为多个区间,获得所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数;a histogram analysis unit, configured to equally divide the color point histogram and the gray point histogram into multiple intervals, and obtain corresponding intervals in the color point histogram and the gray point histogram The number of pixels in 灰度点概率计算单元,用于根据所述彩色点直方图和所述灰度点直方图中的对应区间中的像素点个数,得到所述参考图像的灰度点概率分布图。The gray point probability calculation unit is configured to obtain the gray point probability distribution map of the reference image according to the number of pixels in the color point histogram and the corresponding interval in the gray point histogram. 20.根据权利要求19所述的获得图像灰度点概率分布的装置,其特征在于,所述直方图建立单元建立的彩色点直方图以及所述灰度点直方图的两个维度包括:20. The device for obtaining the probability distribution of image gray points according to claim 19, wherein the color point histogram established by the histogram building unit and the two dimensions of the gray point histogram include: 所述各像素点在RGB色度空间的R÷G以及B÷G,或者(R-G)÷G以及(B-G)÷G;R÷G and B÷G, or (R-G)÷G and (B-G)÷G of each pixel in the RGB chromaticity space; 或者,所述各像素点在YCbCr色度空间的Cb以及Cr。Alternatively, each pixel is in Cb and Cr in the YCbCr chromaticity space. 21.根据权利要求19所述的获得图像灰度点概率分布的装置,其特征在于,所述灰度点概率计算单元,用于所述灰度点直方图内区间的像素点的个数为a,所述彩色点直方图内对应区间的像素点的个数为b,计算得到该区间内的像素点为灰度点的概率值为p=a÷(a+b)。21. The device for obtaining the probability distribution of image gray-scale points according to claim 19, wherein the gray-scale point probability calculation unit is used for the number of pixels in the interval of the gray-scale point histogram to be a, the number of pixels in the corresponding interval in the color point histogram is b, and the calculated probability value of the pixel in the interval being a gray point is p=a÷(a+b).
CN 200910088816 2009-07-20 2009-07-20 Method and device for obtaining probability distribution of image grey spots and white balance method and device Expired - Fee Related CN101957988B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910088816 CN101957988B (en) 2009-07-20 2009-07-20 Method and device for obtaining probability distribution of image grey spots and white balance method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910088816 CN101957988B (en) 2009-07-20 2009-07-20 Method and device for obtaining probability distribution of image grey spots and white balance method and device

Publications (2)

Publication Number Publication Date
CN101957988A true CN101957988A (en) 2011-01-26
CN101957988B CN101957988B (en) 2013-11-06

Family

ID=43485305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910088816 Expired - Fee Related CN101957988B (en) 2009-07-20 2009-07-20 Method and device for obtaining probability distribution of image grey spots and white balance method and device

Country Status (1)

Country Link
CN (1) CN101957988B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209246A (en) * 2011-05-23 2011-10-05 北京工业大学 Real-time video white balance processing system
CN103686112A (en) * 2012-09-19 2014-03-26 鸿富锦精密工业(深圳)有限公司 Image white balance method and camera device
CN103974053A (en) * 2014-05-12 2014-08-06 华中科技大学 Automatic white balance correction method based on grey dot extraction
CN104052979A (en) * 2013-03-12 2014-09-17 英特尔公司 Apparatus and techniques for image processing
CN104683780A (en) * 2015-03-24 2015-06-03 广东本致科技有限公司 Automatic white balance method and device of video surveillance camera
CN105828058A (en) * 2015-05-29 2016-08-03 维沃移动通信有限公司 Adjustment method and device of white balance
CN103686112B (en) * 2012-09-19 2016-11-30 鸿富锦精密工业(深圳)有限公司 Image white balance method and camera head
CN108718405A (en) * 2014-09-17 2018-10-30 深圳市大疆创新科技有限公司 Automatic white balance system and method
CN110694942A (en) * 2019-10-21 2020-01-17 武汉纺织大学 Color difference sorting method for solar cells
CN112204957A (en) * 2019-09-20 2021-01-08 深圳市大疆创新科技有限公司 White balance processing method and device, movable platform and camera
CN113763258A (en) * 2021-02-01 2021-12-07 北京沃东天骏信息技术有限公司 Beautifying method and device for video image
CN115131349A (en) * 2022-08-30 2022-09-30 新泰市中医医院 White balance adjusting method and system based on endocrine test paper color histogram

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1193399A (en) * 1996-06-20 1998-09-16 三星电子株式会社 A histogram equalization apparatus for contrast enhancement of moving image and method therefor
CN1741068A (en) * 2005-09-22 2006-03-01 上海广电(集团)有限公司中央研究院 Histogram equalizing method based on boundary
US20080101690A1 (en) * 2006-10-26 2008-05-01 De Dzwo Hsu Automatic White Balance Statistics Collection

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1193399A (en) * 1996-06-20 1998-09-16 三星电子株式会社 A histogram equalization apparatus for contrast enhancement of moving image and method therefor
CN1741068A (en) * 2005-09-22 2006-03-01 上海广电(集团)有限公司中央研究院 Histogram equalizing method based on boundary
US20080101690A1 (en) * 2006-10-26 2008-05-01 De Dzwo Hsu Automatic White Balance Statistics Collection

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102209246A (en) * 2011-05-23 2011-10-05 北京工业大学 Real-time video white balance processing system
CN102209246B (en) * 2011-05-23 2013-01-09 北京工业大学 Real-time video white balance processing system
CN103686112A (en) * 2012-09-19 2014-03-26 鸿富锦精密工业(深圳)有限公司 Image white balance method and camera device
CN103686112B (en) * 2012-09-19 2016-11-30 鸿富锦精密工业(深圳)有限公司 Image white balance method and camera head
CN104052979A (en) * 2013-03-12 2014-09-17 英特尔公司 Apparatus and techniques for image processing
CN103974053B (en) * 2014-05-12 2016-04-13 华中科技大学 A kind of Automatic white balance antidote extracted based on ash point
CN103974053A (en) * 2014-05-12 2014-08-06 华中科技大学 Automatic white balance correction method based on grey dot extraction
CN108718405B (en) * 2014-09-17 2019-11-26 深圳市大疆创新科技有限公司 Auto white balance system and method
CN108718405A (en) * 2014-09-17 2018-10-30 深圳市大疆创新科技有限公司 Automatic white balance system and method
CN104683780A (en) * 2015-03-24 2015-06-03 广东本致科技有限公司 Automatic white balance method and device of video surveillance camera
CN104683780B (en) * 2015-03-24 2017-01-04 广东本致科技有限公司 The auto white balance method of a kind of video monitoring camera and device
CN105828058B (en) * 2015-05-29 2019-02-15 维沃移动通信有限公司 Method and device for adjusting white balance
CN105828058A (en) * 2015-05-29 2016-08-03 维沃移动通信有限公司 Adjustment method and device of white balance
CN112204957A (en) * 2019-09-20 2021-01-08 深圳市大疆创新科技有限公司 White balance processing method and device, movable platform and camera
WO2021051382A1 (en) * 2019-09-20 2021-03-25 深圳市大疆创新科技有限公司 White balance processing method and device, and mobile platform and camera
CN110694942A (en) * 2019-10-21 2020-01-17 武汉纺织大学 Color difference sorting method for solar cells
CN113763258A (en) * 2021-02-01 2021-12-07 北京沃东天骏信息技术有限公司 Beautifying method and device for video image
CN115131349A (en) * 2022-08-30 2022-09-30 新泰市中医医院 White balance adjusting method and system based on endocrine test paper color histogram
CN115131349B (en) * 2022-08-30 2022-11-18 新泰市中医医院 White balance adjusting method and system based on endocrine test paper color histogram

Also Published As

Publication number Publication date
CN101957988B (en) 2013-11-06

Similar Documents

Publication Publication Date Title
CN101957988B (en) Method and device for obtaining probability distribution of image grey spots and white balance method and device
CN1994000B (en) Automatic white balance method and apparatus
CN112752023B (en) Image adjusting method and device, electronic equipment and storage medium
CN104618702B (en) A kind of digital camera auto white balance method supposed based on white block
EP3648459B1 (en) White balance adjustment method and apparatus, camera and medium
CN103227928B (en) White balance adjusting method and device
CN101621705B (en) Method and device for automatic white balance
TWI389559B (en) Foreground image separation method
CN109767467A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN105578166B (en) A kind of colour temperature determines method and device
CN103297789B (en) White balance correcting method and white balance correcting device
CN109688396B (en) Image white balance processing method and device and terminal equipment
US20190320152A1 (en) White balance calibration method based on skin color data and image processing apparatus using the same
KR20090074090A (en) Auto White Balance Statistics Collection
TWI532385B (en) White balance method and apparatus thereof
CN104954772B (en) An Image Near Gray Pixel Selection Algorithm Applied to Automatic White Balance Algorithm
KR20170030933A (en) Image processing device and auto white balancing metohd thereof
US20100321523A1 (en) Method, apparatus, and system for selecting pixels for automatic white balance processing
CN114915778B (en) Camera testing method and system for marking papers
JP2008011289A (en) Digital camera
CN114866754A (en) Automatic white balance method and device, computer readable storage medium and electronic equipment
CN102088539A (en) Method and system for evaluating pre-shot picture quality
CN116739875A (en) Image processing method and intelligent processing system
US20130093914A1 (en) Transformations and White Point Constraint Solutions for a Novel Chromaticity Space
CN109391804A (en) Photographic device, image processing apparatus and system, control method and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20131106

Termination date: 20200720

CF01 Termination of patent right due to non-payment of annual fee