White point detection method, automatic white balance method, calibration method, medium and equipment

By converting the target image to the target color space and determining the pixel points in the white point area, the problem of low white point detection accuracy in the prior art is solved, and higher white point detection accuracy and color temperature estimation accuracy are achieved.

CN114494209BActive Publication Date: 2025-05-02FUZHOU ROCKCHIP SEMICON
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210105006.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-28
Publication Date
2025-05-02
Estimated Expiration
2042-01-28

AI Technical Summary

Technical Problem

In the prior art, the white point detection accuracy is not high, resulting in inaccurate color temperature estimation.

Method used

By converting the target image to the target color space, and determining the pixels in the transformed target image that are located in the white dot area as the white dots in the target image. This method uses the first color value and the second color value to represent the color, and is independent of the brightness, which can offset the influence of the brightness change on the white point distribution.

Benefits of technology

It improves the accuracy of white point detection, enhances the accuracy of color temperature estimation, can more effectively identify white point areas, and simplifies white point judgment logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494209B_ABST
    Figure CN114494209B_ABST
Patent Text Reader

Abstract

The present invention provides a white point detection method, an automatic white balance method, a calibration method, a medium and a device. The white point detection method comprises: acquiring a target image, the target image corresponds to a target light source; performing color transformation on the target image to transform the target image into a target color space to generate a target color space image, the target color space image is represented by a first color value and a second color value, the first color value is used to represent the color temperature, and the second color value is used to represent the color rendering index; and determining a pixel point located in a white point area in the target color space image as a white point in the target image. The white point detection result obtained by the white point detection method has a high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image processing method, and in particular to a white point detection method, an automatic white balance method, a calibration method, a medium and a device. Background Art

[0002] When people observe the natural world with their eyes, the perception of the same color is basically the same under different lighting conditions. This ability to eliminate or reduce the influence of light sources and achieve "seeing" the actual surface color of objects is called color constancy. However, cameras do not have this ability. Under different lighting conditions, target objects with the same actual color may present different imaging colors. This is because the image sensor on the camera only records all the light projected onto it, and it cannot distinguish whether the color light projected onto the image sensor is formed by the color reflection of the object itself or caused by biased ambient light. Using automatic white balance technology, the camera can automatically estimate the ambient color light and remove the influence of the scene lighting color so that the camera can have the same color constancy as the human visual system. Summary of the invention

[0003] The object of the present invention is to provide a white point detection method, an automatic white balance method, a calibration method, a medium and a device, which are used to solve the problem of low white point detection accuracy in the prior art.

[0004] A first aspect of the present invention provides a white point detection method, which includes: acquiring a target image, the target image corresponding to a target light source; performing color transformation on the target image to transform the target image into a target color space to generate a target color space image, the target color space image being represented by a first color value and a second color value, the first color value being used to represent color temperature, and the second color value being used to represent a color rendering index; and determining a pixel point in the target color space image that is located in a white point area as a white point in the target image.

[0005] In an embodiment of the first aspect, the white point detection method further includes: determining transformation parameters, wherein the transformation parameters are associated with a device used to acquire the target image; wherein performing color transformation on the target image includes: performing the color transformation according to the transformation parameters.

[0006] In an embodiment of the first aspect, determining the transformation parameters includes: obtaining images of a standard color card captured by the device under the illumination of multiple reference light sources as multiple first reference images; performing the color transformation according to a set of predetermined parameters to transform the multiple first reference images into multiple target color space reference images; determining, for the set of predetermined parameters, a discrete degree of the second color values ​​of pixel points in the multiple target color space reference images corresponding to the reference white points in the multiple first reference images; and determining the transformation parameters according to the target predetermined parameters in the set of predetermined parameters corresponding to the discrete degree.

[0007] In one embodiment of the first aspect, determining the degree of discreteness of the second color value of a pixel point in a plurality of the target color space reference images corresponding to a reference white point in a plurality of the first reference images includes: determining the degree of deviation of the second color value relative to a reference line in the target color space.

[0008] In one embodiment of the first aspect, 1. determining the degree of discreteness of the second color value of a pixel point in a plurality of the target color space reference images corresponding to a reference white point in a plurality of the first reference images includes: determining the degree of deviation of the second color value relative to the reference line in the target color space.

[0009] In an embodiment of the first aspect, performing color transformation on the target image includes: performing a first transformation on the target image to transform the target image into an intermediate color space to generate an intermediate color space image, wherein the intermediate color space image is independent of the brightness of the target image; and performing a second transformation on the intermediate color space image to generate the target color space image, so that the target color space is rotated by a set angle relative to the intermediate color space.

[0010] In an embodiment of the first aspect, the target color space includes a first axis and a second axis intersecting the first axis, the first axis represents the color temperature, and the second axis represents the color rendering index.

[0011] In an embodiment of the first aspect, performing a first transformation on the target image includes performing the first transformation by using the following equations 1 and 2: Formula 1; Formula 2: Performing a second transformation on the intermediate color space image includes performing the second transformation by the following Formula 3: Formula 3; wherein ω1, ω2, ω3 and θ are the transformation parameters, x and y represent the color values ​​of the pixels of the intermediate color space image in the intermediate color space, X and Y represent the color values ​​of the pixels of the target color space image in the target color space, R, G and B represent the color values ​​of the R channel, G channel and B channel of the pixels of the target image, x0 and y0 represent the color value of the white point under the illumination of a specific light source in the intermediate color space, and x0 and y0 represent the origin of the rotation, and θ represents the set angle.

[0012] In an embodiment of the first aspect, the white point detection method also includes: determining the white point area, wherein determining the white point area includes: obtaining an image of a standard color card taken under the illumination of the target light source as a second reference image; performing the color transformation on the reference white point in the second reference image to transform the reference white point to the target color space to generate a target color space reference white point; and determining the white point area according to the distribution of the reference white point in the target color space.

[0013] In an embodiment of the first aspect, determining the white point area according to the distribution of the reference white point in the target color space includes: determining the white point area having a rectangular shape in the target color space.

[0014] A second aspect of the present invention provides another white point detection method, which includes: acquiring a target image, the target image corresponding to a target light source; performing a first color transformation on the target image to transform the target image into a target color space to generate a target color space image, the target color space image being represented by a first color value and a second color value, the first color value being used to represent a color temperature, and the second color value being used to represent a color rendering index; determining a pixel point located in a first white point area in the target color space image as a first candidate white point; performing a second color transformation on the target image to transform the target image into a UV color space to generate a UV color space image; determining a pixel point located in a second white point area in the UV color space image as a second candidate white point; and determining a white point in the target image based on the first candidate white point and the second candidate white point.

[0015] The third aspect of the present invention provides an automatic white balance method, which comprises: obtaining the white point in the target image using the white point detection method according to any one of the first aspect or the second aspect of the present invention; and determining the white balance gain corresponding to the target light source according to the color value of the white point in the target image.

[0016] The fourth aspect of the present invention provides a transformation parameter calibration method, which comprises: determining the transformation parameters by a white point detection method according to any one of items 2 to 5 of the first aspect of the present invention; and determining the transformation parameters as calibration parameters corresponding to the color space of the device.

[0017] The fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the white point detection method according to any one of the first aspect or the second aspect of the present invention, the automatic white balance method according to the third aspect of the present invention, or the transformation parameter calibration method according to the fourth aspect of the present invention.

[0018] The fifth aspect of the present invention provides an electronic device, comprising: a memory configured to store a computer program; and a processor, communicatively connected to the memory and configured to call the computer program to execute the white point detection method according to any one of the first aspect or the second aspect of the present invention, the automatic white balance method according to the third aspect of the present invention, or the transformation parameter calibration method according to the fourth aspect of the present invention.

[0019] As described above, the white spot detection method described in one or more embodiments of the present invention has the following beneficial effects:

[0020] Compared with the prior art, the present invention proposes a different white point detection method, which transforms the target image into the target color space and obtains the pixel points located in the white point area of ​​the target image after the color transformation as the white point in the target image. In this way, the white point detection result is more accurate, which is conducive to improving the accuracy of color temperature estimation.

[0021] In addition, the colors in the target color space are represented by a first color value and a second color value, and both the first color value and the second color value are independent of brightness. Therefore, the white point detection method can offset the impact of brightness changes on white point distribution, which is conducive to further improving the accuracy of white point detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Shown is a flow chart of a white spot detection method according to a specific embodiment of the present invention.

[0023] Figure 2A FIG. 4 is a detailed flow chart of determining transformation parameters of the white point detection method according to the present invention in a specific embodiment.

[0024] Figure 2B Shown is an example diagram of a standard color card in a specific embodiment of the white point detection method of the present invention.

[0025] Figure 2C FIG. 1 is an exemplary diagram of a first reference diagram in a specific embodiment of the white point detection method of the present invention.

[0026] Figure 2D FIG. 4 is a detailed flow chart of step S24 of the white spot detection method according to the present invention in a specific embodiment.

[0027] Figure 2E Shown is an example diagram of the result of color transformation in a specific embodiment of the white point detection method of the present invention.

[0028] Figure 3 Shown is a specific flow chart of color transformation in a specific embodiment of the white point detection method of the present invention.

[0029] Figure 4A Shown is a specific flow chart of obtaining a white spot area in a specific embodiment of the white spot detection method of the present invention.

[0030] Figure 4B Shown is an example diagram of a white spot area obtained by the white spot detection method of the present invention in a specific embodiment.

[0031] Figure 5 Shown is a flow chart of a white spot detection method according to a specific embodiment of the present invention.

[0032] Figure 6 Shown is a flow chart of the automatic white balance method of the present invention in a specific embodiment.

[0033] Figure 7 Shown is a schematic structural diagram of the electronic device of the present invention in a specific embodiment. DETAILED DESCRIPTION

[0034] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0035] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The illustrations only show the components related to the present invention rather than the number, shape and size of the components in actual implementation. The type, quantity and proportion of each component in actual implementation may be changed at will, and the component layout type may also be more complicated. In addition, in this article, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0036] In some technical solutions, the RGB components of an image are usually used to estimate the color temperature and thus achieve automatic white balance. However, it is difficult to accurately estimate the color temperature using the RGB components of an image. For example, the RGB response of a wood-colored surface under a cold fluorescent lamp and a white surface under candlelight may be relatively close. It is difficult to correctly estimate these two color temperatures using the RGB components of an image, and the performance of automatic white balance will be reduced when the color temperature estimation is wrong.

[0037] According to the embodiment of the present disclosure, a novel white point detection method is provided, which transforms the target image into the target color space, and determines the pixel points in the white point area of ​​the transformed target image as the white points in the target image. In this way, the technical solution according to the embodiment of the present disclosure does not rely on the RGB components of the target image to perform white point detection, so the obtained white point detection result has higher accuracy, which is conducive to improving the accuracy of color temperature estimation.

[0038] Hereinafter, specific embodiments of the present disclosure will be described with reference to the accompanying drawings through exemplary embodiments.

[0039] Figure 1 1 is a flow chart showing a white point detection method according to an embodiment of the present disclosure. Each step in this flow chart can be implemented by one or more specific modules. In some embodiments, these modules can be modules in chips such as GPU and DSP. Figure 1 As shown, the white spot detection method includes the following steps S11 to S13.

[0040] In step S11, a target image is acquired, and the target image corresponds to a target light source. The target image may be an image of an object captured under the illumination of the target light source. The device for capturing the image includes but is not limited to a digital camera.

[0041] In step S12, color transformation is performed on the target image to transform the target image into a target color space to generate a target color space image, wherein the target color space image is represented by a first color value and a second color value, wherein the first color value is used to represent the color temperature, and the second color value is used to represent the color rendering index.

[0042] When the target color space is described in the form of a coordinate system, if the first color value corresponds to the abscissa of the coordinate system and the second color value corresponds to the ordinate of the coordinate system, the target color space has the following two properties: along the X direction (i.e., the horizontal direction), only the color temperature of the color is changed, and the color temperature changes from low to high from left to right; along the Y direction (i.e., the vertical direction), only the position on the isochromatic temperature line is changed, that is, the color rendering index of different colors in the Y direction is different. At this time, the target color space can be regarded as a distortion transformation of the CIE1931 chromaticity coordinate plane.

[0043] In step S13, the pixel points in the target color space image located in the white point area are determined as the white points in the target image. The white point area can be preset according to actual needs or experience, or can be calibrated using a corresponding calibration method, which is not limited in the present invention. The determined white point area can be used to make various adjustments to the target image or the device for shooting the image (for example, white balance adjustment).

[0044] According to the above description, this embodiment proposes a white point detection method different from the prior art, which transforms the target image into the target color space and obtains the pixel points located in the white point area of ​​the target image after the color transformation as the white point in the target image. In this way, the white point detection result is more accurate, which is conducive to improving the accuracy of color temperature estimation.

[0045] In addition, the colors in the target color space are represented by a first color value and a second color value, and both the first color value and the second color value are independent of brightness. Therefore, the white point detection method can offset the impact of brightness changes on white point distribution, which is conducive to further improving the accuracy of white point detection.

[0046] Actual test results show that in this embodiment, after the target image is converted into the target color space, all white points are distributed in a regular rectangular area, so white point judgment can be achieved conveniently and quickly, thereby greatly simplifying the white point judgment logic.

[0047] In one embodiment of the present disclosure, the white point detection method further includes: determining transformation parameters, wherein the transformation parameters are associated with a device used to acquire the target image; wherein performing color transformation on the target image includes: performing the color transformation according to the transformation parameters.

[0048] Figure 2A FIG. 4 is a flow chart showing how to obtain the transformation parameters according to an embodiment of the present disclosure. Figure 2A As shown, obtaining the transformation parameters includes the following steps S21 to S23.

[0049] In step S21, images of a standard color card photographed by the device under illumination of multiple reference light sources are obtained as multiple first reference images, wherein the standard color card at least includes a white color block.

[0050] Figure 2B is an example diagram showing a standard color card according to an embodiment of the present disclosure. For example, Figure 2B The X-Rite 24 standard color card is shown. It should be noted that the X-Rite 24 standard color card in practice contains 24 color blocks of different colors, wherein the pixels in color blocks 19 to 22 can be regarded as white points, and the pixels in the remaining color blocks can be regarded as non-white points. Figure 2C is an exemplary diagram illustrating a first reference diagram according to an embodiment of the present disclosure. Figure 2C The images of the standard color card taken under different reference light sources (including: A light source, CWF light source, D50 light source, D65 light source, D75 light source, HZ light source and TL84 light source) are shown, that is, the first reference images corresponding to different reference light sources.

[0051] Preferably, each of the reference light sources is located on or near the blackbody locus. For any reference light source, the reference light source being located near the blackbody locus means that the distance between the chromaticity of the reference light source and the blackbody locus is less than a preset distance value. It should be noted that the fact that each of the reference light sources is located on or near the blackbody locus is only a preferred embodiment of the present invention, but the present invention is not limited thereto. In practical applications, a reference light source that is far away from the blackbody estimation may also be selected. For example, Figure 2C The CWF light source in the figure is the light source far away from the blackbody locus, and the other light sources are all on or near the blackbody locus.

[0052] Preferably, after acquiring each of the first reference images, this embodiment further includes a step of demosaicing each of the first reference images.

[0053] In step S22, the color transformation is performed according to a set of predetermined parameters to transform the first reference images into a plurality of target color space reference images.

[0054] In step S23, for the set of predetermined parameters, the discrete degrees of the second color values ​​of the pixel points in the plurality of target color space reference images corresponding to the reference white points in the plurality of first reference images are determined.

[0055] The reference white point refers to a white point in the first reference image, corresponding to a white block in the standard color card. Specifically, the second color value of the pixel corresponding to each reference white point can be obtained by performing a color transformation on the reference white points in each of the first reference images using the set of predetermined parameters. Therefore, the second color value Y of the pixel corresponding to each of the reference white points can be regarded as a function of the predetermined parameters, that is, Y=f(Q), where Q is a set of predetermined parameters and f is the corresponding relationship between Q and Y.

[0056] In step S24, the transformation parameter is determined according to the target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters.

[0057] As mentioned above, the second color value Y of the pixel corresponding to each of the reference white points can be regarded as a function of the predetermined parameters. Therefore, assuming that the number of the reference white points is N, the second color values ​​of N corresponding pixel points can be obtained for any set of predetermined parameters Q, and then the discreteness of the second color values ​​of the N corresponding pixel points can be obtained, and the discreteness can be represented by variance or standard deviation, for example. Therefore, there is also a corresponding relationship between the discreteness of the second color value of the pixel corresponding to each of the reference white points and the predetermined parameters, from which it can be further known that the transformation parameters can be determined according to the target predetermined parameters corresponding to the discreteness in the set of predetermined parameters. For example, the predetermined parameters can be solved with the goal of minimizing the discreteness to obtain a set of target predetermined parameters that make the discreteness sufficiently small as the transformation parameters. However, the present invention is not limited to this, and other methods can also be used to obtain the transformation parameters in actual applications.

[0058] According to the above description, the present embodiment can obtain a set of transformation parameters that minimize the discrete degree of the second color values ​​of the pixel points corresponding to the reference white points in the first reference images. After color transformation of any image is performed according to the transformation parameters, it can be ensured that the distribution of the white points in the target color space under the illumination of light sources with different color temperatures but similar color rendering indices is approximately on a horizontal line, and that the distribution of the white points in the target color space under the illumination of light sources with similar color temperatures but different color rendering indices is approximately on a vertical line.

[0059] Optionally, determining the degree of discreteness of the second color value of a pixel point in a plurality of the target color space reference images corresponding to a reference white point in a plurality of the first reference images includes: determining the degree of deviation of the second color value relative to a reference line in the target color space, and the degree of deviation can be expressed, for example, by variance, standard deviation, coefficient of dispersion, etc.

[0060] Optionally, Figure 2DFIG. 4 is a flowchart showing how to determine the transformation parameter according to the target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters according to an embodiment of the present disclosure. Figure 2D As shown, determining the transformation parameter according to the target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters includes the following steps S241 and S242.

[0061] In step S241, it is determined whether the discrete degree is less than a predetermined value. The predetermined value can be set according to actual needs or experience.

[0062] In step S242, if the discrete degree is less than the predetermined value, the transformation parameter is determined according to the target predetermined parameter corresponding to the discrete degree.

[0063] Figure 2E is an example diagram showing the result of color transformation according to an embodiment of the present disclosure. For example, Figure 2D A set of transformation parameters obtained in this embodiment is shown. Figure 2C The results of color transformation of the white points in each first reference image are shown. According to the figure, it can be seen that the color temperature gradually increases from left to right in the target color space, and the white points under the illumination of the HZ light source, A light source, TL84 light source, D65 light source and D75 light source located on the black body trajectory are basically on a straight line parallel to the X-axis. In addition, for the white points under the illumination of the TL84 light source and the CWF light source with similar color temperatures but different color rendering indexes, their X coordinates are close but the Y coordinates are quite different. Therefore, after the color transformation of the target image based on the transformation parameters obtained in this embodiment, the colors in the target image after color transformation can be represented by the first color value and the second color value, and the first color value is only related to the color temperature, and the second color value is only related to the color rendering index.

[0064] It should be noted that the above-mentioned method of obtaining the transformation parameters is only an optional method, but the present invention is not limited thereto. In practical applications, the transformation parameters can also be set according to actual needs or experience.

[0065] Figure 3 FIG. 1 is a flow chart showing a method for performing color transformation on the target image according to an embodiment of the present disclosure. Figure 3 As shown, the method includes the following steps S31 to S32.

[0066] In step S31, a first transformation is performed on the target image to transform the target image into an intermediate color space so as to generate an intermediate color space image, wherein the intermediate color space image is independent of the brightness of the target image.

[0067] In step S32, a second transformation is performed on the intermediate color space image to generate the target color space image, so that the target color space is rotated by a set angle relative to the intermediate color space.

[0068] In this embodiment, the first transformation and the second transformation can be implemented by using corresponding transformation parameters. The transformation parameters can be set according to actual needs or experience, or can be used Figure 2A Obtained by the method shown.

[0069] Optionally, the target color space includes a first axis and a second axis intersecting the first axis, the first axis represents the color temperature, and the second axis represents the color rendering index.

[0070] In one embodiment of the present disclosure, a first transformation is performed on an RGB image (including a target image, a first reference image and / or a second reference image) by using the following equations (1) and (2), and a second transformation is performed on the intermediate color space image by using the following equation (3):

[0071]

[0072]

[0073]

[0074] Wherein ω1, ω2, ω3 and θ are the transformation parameters, x and y represent the color values ​​of the pixels of the intermediate color space image in the intermediate color space, X and Y represent the color values ​​of the pixels of the target color space image in the target color space, R, G and B represent the color values ​​of the R channel, G channel and B channel of the pixels of the target image, x0 and y0 represent the color value of the white point in the intermediate color space under the illumination of a specific light source, and x0 and y0 represent the origin of the rotation, θ represents the set angle, and the specific light source is, for example, a D65 light source.

[0075] Optionally, the transformation parameters in this embodiment can be Figure 2A At this time, if the variance varY in the Y direction is used to represent the discrete degree of the second color value of the pixel points corresponding to the reference white points in the first reference images, the transformation parameter can be obtained by solving the following formula (4):

[0076] [ω1,ω2,ω3,θ]=argmin(varY), equation (4).

[0077] In an embodiment of the present disclosure, the white spot detection method further includes: determining the white spot area. Figure 4AFIG. 4 is a flow chart showing a method for determining the white spot area according to an embodiment of the present disclosure. Figure 4A As shown, the method includes the following steps S41 to S43.

[0078] S41, obtaining an image of the standard color card photographed under the illumination of the target light source as a second reference image; wherein the second reference image is photographed by the same device as the target image.

[0079] S42, performing the color transformation on the reference white point in the second reference image to transform the reference white point into the target color space to generate a target color space reference white point. In this embodiment, the reference white point is a white point in the second reference image, corresponding to a white block in the standard color card.

[0080] S43, determining the white point region according to the distribution of the reference white points in the target color space. For example, the region within the minimum circumscribed polygon of each reference white point may be obtained as the white point region, but the present invention is not limited thereto.

[0081] Preferably, determining the white point area according to the distribution of the reference white point in the target color space includes: determining the white point area having a rectangular shape in the target color space. This method is easy to implement and has a simpler hardware structure.

[0082] Preferably, the range of the white point area can be adaptively adjusted according to the number of the reference white points and the ambient brightness. For example, when the number of the reference white points is large or the ambient brightness is high, the range of the white point area can be appropriately expanded; when the number of the reference white points is small or the ambient brightness is low, the range of the white point area can be appropriately reduced.

[0083] Figure 4B is an example diagram showing a white point region according to an embodiment of the present disclosure. In particular, when the target image uses the above-described formula (1) to implement color transformation, the distribution of pixels of different colors in the standard color card in the target color space is as follows: Figure 4B As shown in the figure, the numbers correspond to the numbers of the color blocks, and the pixels in color blocks 19 to 22 are white points. The white point areas corresponding to different light sources can be obtained by using rectangles to select the white points under different light sources. For example, when the target light source is the HZ light source, the corresponding white point area is the area in the leftmost rectangular box. When the target light source is the D75 light source, the corresponding white point area is the area in the rightmost rectangular box.

[0084] Figure 5 is a flow chart showing a white point detection method according to an embodiment of the present disclosure. Figure 5As shown, the method includes the following steps S51 to S53.

[0085] In step S51, a target image is acquired, where the target image corresponds to a target light source.

[0086] In step S52, the target image is transformed from the device color space to the target color space to generate a target color space image, and the target color space is also the XY domain. The target color space has the following two properties: along the X direction (horizontal direction), only the correlated color temperature is changed, from low color temperature to high color temperature from left to right; along the Y direction (vertical direction), only the position on the isochromatic temperature line is changed, that is, the color rendering index is different.

[0087] In this embodiment, the target color space can be regarded as a distortion transformation of the CIE1931 chromaticity coordinate plane. Based on the above two-point properties of the target color space, after the target image is converted from the device color space to the target color space, the obtained white point areas are all regular rectangles, which can greatly simplify the white point judgment logic. In addition, since different shooting devices correspond to different device color spaces, the transformation parameters used in the color transformation process are related to the shooting device.

[0088] In step S53, pixel points located in the white point area in the target color space image are determined as white points in the target image.

[0089] Optionally, in this embodiment, step S52 can achieve color transformation by transforming parameters ω1, ω2, ω3 and θ, and the sum of ω1, ω2 and ω3 is preferably 1. The method for obtaining the above transformation parameters includes the following steps.

[0090] First, the same shooting device as the target image is used to shoot images of the standard color card under different reference light sources as first reference images. Preferably, after acquiring the first reference images, this embodiment further includes the step of demosaicing each of the first reference images.

[0091] Subsequently, a first transformation is performed on each of the first reference images to eliminate the influence of brightness. Optionally, the first transformation is performed by equations (2) and (3) described above. R, G and B are the color values ​​of the R channel, G channel and B channel of the pixel before the color transformation, that is, the color value of the pixel in the device color space. The first transformation is used to transform the first reference image into an intermediate color space, and (x, y) is the first color value and the second color value of the pixel in the intermediate color domain after the first transformation, that is, the intermediate color value.

[0092] In order to meet the above two-point properties of the target color space, it is necessary to make the white points illuminated by the reference light sources on or around the blackbody locus approximately on a straight line in the intermediate color space, so that the transformation parameters ω1, ω2, ω3 can be obtained based on this goal.

[0093] Then, a second transformation is performed on each of the first reference images after the first transformation, so that the white point under the illumination of different reference light sources is rotated by a specific angle θ around a reference color value in the intermediate color space to obtain the target color space, and the X-axis in the target color space represents the change of color temperature, and the Y-axis represents the change of chromaticity, that is, the change of color rendering index, and θ is the angle between the above straight line and the X-axis. Optionally, the second transformation in this embodiment can be performed by the formula (1) described above.

[0094] Optionally, in this embodiment, the transformation parameters ω1, ω2, ω3 and θ can be obtained by solving the optimal solution of equation (4) described above. varY represents the variance of the reference white points in the Y direction in each of the first reference images. The smaller the variance, the more similar the white points under different reference light sources are to being on a straight line.

[0095] After color transformation is performed using the transformation parameters obtained in the above manner, the white points under the illumination of all reference light sources enclose an approximately rectangular area in the target color space, and the distinction between white points and non-white points is relatively large. Therefore, a rectangle can be used to enclose the white point interval of each reference light source in the target color space, thereby obtaining the white point area corresponding to each reference light source. Furthermore, since the rectangular area enclosed by the white points under the illumination of all reference light sources will contain some non-white points, the rectangular area can be further subdivided into multiple quadrilateral areas to eliminate the influence of non-white points.

[0096] By calibrating the target light source in the above manner, the white point area corresponding to the target light source can be obtained. Based on this, for any target image, after the target image is transformed into the target color space, the point located in the white point area corresponding to the target light source is the white point in the target image. For example, when the target image is shot under the illumination of an HZ light source, the target image is transformed into the target color space, and all pixel points in the white point area corresponding to the HZ light source are obtained as the white point in the target image.

[0097] According to another aspect of the present disclosure, another white spot detection method is provided. Figure 6 is a flow chart showing a white point detection method according to an embodiment of the present disclosure. Figure 6 As shown, the method includes the following steps S61 to S66.

[0098] In step S61, a target image is acquired, where the target image corresponds to a target light source.

[0099] In step S62, a first color transformation is performed on the target image to transform the target image into a target color space to generate a target color space image, wherein the target color space image is represented by a first color value and a second color value, wherein the first color value is used to represent the color temperature, and the second color value is used to represent the color rendering index.

[0100] In step S63, a pixel point located in a first white point area in the target color space image is determined as a first candidate white point, wherein the first white point area can be obtained by marking.

[0101] In step S64, a second color transformation is performed on the target image to transform the target image into a UV color space, thereby generating a UV color space image.

[0102] In step S65, a pixel point located in a second white point area in the UV color space image is determined as a second candidate white point, wherein the second white point area can be obtained by marking.

[0103] In step S66, a white point in the target image is determined according to the first candidate white point and the second candidate white point. Preferably, in this embodiment, the intersection of the first candidate white point and the second candidate white point can be selected as the white point in the target image.

[0104] The process of obtaining the first candidate white point shown in steps S61 to S63 is similar to Figure 1 The steps S11 to S13 are similar and will not be described in detail here. In addition, the process of obtaining the second candidate white point shown in the above steps S64 to S65 can be implemented using existing technology and will not be described in detail here. According to the above description, in this embodiment, the intersection of the first candidate white point and the second candidate white point can be selected as the white point in the target image, thereby excluding non-white points falling in the middle area, which is conducive to further improving the accuracy of white point detection.

[0105] According to another aspect of the present disclosure, there is also provided an automatic white balance method, the automatic white balance method comprising: using Figure 1 , Figure 5 or Figure 6 The white point detection method shown obtains a white point in a target image; and determines a white balance gain corresponding to the target light source according to a color value of the white point in the target image.

[0106] Optionally, the method for obtaining the white balance gain may be: WBGain G =1, WBGain R 、WBGain G and WBGain B are the gains of the R channel, G channel and B channel respectively, and SumR, SumG and SumB are the weighted sums of the R channel, G channel and B channel of the white points in the target image respectively. When obtaining the white balance gain, the same weight value can be assigned to the white points under different light sources, or different weight values ​​can be assigned to the white points under different light sources. In this case, SumR = ∑R i ×W i , SumG=∑G i ×W i , SumB=∑B i ×W, where R i , G i and B i are the accumulated values ​​of white points under light source i, W i is the weight value corresponding to light source i.

[0107] According to another aspect of the present disclosure, a transformation parameter calibration method is also provided. The transformation parameter calibration method comprises: determining the transformation parameters by a white point detection method; and determining the transformation parameters as calibration parameters corresponding to the color space of the device.

[0108] The white point detection method includes: acquiring a target image, the target image corresponding to a target light source; determining a transformation parameter, the transformation parameter being associated with a device for acquiring the target image; performing a color transformation on the target image to transform the target image into a target color space to generate a target color space image, the target color space image being represented by a first color value and a second color value, the first color value being used to represent a color temperature, the second color value being used to represent a color rendering index; and determining a pixel point in the target color space image located in a white point area as a white point in the target image. The color transformation on the target image includes: performing the color transformation according to the transformation parameter.

[0109] Optionally, determining the transformation parameters includes: obtaining images of a standard color card captured by the device under the illumination of multiple reference light sources as multiple first reference images; performing the color transformation according to a set of predetermined parameters to transform the multiple first reference images into multiple target color space reference images; determining, for the set of predetermined parameters, a discrete degree of the second color values ​​of pixel points in the multiple target color space reference images corresponding to reference white points in the multiple first reference images; and determining the transformation parameters according to the target predetermined parameters in the set of predetermined parameters corresponding to the discrete degree.

[0110] Optionally, determining the degree of discreteness of the second color value of a pixel point in a plurality of the target color space reference images corresponding to a reference white point in a plurality of the first reference images includes: determining a degree of deviation of the second color value relative to a reference line in the target color space.

[0111] Optionally, determining the transformation parameter according to a target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters includes: determining whether the discrete degree is less than a predetermined value; and if the discrete degree is less than the predetermined value, determining the transformation parameter according to the target predetermined parameter corresponding to the discrete degree.

[0112] According to another aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored, and the computer program is executed by a processor to implement the above-mentioned white point detection method, automatic white balance method or transformation parameter calibration method.

[0113] According to another aspect of the present disclosure, an electronic device is also provided. Figure 7 is a block diagram showing an electronic device 700 according to an embodiment of the present disclosure. Figure 7 As shown, the electronic device 700 includes a memory 710 and a processor 720. The memory 710 is configured to store a computer program, and the processor 720 is communicatively connected to the memory 710 and is configured to call the computer program to execute the white point detection method or automatic white balance method described in the present invention. In some embodiments, the processor 720 can be a SoC, a GPU, a DSP, or a specific white point detection and white balance processing chip. In this embodiment, the electronic device 700 includes but is not limited to mobile phones, tablet computers and other devices with camera functions.

[0114] The protection scope of the white point detection method and the automatic white balance method described in the present invention is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.

[0115] Compared with the prior art, the present invention proposes a different white point detection method, which transforms the target image into the target color space and obtains the pixel points located in the white point area in the target image after the color transformation as the white point in the target image. In this way, the white point detection result is more accurate, which is conducive to improving the accuracy of color temperature estimation. In addition, the color in the target color space is represented by a first color value and a second color value, and the first color value and the second color value are both independent of brightness. Therefore, the white point detection method can offset the influence of brightness changes on white point distribution, which is conducive to further improving the accuracy of white point detection.

[0116] In summary, the present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value. The above embodiments are only illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology can modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.

Claims

1. A white spot detection method, characterized in that: The white spot detection method comprises: Acquire a target image, wherein the target image corresponds to a target light source; Performing color transformation on the target image to transform the target image into a target color space to generate a target color space image, wherein the target color space image is represented by a first color value and a second color value, wherein the first color value is used to represent color temperature, and the second color value is used to represent a color rendering index, wherein both the first color value and the second color value are independent of brightness, and a coordinate axis corresponding to the first color value in a coordinate system of the target color space represents color temperature, and a coordinate axis corresponding to the second color value represents a color rendering index; and Pixel points located in a white point area in the target color space image are determined as white points in the target image.

2. The white spot detection method according to claim 1, characterized in that: The white spot detection method further includes: determining a transformation parameter, the transformation parameter being associated with a device for acquiring the target image; The color transformation of the target image includes: performing the color transformation according to the transformation parameters.

3. The white spot detection method according to claim 2, characterized in that: Determining the transformation parameters includes: Acquire images of a standard color card captured by the device under illumination of multiple reference light sources as multiple first reference images; Performing the color transformation according to a set of predetermined parameters to transform the plurality of the first reference images into a plurality of target color space reference images; Determining, for the set of predetermined parameters, the discreteness of the second color values ​​of the pixel points in the plurality of the target color space reference images corresponding to the reference white points in the plurality of the first reference images; and The transformation parameter is determined according to a target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters.

4. The white spot detection method according to claim 3, characterized in that: Determining the discreteness of the second color values ​​of the pixel points in the plurality of target color space reference images corresponding to the reference white points in the plurality of first reference images comprises: Determine the degree of deviation of the second color value from a reference line in the target color space.

5. The white spot detection method according to claim 3, characterized in that: Determining the transformation parameter according to the target predetermined parameter corresponding to the discrete degree in the set of predetermined parameters comprises: determining whether the dispersion degree is less than a predetermined value; and If the discrete degree is smaller than the predetermined value, the transformation parameter is determined according to the target predetermined parameter corresponding to the discrete degree.

6. The white spot detection method according to claim 1 or 2, characterized in that: Performing color conversion on the target image includes: Performing a first transformation on the target image to transform the target image into an intermediate color space to generate an intermediate color space image, wherein the intermediate color space image is independent of the brightness of the target image; and A second transformation is performed on the intermediate color space image to generate the target color space image, so that the target color space is rotated by a set angle relative to the intermediate color space.

7. The white spot detection method according to claim 6, characterized in that: The target color space includes a first axis and a second axis intersecting the first axis, the first axis represents the color temperature, and the second axis represents the color rendering index.

8. The white spot detection method according to claim 6, characterized in that: Performing a first transformation on the target image includes performing the first transformation by the following equations 1 and 2: Performing a second transformation on the intermediate color space image includes performing the second transformation by the following equation 3: Wherein ω1, ω2, ω3 and θ are transformation parameters, x and y represent the color values ​​of the pixels of the intermediate color space image in the intermediate color space, X and Y represent the color values ​​of the pixels of the target color space image in the target color space, R, G and B represent the color values ​​of the R channel, G channel and B channel of the pixels of the target image, x0 and y0 represent the color value of the white point in the intermediate color space under the illumination of a specific light source, and x0 and y0 represent the origin of the rotation, and θ represents the set angle.

9. The white spot detection method according to claim 1, characterized in that: The white spot detection method further comprises: determining the white spot area, Wherein determining the white spot area comprises: Acquire an image of the standard color card photographed under the illumination of the target light source as a second reference image; performing the color transformation on the reference white point in the second reference image to transform the reference white point into the target color space to generate a target color space reference white point; and The white point area is determined according to the distribution of the reference white point in the target color space.

10. The white spot detection method according to claim 9, characterized in that: Determining the white point region according to the distribution of the reference white points in the target color space includes: determining the white point region having a rectangular shape in the target color space.

11. A white spot detection method, characterized in that: The white spot detection method comprises: Acquire a target image, wherein the target image corresponds to a target light source; Performing a first color transformation on the target image to transform the target image into a target color space to generate a target color space image, wherein the target color space image is represented by a first color value and a second color value, wherein the first color value is used to represent the color temperature, and the second color value is used to represent the color rendering index, wherein both the first color value and the second color value are independent of brightness, and in a coordinate system of the target color space, a coordinate axis corresponding to the first color value represents the color temperature, and a coordinate axis corresponding to the second color value represents the color rendering index; Determine a pixel point located in a first white point area in the target color space image as a first candidate white point; Performing a second color transformation on the target image to transform the target image into a UV color space to generate a UV color space image; Determine a pixel point located in a second white point area in the UV color space image as a second candidate white point; and A white point in the target image is determined according to the first candidate white point and the second candidate white point.

12. An automatic white balance method, characterized in that: The automatic white balance method comprises: Acquire white dots in a target image using the white dot detection method according to any one of claims 1 to 11; and A white balance gain corresponding to the target light source is determined according to the color value of the white point in the target image.

13. A transformation parameter calibration method, characterized in that: The transformation parameter calibration method comprises: Determine the transformation parameters by using the white point detection method according to any one of claims 2 to 5; and The transformation parameters are determined as calibration parameters corresponding to a color space of the device.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the white point detection method according to any one of claims 1 to 11, the automatic white balance method according to claim 12, or the transformation parameter calibration method according to claim 13.

15. An electronic device, characterized in that: The electronic device comprises: a memory configured to store a computer program; and A processor is communicatively connected to the memory and is configured to call the computer program to execute the white point detection method according to any one of claims 1 to 11, the automatic white balance method according to claim 12, or the transformation parameter calibration method according to claim 13.

Citation Information

Patent Citations

  • White balance adjustment method and apparatus, image processing terminal and storage medium

    CN107135384A