CN117616774A - Image processing method, device and storage medium - Google Patents
Image processing method, device and storage medium Download PDFInfo
- Publication number
- CN117616774A CN117616774A CN202280004379.6A CN202280004379A CN117616774A CN 117616774 A CN117616774 A CN 117616774A CN 202280004379 A CN202280004379 A CN 202280004379A CN 117616774 A CN117616774 A CN 117616774A
- Authority
- CN
- China
- Prior art keywords
- color temperature
- value
- white balance
- determining
- balance gain
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 238000000034 method Methods 0.000 claims abstract description 64
- 238000012545 processing Methods 0.000 claims abstract description 36
- 238000010586 diagram Methods 0.000 abstract description 20
- 230000000694 effects Effects 0.000 abstract description 9
- 238000004891 communication Methods 0.000 description 10
- 238000005516 engineering process Methods 0.000 description 6
- 238000012937 correction Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Color Television Image Signal Generators (AREA)
- Processing Of Color Television Signals (AREA)
Abstract
The disclosure relates to an image processing method, an image processing device and a storage medium. The image processing method is applied to an image acquisition device and comprises the following steps: acquiring an initial image acquired by an image acquisition device; determining a corresponding gray scale map and a dark channel map according to the initial image; determining a white point area in the initial image according to the gray level diagram and the dark channel diagram; and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area. The method can more accurately find out the white point area, accurately obtain the target white balance gain value for white balance adjustment, and enable the display effect of the image after white balance adjustment to be better.
Description
The disclosure relates to the technical field of image processing, and in particular relates to an image processing method, an image processing device and a storage medium.
On the one hand, with the continuous popularization of high-pixel mobile phones, single-lens, micro-lens and other image acquisition equipment, the requirements on the acquired images are higher and higher, and it is important that the colors of the images are kept true and not distorted. On the other hand, with the continuous development of technologies such as unmanned, artificial intelligence and the like, a visual system is more and more important, and the color cast phenomenon of an image has great influence on the visual system, so that higher requirements are put forward on the color cast optimization correction capability of image acquisition equipment such as a recorder, a monitor, a camera and the like. In the related art, an image color cast correction is required to be made, a better automatic white balance effect is realized, the image color is kept true without distortion, and an image acquisition system is required to be capable of accurately removing the influence of the color temperature of a light source on the image color under various light source conditions so as to achieve the good automatic white balance effect.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides an image processing method, apparatus, and storage medium.
According to a first aspect of embodiments of the present disclosure, there is provided a method of processing an image, applied to an image acquisition apparatus, the method including:
acquiring an initial image acquired by the image acquisition device;
determining a corresponding gray scale map and a dark channel map according to the initial image;
determining a white point area in the initial image according to the gray scale image and the dark channel image;
and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
In an exemplary embodiment, the determining the target color temperature value and the target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region includes:
determining a white balance gain value of each pixel point in the white point region;
according to the white balance gain value of each pixel point, determining the white balance gain value of the white point area;
And determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
In an exemplary embodiment, the determining the white balance gain value of the white point area according to the white balance gain value of each pixel point includes:
determining a first color Wen Quanchong associated with an exposure index and a second color temperature weight associated with a color histogram corresponding to each pixel in the white point region;
and determining a white balance gain value of the white point area according to the pixel value of each pixel point and the first color Wen Quanchong and the second color temperature weight.
In an exemplary embodiment, determining a first color Wen Quanchong associated with an exposure index for each pixel in the white point region includes:
dividing the initial image into a plurality of exposure intervals according to the exposure index;
dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
and determining the first color Wen Quanchong of each pixel point in the white point region according to the color temperature interval of each pixel point in the white point region.
In an exemplary embodiment, the determining the first color Wen Quanchong according to the color temperature interval in which each pixel point in the white point area is located includes:
determining the number of all pixel points in the white point area and the color temperature interval in which each pixel point is positioned;
for each color temperature interval, determining the proportion of the number of pixel points in the color temperature interval to the number of all pixel points as a first initial color temperature weight;
the first initial color temperature weight is adjusted based on ambient light information to determine the first color Wen Quanchong.
In an exemplary embodiment, determining a second color temperature weight associated with the color histogram for each pixel point in the white point region includes:
dividing the initial image into a plurality of exposure intervals according to the exposure index;
dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
determining an average white balance gain value of each color temperature interval according to the corresponding relation between the white balance gain value and the color temperature;
according to the average white balance gain value, gain is carried out on the pixel points in each color temperature interval in the white point area, and the RGB value of each color temperature interval after the gain of the white point area is obtained;
And determining the second color temperature weight of each color temperature interval according to the RGB value of each color temperature interval after gain.
In an exemplary embodiment, the determining the second color temperature weight of each color temperature interval according to the RGB value of each color temperature interval after the gain includes:
according to the RGB value of each color temperature interval after gain, three channel histograms of an R channel, a G channel and a B channel of each color temperature interval are determined;
determining the superposition areas of three channels in the three-channel histograms of the R channel, the G channel and the B channel of each color temperature interval;
and determining the second color temperature weight of each color temperature interval according to the superposition area in each color temperature interval.
In an exemplary embodiment, the size of the color temperature interval at the middle position is smaller than the size of the color temperature interval at the both end positions according to the size of the color temperature value.
In an exemplary embodiment, determining the target color temperature value and the target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region includes:
and selecting the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value of the white point area in the corresponding relation between the white balance gain value and the color temperature value as a target white balance gain value, and the corresponding color temperature value as a target color temperature value.
In an exemplary embodiment, the method further comprises:
and adjusting a target white balance gain value according to the relation between the color temperature value of the white point area and the target color temperature value.
In an exemplary embodiment, determining the white point region in the initial image from the gray scale map and the dark channel map includes:
determining pixel values corresponding to RGB three channels of each pixel of the initial image;
determining a dark channel value corresponding to each pixel in a dark channel map according to the pixel values corresponding to the RGB three channels;
determining a gray value corresponding to each pixel of the initial image;
and determining the white point area according to the dark channel value and the gray value.
In an exemplary embodiment, determining the white point region from the dark channel value and the gray scale value includes:
determining a first area in the initial image with a dark channel value greater than a first preset threshold;
determining a second region in the initial image, wherein the gray value is larger than a second preset threshold value and smaller than a third preset threshold value;
an intersection between the first region and the second region is determined as a white point region in the initial image.
In an exemplary embodiment, the method further comprises:
acquiring a plurality of reference images of a gray target object with a preset gray value under different given color temperature values;
for each reference image, taking the average value of the pixel values of all pixel points as the pixel value of each reference image;
according to the pixel value of the reference image, determining a white balance gain value corresponding to the reference image;
and determining the corresponding relation between the white balance gain value and the color temperature value according to the white balance gain value and the given color temperature value.
According to a second aspect of embodiments of the present disclosure, there is provided an image processing apparatus applied to an image acquisition apparatus, the apparatus including:
an acquisition module configured to acquire an initial image acquired by the image acquisition device;
a first determining module configured to determine a corresponding gray scale map and dark channel map from the initial image;
a second determination module configured to determine a white point region in the initial image from the gray scale map and the dark channel map;
and a third determining module configured to determine a target color temperature value and a target white balance gain value for white balance adjustment according to a correspondence relation between the white balance gain value and the color temperature and the white balance gain value of the white point region.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects: the white point area can be found out more accurately, and the target white balance gain value for white balance adjustment can be obtained accurately, so that the display effect of the image after white balance adjustment is better.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart illustrating a method of processing an image according to an exemplary embodiment.
Fig. 2 is a schematic diagram schematically illustrating a correspondence relationship between a white balance gain value and a color temperature according to an embodiment of the present disclosure.
Fig. 3 illustrates a flow chart of a method of determining a correspondence of a provided white balance gain value and a color temperature value according to an embodiment of the present disclosure.
Fig. 4 is a flowchart showing a method of determining a target color temperature value and a target white balance gain value for white balance adjustment according to a correspondence relationship between a white balance gain value and a color temperature and a white balance gain value of a white point region in step S104 according to an exemplary embodiment.
Fig. 5 is a flowchart showing a method of determining a white balance gain value of a white point region from the white balance gain value of each pixel point in step S402, according to an exemplary embodiment.
Fig. 6 is a flowchart illustrating a method of determining a first color Wen Quanchong associated with an exposure index for each pixel in a white point region, according to an example embodiment.
Fig. 7 is a flowchart illustrating a method of determining a second color temperature weight associated with a color histogram for each pixel point in a white point region, according to an exemplary embodiment.
Fig. 8 exemplarily shows a flowchart of a method of determining the second color temperature weight of each color temperature section according to the RGB values after the gain in step S705.
Fig. 9 is an exemplary diagram of a color histogram shown in accordance with an exemplary embodiment.
Fig. 10 exemplarily shows a flowchart of a method of determining a white dot region in an initial image from a gray scale map and a dark channel map in step S103.
Fig. 11 is an exemplary diagram of a dark channel map and a gray scale map shown according to an exemplary embodiment.
Fig. 12 exemplarily shows a flowchart of a method of determining a white point region according to a dark channel value and a gray value in step S1004.
Fig. 13 is an exemplary diagram after thresholding, according to an exemplary embodiment.
Fig. 14 is a diagram showing an example of an image obtained after processing by the image processing method of the present disclosure according to an exemplary embodiment.
Fig. 15 is a block diagram of an image processing apparatus according to an exemplary embodiment.
Fig. 16 is a block diagram illustrating a processing apparatus for an image according to an exemplary embodiment.
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
In the related art, gray World (Gray World) algorithm is used for white balance adjustment, and the Gray World algorithm is based on Gray World hypothesis, which is considered as follows: for an image with a large number of color changes, the average value of the saturation of three components of Red (Red, R), green (Green, G) and Blue (Blue, B) tends to be the same gray value, i.e., the gray world algorithm assumes that the average value of the average reflection of light by a natural scene is a constant value as a whole, and the saturation of three components in the constant value is R, G, B tends to be consistent. When rich colors exist in the image, the image is processed through the gray world algorithm, so that the influence of ambient light can be eliminated better. However, this method is poor in adjustment when the image contains a large area of single color or dominant color.
In an exemplary embodiment of the present disclosure, a method for processing an image is provided, which is applied to an image acquisition apparatus. Fig. 1 is a flowchart illustrating a method of processing an image according to an exemplary embodiment:
step S101: acquiring an initial image acquired by an image acquisition device;
step S102: determining a corresponding gray scale map and a dark channel map according to the initial image;
step S103: determining a white point area in the initial image according to the gray level diagram and the dark channel diagram;
step S104: and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
In an exemplary embodiment of the present disclosure, in order to overcome the problems in the related art, a method of processing an image is provided. The method comprises the steps of obtaining an initial image obtained by an image obtaining device, converting the initial image into a corresponding gray level image and a corresponding dark channel image respectively, determining a white point area in the initial image according to the gray level image and the dark channel image, determining a white balance gain value of the white point area, determining a target color temperature value according to a preset corresponding relation between the white balance gain value and a color temperature and the white balance gain value of the white point area, determining a target white balance gain value for white balance adjustment according to a preset corresponding relation between the white balance gain value and the color temperature and the target color temperature value, performing white balance adjustment on the image by using the target white balance gain value, and obtaining an image with better color correction, namely an image with smaller phase difference from a color standard.
In step S101, the image acquisition device includes an electronic device having an image capturing function, such as a smart phone, a tablet, a digital camera, a single-lens, or a micro-lens, and further includes an electronic device having a video recording function, such as a recorder, a video camera, or a monitor, and the image acquisition device is applicable, and the present disclosure is not limited to the initial image acquisition device. The initial image may be a color image that is not processed after acquisition.
In step S102, a gray scale map and a dark channel map corresponding thereto are determined from the initial image. The method of converting the gradation map may be any method capable of converting into the gradation map, for example, an average method or a weighted average method. And taking the minimum value from the pixel values of the R channel, the G channel and the B channel of each pixel point in the initial image as the pixel value of the pixel point of the dark channel image, thereby forming the dark channel image.
In step S103, when determining the white point region, a region meeting the preset condition may be selected from the gray scale map and the dark channel map according to the preset gray scale threshold and the dark channel threshold, and the overlapping region of the selected regions may be used as the white point region. The size and number of the white dot areas are determined according to the actual condition of the image.
In step S104, the correspondence between the white balance gain value and the color temperature is stored in the image acquisition device in advance, and the correspondence between the white balance gain value and the color temperature may be represented in the R/G, B/G coordinate system. As shown in fig. 2, fig. 2 is a schematic diagram schematically illustrating a correspondence relationship between a white balance gain value and a color temperature according to an embodiment of the present disclosure, where R/G and B/G are two coordinate axes in a coordinate system. On the curves of R/G and B/G the corresponding color temperatures are identified, i.e. the color temperatures corresponding when the respective RGB values are obtained are noted, e.g. the corresponding different color temperatures are identified with different shape correspondences on the curves in fig. 2. Since the white balance gain generally employs gain Rgain for R channel and gain Bgain for B channel, where rgain=g/R, bgain =g/B, the correspondence of the white balance gain value and the color temperature can be reflected in the R/G, B/G coordinate system. After the white point area is determined, a white balance gain value of the white point area is determined, and then a corresponding target color temperature value is determined according to the corresponding relation between the white balance gain value and the color temperature, namely, the target color temperature value corresponding to the coordinate value of the white point area is determined according to the coordinate value of the white point area in the coordinate system and the color temperature values corresponding to different coordinate points in the coordinate system. After the target color temperature value is determined, the target white balance gain value for white balance adjustment can be determined according to the corresponding relation between the white balance gain value and the color temperature.
In the exemplary embodiment of the disclosure, the white point area is determined through the gray map and the dark channel map corresponding to the initial image, the white balance gain value of the white point area is determined, and the target color temperature value and the target white balance gain value for white balance adjustment are determined according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area, so that the white point area can be found out more accurately, the target white balance gain value for white balance adjustment can be obtained accurately, and the display effect of the image after the white balance adjustment is better.
In an exemplary embodiment of the present disclosure, a method of determining a correspondence between a white balance gain value and a color temperature value is also provided. As shown in fig. 3, fig. 3 is a flowchart schematically illustrating a method for determining a correspondence between a provided white balance gain value and a color temperature value according to an embodiment of the present disclosure:
step S301, acquiring a plurality of reference images of a gray target object with preset gray values under different given color temperature values;
step S302, regarding each reference image, taking the average value of the pixel values of all the pixel points as the pixel value of each reference image;
step S303, determining a white balance gain value corresponding to the reference image according to the pixel value of the reference image;
Step S304, according to the white balance gain value and the given color temperature value, determining the corresponding relation between the white balance gain value and the color temperature value.
Different given color temperature values can be provided by laboratory standard light sources, such as standard light sources D75, D65, D50, CWF, TL84, A, H, etc., the gray target object of the preset gray value can be a standard gray card, and an image acquisition device is used to acquire images of the standard gray card under different light sources with different color temperature values as a reference image. In order to ensure the accuracy of the reference image, when the image acquisition device is used for acquiring the reference image, the standard gray card area is filled with the whole field area of view of the image acquisition device, so that the acquired reference image does not comprise the area except the standard gray card.
For each reference image, the average value of the pixel values of all the pixel points is taken as the pixel value of the whole image, for example, the pixel value of the ith pixel point is recorded as (R i ,G i ,B i ) The reference image includes N pixel points, and the pixel value of the reference image is expressed asThe white balance gain value adopts the gain Rgain of R channel and the gain Bgain of B channel, wherein Rgain=G/R, bgain =G/B, the white balance gain value of each reference image can be determined according to the pixel value, and the white balance gain value of each reference image is determined by This allows determination of the abscissa and ordinate in the R/G, B/G coordinate system.
And according to the white balance gain value of the reference image and the given color temperature value corresponding to each reference image, determining the corresponding relation between the given color temperature value and the white balance gain value, and obtaining the corresponding relation between the white balance gain value and the color temperature value shown as 2 by adopting a linear interpolation mode for the non-given color temperature value. And establishing a coordinate system by taking R/G as an abscissa and B/G as an ordinate. Since the white balance gain is generally expressed by the gain Rgain of the R channel and the gain Bgain of the B channel, rgain=g/R, bgain =g/B, and the correspondence between the color temperature value and the white balance gain can be determined by the correspondence between the coordinates corresponding to R/G and B/G in fig. 2.
In an exemplary embodiment, fig. 4 is a flowchart illustrating a method for determining a target color temperature value and a target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region in step S104 according to an exemplary embodiment:
step S401: determining a white balance gain value of each pixel point in the white point area;
step S402: according to the white balance gain value of each pixel point, determining the white balance gain value of the white point area;
Step S403: and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
Since the size and the number of the white point areas are determined according to the initial image actually photographed, when determining the white balance gain value of the white point area, the white balance gain value of each pixel point in the white point area can be determined, for example, the color temperature coordinates corresponding to the white point area can be obtained according to the average value or the weighted average value of the coordinate values of all the pixels in the white point area, and the white balance gain value of the white point area can be obtained according to the color temperature coordinates. Since the white balance gain can be represented by rgain=g/R and bgain=g/B, the white balance gain value of each point can be determined by the pixel value of each pixel point. And determining the white balance gain value of the white point area according to the white balance gain values of all the pixel points in the white point area. By utilizing the corresponding relation between the white balance gain value and the coordinate value in the R/G, B/G coordinate system, the coordinate value corresponding to R/G, B/G in the coordinate system can be determined according to the white balance gain value, and further the corresponding target color temperature value for carrying out white balance adjustment on the white point area is determined. After the target color temperature value is determined, the target white balance gain value for carrying out white balance adjustment on the white point area can be determined according to the corresponding relation between the white balance gain value and the color temperature.
In an exemplary embodiment, fig. 5 is a flowchart illustrating a method of determining a white balance gain value of a white point region according to the white balance gain value of each pixel point in step S402 according to an exemplary embodiment:
step S501: determining a first color Wen Quanchong associated with the exposure index and a second color temperature weight associated with the color histogram for each pixel in the white point region;
step S502: a white balance gain value of the white point region is determined based on the pixel value of each pixel point and the first color Wen Quanchong and second color temperature weights.
For the accuracy of calculation, when the white balance gain value of the white point area is determined according to the white balance gain value of each pixel point, the white balance gain value of the white point area can be obtained by performing weighted summation on the white balance gain value of each pixel point. In consideration of the influence factors of white balance adjustment, a first color Wen Quanchong associated with the exposure index and a second color temperature weight associated with the color histogram corresponding to each pixel point in the white point region are determined, respectively. The coordinate value of each pixel point in the white point region can be determined according to the pixel value of each pixel point in the R/G, B/G coordinate system, and the corresponding relation between the white balance gain value and the color temperature is reflected by the R/G, B/G coordinate system, so that the determined coordinate value of each pixel point can reflect the color temperature value of each pixel point, and then the coordinate value of each pixel point is weighted and averaged according to the first color Wen Quanchong and the second color temperature weight to obtain the weighted average coordinate value of the white point region, namely the color temperature coordinate of the white point region, and further the white balance gain value of the white point region is obtained.
The sitting sign of each pixel is (X i ,Y i ) The color temperature of the white point region is represented by calculating a weighted average of coordinate values of each pixel point to obtain a weighted average coordinate value, and the weighted average coordinate (X, Y) is represented as:
wherein X is the abscissa of the weighted average coordinate value of the white point region, Y is the ordinate of the weighted average coordinate value of the white point region, and X i Is the abscissa corresponding to the ith pixel point, Y i Is the ordinate corresponding to the ith pixel point, W i1 First color Wen Quanchong, W corresponding to the ith pixel point i2 And (3) for the second color temperature weight corresponding to the ith pixel point, m is the total number of pixel points in the white point area.
In an exemplary embodiment of the present disclosure, in combination with the influence factor of white balance adjustment, a first color Wen Quanchong related to an exposure index and a second color temperature weight related to a color histogram corresponding to each pixel point in a white point area are determined, and then, based on the first color Wen Quanchong and the second color temperature weight, the pixel value of each pixel point in the white point area is weighted and summed, so that the calculated white balance gain value of the white point area is more accurate.
In an exemplary embodiment, a method of determining a first color Wen Quanchong is presented. As shown in fig. 6, fig. 6 is a flowchart illustrating a method of determining a first color Wen Quanchong associated with an exposure index for each pixel point in a white point region, according to an exemplary embodiment:
Step S601, dividing the exposure index into a plurality of exposure intervals;
step S602, dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
in step S603, the first color Wen Quanchong of each pixel in the white point area is determined according to the color temperature interval in which the each pixel in the white point area is located.
The exposure index of the image acquisition device is divided into a plurality of exposure sections, and the division of the exposure sections can be set according to actual requirements, for example, when the exposure index range is [0,999], the division is divided into 10 exposure sections. And dividing each exposure interval into a plurality of color temperature intervals according to the color temperature value of each exposure interval, for example, dividing the color temperature [1,10000] in each exposure interval into 15 color temperature intervals. The division of the color temperature interval can be set according to actual demands, the color temperature can be equally divided according to the size of the color temperature value to obtain the color temperature interval with the same size, and the size of the color temperature interval at the middle position can be smaller than the size of the color temperature interval at the two end positions. The first color Wen Quanchong of each color temperature interval in the white point region is determined from the color temperature interval in which each pixel point in the white point region is located.
In the exemplary embodiment of the disclosure, the first color Wen Quanchong is determined according to the exposure index, so that the influence degree of the exposure index on the white balance adjustment can be reduced, and the accuracy of the target white balance gain value can be improved.
In an exemplary embodiment, determining the first color Wen Quanchong from the color temperature interval in which each pixel point in the white point region is located includes:
determining the number of all pixel points in a white point area and a color temperature interval in which each pixel point is positioned;
for each color temperature interval, determining the proportion of the number of pixel points in the color temperature interval to the number of all pixel points as a first initial color temperature weight;
the first initial color temperature weight is adjusted based on the ambient light information to determine a first color Wen Quanchong.
Determining the number of all the pixels in the white point area and the color temperature interval in which each pixel is located, and taking the proportion of the number of the pixels belonging to a certain color temperature interval to the number of all the pixels in the white point area as a first initial color temperature weight of the color temperature interval. For example, if the white point region includes 4000 pixels and the number of pixels belonging to the color temperature interval 1 is 500, the first initial color temperature weight of the color temperature interval 1 is 500/4000=1/8. And then, according to the ambient light information when the initial image is acquired, the first initial color temperature weight is adjusted, the adjustment rule can be set according to the actual requirement, and the adjusted color temperature weight is used as the first color Wen Quanchong. The ambient light information may include the color temperature of the ambient light, for example, the color temperature range of the color temperature section 1 is 200-1000, and at this time, the color temperature of the ambient light is 8000, and the weight for the color temperature section 1 may be appropriately reduced.
In an exemplary embodiment of the disclosure, a first initial color temperature weight is determined according to the exposure index, and then the first initial color temperature weight is adjusted according to the ambient light information to determine a first color Wen Quanchong, so that the accuracy of calculation is further improved.
In an exemplary embodiment, a method of determining a second color temperature weight is presented. As shown in fig. 7, fig. 7 is a flowchart illustrating a method of determining a second color temperature weight associated with a color histogram for each pixel point in a white point region according to an exemplary embodiment:
step S701, dividing an initial image into a plurality of exposure intervals according to an exposure index;
step S702, dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
step S703, determining an average white balance gain value of each color temperature interval according to the corresponding relation between the white balance gain value and the color temperature;
step S704, gain is carried out on pixel points in each color temperature interval in the initial image according to the average white balance gain value, and RGB values after the initial image gain are obtained;
step S705, determining the second color temperature weight of each color temperature interval according to the RGB value after gain.
The exposure index of the image acquisition device is divided into a plurality of exposure sections, and the division of the exposure sections can be set according to actual requirements, for example, when the exposure index range is [0,999], the division is divided into 10 exposure sections. And dividing each exposure interval into a plurality of color temperature intervals according to the color temperature value of each exposure interval, for example, dividing the color temperature [1,10000] in each exposure interval into 15 color temperature intervals, wherein the division of the color temperature intervals can be divided according to the color temperature distribution of each pixel point in the initial image. The division of the color temperature interval can be set according to actual demands, the color temperature can be equally divided according to the size of the color temperature value to obtain the color temperature interval with the same size, and the size of the color temperature interval at the middle position can be smaller than the size of the color temperature interval at the two end positions.
After the color temperature intervals are divided, determining the white balance gain values corresponding to all the color temperature values in each color temperature interval according to the corresponding relation between the white balance gain values and the color temperature, and determining the average white balance gain value in the color temperature interval according to all the white balance gain values, so as to calculate the average white balance gain value of all the color temperature intervals. And determining the color temperature value of each pixel point according to the pixel value of each pixel point in the white point area, respectively counting the color temperature interval to which each pixel point belongs, and performing gain on the pixel points belonging to a certain color temperature interval by using the average white balance gain value of the color temperature interval to obtain the RGB value after the gain of the white point area. And determining a second color temperature weight of each color temperature interval according to the pixel value after the gain.
In an example, the color temperature values of all the pixels in the white point region respectively belong to three color temperature intervals, and the average white balance gain values of the three color temperature intervals are respectively denoted as a1, a2 and a3, so that the pixel belonging to the first color temperature interval in the white point region is gained by using the white balance gain value a1, the pixel belonging to the second color temperature interval is gained by using the white balance gain value a2, and the pixel belonging to the third color temperature interval is gained by using the white balance gain value a 3. And determining a second color temperature weight of the color temperature interval in which each pixel point in the white point area is positioned according to the pixel value after the gain.
In an exemplary embodiment of the disclosure, after the image is gained according to the gain value related to the initial image, the second color temperature weight is determined according to the pixel value after the gain, which is equivalent to adjusting by using the second color temperature weight based on the initial gain value, so that the accuracy of the target gain value can be further improved.
In an exemplary embodiment, as shown in fig. 8, fig. 8 schematically shows a flowchart of a method for determining the second color temperature weight of each color temperature interval according to the RGB values after the gain in step S705:
step S801, three channel histograms of an R channel, a G channel and a B channel of each color temperature interval are determined according to the RGB value of each color temperature interval after gain;
step S802, determining the superposition areas of three channels in the three-channel histograms of the R channel, the G channel and the B channel of each color temperature interval;
step S803, determining a second color temperature weight of each color temperature interval according to the overlapping area in each color temperature interval.
And counting pixel points in the white point area included in each color temperature interval for the white point area, and performing gains for the white balance gains of different color temperature intervals for each pixel point. And determining a three-channel histogram of pixel values of all pixel points of the white point region in the color temperature interval according to the RGB values after the gain.
In one example, the k-th color temperature interval includes y pixel points of the white point region, and the average white balance gain value of the k-th color temperature interval is a k For y pixels, a is used respectively k And after gain is carried out, obtaining an R value, a G value and a B value after gain, drawing a three-channel histogram according to the R value, the G value and the B value after gain of y pixel points, wherein the abscissa of the histogram is the pixel value of the channel, and the ordinate is the occurrence frequency of each pixel value. For example, for an R channel, when there are only 3 pixels, the R values of the three pixels are 50, and 80, respectively, the abscissa of the histogram is 50 and 80, the ordinate is 1 and 2, the 50 corresponds to 2, and the 80 corresponds to 1.
Fig. 9 is an exemplary diagram of a color histogram shown according to an exemplary embodiment, as shown in fig. 9, a second color temperature weight is determined according to the overlapping area of three channel histograms in each color temperature interval in which a pixel point of a white point region is located, using the following formula:
wherein W is 2 Represents the second color temperature weight, S k The overlapping area of the three channel histograms in the kth color temperature interval is represented, and n represents the number of color temperature intervals.
In the exemplary embodiment of the disclosure, the color histogram generally reflects the distribution condition of the pixel values, and the accuracy of calculating the gain value can be improved by determining the second color temperature weight according to the histogram.
In an exemplary embodiment, a method of determining a target color temperature value and a target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region in step S104 is exemplarily shown:
and selecting the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value of the white point area as a target white balance gain value and the corresponding color temperature value as a target color temperature value in the corresponding relation between the white balance gain value and the color temperature value.
In the correspondence relationship between the white balance gain value and the color temperature value shown in fig. 2, the X-axis coordinate value and the Y-axis coordinate value are reciprocal relationships to the corresponding white balance gain. I.e., the X-axis coordinate value is denoted as R/G and the Y-axis coordinate value is denoted as B/G. While the white balance gain may be represented by rgain=g/R and bgain=g/B. After the weighted average coordinate values X and Y of the white point region are determined, the white balance gain value of the white point region can be determined.
The weighted average coordinate values X and Y of the white point region do not necessarily fall on the curve of the correspondence relationship of the white balance gain value and the color temperature value. When the weighted average coordinate values X and Y of the white point region do not fall on the curve of the correspondence relationship between the white balance gain value and the color temperature value, the color temperature value and the white balance gain value corresponding on the curve need to be found to determine the target color temperature value and the target white balance gain value for performing white balance adjustment on the white point region. Therefore, it is necessary to select coordinates on a curve of the correspondence between the white balance gain value and the color temperature value by the weighted average coordinate values X and Y of the white point region, for example, after determining points corresponding to the coordinates of the weighted average coordinate values X and Y of the white point region, find a coordinate point having the smallest distance from the coordinate point on the curve of the correspondence between the white balance gain value and the color temperature value, and use the white balance gain value corresponding to the coordinate point as the target white balance gain value.
As shown in fig. 2, the coordinate points corresponding to the weighted average coordinate values X and Y of the white point region are Z, the coordinate points corresponding to the two nearest given color temperature values adjacent to the weighted average coordinate values of the white point region are a first coordinate point Z1 and a second coordinate point Z2, the first coordinate point Z1 and the second coordinate point Z2 are connected, the coordinate points Z corresponding to the weighted average coordinate values X and Y of the white point region are perpendicular to the connection line between the first coordinate point Z1 and the second coordinate point Z2, and the intersection point Z0 on the curve of the correspondence relationship between the perpendicular and the white balance gain value and the color temperature value is formed. If the line segment Z0Z1 is smaller than the line segment Z0Z2, the color temperature value corresponding to the Z1 coordinate is a target color temperature value, and the corresponding white balance gain is a target white balance gain; otherwise, the color temperature value corresponding to the Z2 coordinate is the target color temperature value, and the corresponding white balance gain is the target white balance gain.
In an exemplary embodiment, the image processing method further includes:
and adjusting the target white balance gain value according to the relation between the color temperature value of the white point area and the target color temperature value.
On the curve of the correspondence relationship between the white balance gain value and the color temperature value shown in fig. 2, when the coordinate point Z corresponding to the weighted average coordinate values X and Y of the white point region is above the coordinate point corresponding to the target color temperature value, the weighted average coordinate value X or the ordinate Y of the white point region is larger than the abscissa or the ordinate of the target color temperature value, and since the abscissa and the ordinate in the coordinate system are reciprocal relationships with the gain value, the white balance gain value corresponding to the color temperature value of the white point region is smaller than the white balance gain value corresponding to the target color temperature value, and therefore, the white balance gain value corresponding to the target color temperature value needs to be appropriately reduced, that is, the target white balance gain value needs to be appropriately reduced, and the degree of reduction can be determined according to the distance between the color temperature value of the white point region and the target color temperature value, and the larger the closer the reduction value is.
On the curve of the correspondence between the white balance gain value and the color temperature value shown in fig. 2, when the coordinate point Z corresponding to the weighted average coordinate values X and Y of the white point region is below the coordinate point corresponding to the target color temperature value, the weighted average coordinate value X or the ordinate Y of the white point region is smaller than the abscissa or the ordinate of the target color temperature value, and since the abscissa and the ordinate in the coordinate system are reciprocal to the gain value, the gain value corresponding to the color temperature value of the white point region is larger than the white balance gain value corresponding to the target color temperature value, and therefore, the white balance gain value corresponding to the target color temperature value needs to be increased appropriately, that is, the target white balance gain value can be increased appropriately, the degree of increase can be determined according to the distance between the color temperature value of the white point region and the target color temperature value, and the larger the closer the larger the distance is, and the smaller the increase value is.
In the exemplary embodiment of the disclosure, on the basis of the target white balance gain value, the target white balance gain value is finely adjusted according to the relation between the coordinate point of the target color temperature value and the coordinate point which is actually obtained, so that the accuracy can be further improved.
In an exemplary embodiment, as shown in fig. 10, fig. 10 exemplarily shows a flowchart of a method of determining a white point region in an initial image according to a gray scale map and a dark channel map in step S103:
Step S1001, determining pixel values corresponding to three RGB channels of each pixel of the initial image;
step S1002, determining a dark channel value corresponding to each pixel in a dark channel map according to pixel values corresponding to the RGB three channels;
step S1003, determining a gray value corresponding to each pixel of the initial image;
step S1004, determining a white point area according to the dark channel value and the gray value.
In an exemplary embodiment of the present disclosure, the sitting for each pixel in the initial image is labeled (i, j), RGB three for each pixelThe pixel values corresponding to the channels are respectively marked as I R (i,j)、I G (I, j) and I B (I, j) taking the minimum value of the pixel values corresponding to the three channels as a dark channel value, and obtaining the dark channel value as I d =min(I R (i,j),I G (i,j),I B (i, j)). The gray value corresponding to each pixel of the initial image can be calculated by any gray map conversion algorithm, for example, an average value method is used, and the gray value of each pixel is I g =(I R (i,j)+I G (i,j)+I B (i, j))/3. Fig. 11 is an exemplary diagram of a dark channel map and a gray scale map shown according to an exemplary embodiment, as shown in fig. 11, the left side is the dark channel map, and the right side is the gray scale map. And determining a white point area of the initial image according to the dark channel value and the gray value of each pixel.
In the exemplary embodiment of the disclosure, the white point area is determined through the gray level diagram and the dark channel diagram, so that the accuracy of identifying the white point area can be improved.
In an exemplary embodiment, as shown in fig. 12, fig. 12 exemplarily shows a flowchart of a method for determining a white point region according to a dark channel value and a gray value in step S1004:
step S1201, determining a first region in the initial image where the dark channel value is greater than a first preset threshold;
step S1202, determining a second region in the initial image with the gray value larger than a second preset threshold value and smaller than a third preset threshold value;
step S1203 determines an intersection between the first region and the second region as a white dot region in the initial image.
In an exemplary embodiment of the present disclosure, in order to obtain an appropriate white point region, a first region in an initial image having a dark channel value greater than a first preset threshold value and a second region in the initial image having a gray value greater than a second preset threshold value and less than a third preset threshold value may be selected, and an intersection between the first region and the second region is taken as the white point region in the initial image.
When the image acquisition device performs image shooting, the features of the initial image are different due to different shooting environments, and the first preset threshold value is also different. The first preset threshold may be determined according to an adaptive threshold determination method, e.g., calculated using a maximum inter-class variance method, and fig. 13 is an exemplary diagram after threshold segmentation, according to an exemplary embodiment.
In order to remove the excessively dark region and the excessively bright region in the initial image, a second preset threshold value and a third preset threshold value may be set. The gray value smaller than the second preset threshold value is an excessively dark area in the initial image, the area with the gray value larger than the third preset threshold value is an excessively bright area in the initial image, the area of the initial image corresponding to the gray value between the second preset threshold value and the third preset threshold value is used as a second area, and the second area is an area which does not comprise the excessively dark area and the excessively bright area in the initial image. The second preset threshold and the third preset threshold are experience values and can be set according to actual requirements. Alternatively, the second preset threshold may be 5, and the third preset threshold may be 230. In the exemplary embodiment of the disclosure, the intersection between the first area and the second area is determined as the white point area in the initial image, so that the pixel value condition in the initial image can be fully considered, and the obtained white point area is more accurate.
Compared with the prior art, the image processing method provided by the exemplary embodiment of the disclosure has the advantages that the color standard is further improved, the color difference obtained by the processed image and the standard image is smaller, the white balance effect is better, and the subjective evaluation of human eyes is better than that of the prior art.
In an example, in the case of turning off the white balance of the camera, outdoor 500 pictures and indoor 500 pictures were taken as experimental data, and color correction was performed thereon using the image processing method provided in the present disclosure, respectively, to obtain processed images. And obtaining a standard image conforming to human eye sense organs in a manual white balance mode. Calculating the color difference between the image processed by the method in the disclosure and the standard image through a color difference formula CIE 2000, and the color difference between the image processed by the white balance algorithm in the prior art and the standard image, wherein the white balance algorithm in the prior art uses a gray world algorithm (GW algorithm), a WPR (White Patch Retinex) algorithm and a dark channel prior algorithm to obtain data shown in a table 1:
TABLE 1
GW algorithm | WPR algorithm | Dark channel prior algorithm | Methods in the present disclosure | |
Indoor 500 pictures | 21.13 | 23.02 | 16.44 | 9.31 |
Outdoor 500 pictures | 12.32 | 16.23 | 9.38 | 5.29 |
From the data in table 1, it can be seen that the image obtained by the image processing method in the present disclosure has the smallest color difference from the standard image. Fig. 14 is a diagram showing an example of an image obtained after processing by the image processing method according to an exemplary embodiment, and as shown in fig. 14, columns a and c are initial images obtained, and columns b and d are processed images, it can be seen that the white balance effect of the processed image is better.
In an exemplary embodiment of the present disclosure, an image processing apparatus is provided and applied to an image acquisition apparatus, and fig. 15 is a block diagram of an image processing apparatus according to an exemplary embodiment:
an acquisition module 1501 configured to acquire an initial image acquired by the image acquisition device;
a first determining module 1502 configured to determine a corresponding gray scale map and dark channel map from the initial image;
a second determining module 1503 configured to determine a white point region in the initial image from the gray scale map and the dark channel map;
a third determining module 1504 is configured to determine a target color temperature value and a target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region.
According to the embodiment of the disclosure, the white point area can be found out more accurately, and the target white balance gain value for white balance adjustment can be obtained accurately, so that the display effect of the image after white balance adjustment is better.
In an exemplary embodiment, the third determining module 1504 is further configured to:
determining a white balance gain value of each pixel point in the white point region;
According to the white balance gain value of each pixel point, determining the white balance gain value of the white point area;
and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
In an exemplary embodiment, the third determining module 1504 is further configured to:
determining a first color Wen Quanchong associated with an exposure index and a second color temperature weight associated with a color histogram corresponding to each pixel in the white point region;
and determining a white balance gain value of the white point area according to the pixel value of each pixel point and the first color Wen Quanchong and the second color temperature weight.
In an exemplary embodiment, the third determining module 1504 is further configured to:
dividing the initial image into a plurality of exposure intervals according to the exposure index;
dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
and determining the first color Wen Quanchong of each pixel point in the white point region according to the color temperature interval of each pixel point in the white point region.
In an exemplary embodiment, the third determining module 1504 is further configured to:
Determining the number of all pixel points in the white point area and the color temperature interval in which each pixel point is positioned;
for each color temperature interval, determining the proportion of the number of pixel points in the color temperature interval to the number of all pixel points as a first initial color temperature weight;
the first initial color temperature weight is adjusted based on ambient light information to determine the first color Wen Quanchong.
In an exemplary embodiment, the third determining module 1504 is further configured to:
dividing the initial image into a plurality of exposure intervals according to the exposure index;
dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;
determining an average white balance gain value of each color temperature interval according to the corresponding relation between the white balance gain value and the color temperature;
according to the average white balance gain value, gain is carried out on the pixel points in each color temperature interval in the white point area, and the RGB value of each color temperature interval after the gain of the white point area is obtained;
and determining the second color temperature weight of each color temperature interval according to the RGB value of each color temperature interval after gain.
In an exemplary embodiment, the third determining module 1504 is further configured to:
According to the RGB value of each color temperature interval after gain, three channel histograms of an R channel, a G channel and a B channel of each color temperature interval are determined;
determining the superposition areas of three channels in the three-channel histograms of the R channel, the G channel and the B channel of each color temperature interval;
and determining the second color temperature weight of each color temperature interval according to the superposition area in each color temperature interval.
In an exemplary embodiment, the size of the color temperature section at the middle position is smaller than the size of the color temperature section at the both end positions according to the size of the color temperature value.
In an exemplary embodiment, the third determination module 1504 is further configured to:
and selecting the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value of the white point area in the corresponding relation between the white balance gain value and the color temperature value as a target white balance gain value, and the corresponding color temperature value as a target color temperature value.
In an exemplary embodiment, the apparatus further comprises:
an adjustment module 1505 configured to adjust a target white balance gain value according to a relationship between a color temperature value of the white point region and the target color temperature value.
In an exemplary embodiment, the second determining module 1503 is further configured to:
determining pixel values corresponding to RGB three channels of each pixel of the initial image;
determining a dark channel value corresponding to each pixel in a dark channel map according to the pixel values corresponding to the RGB three channels;
determining a gray value corresponding to each pixel of the initial image;
and determining the white point area according to the dark channel value and the gray value.
In an exemplary embodiment, the second determining module 1503 is further configured to:
determining a first area in the initial image with a dark channel value greater than a first preset threshold;
determining a second region in the initial image, wherein the gray value is larger than a second preset threshold value and smaller than a third preset threshold value;
an intersection between the first region and the second region is determined as a white point region in the initial image.
In an exemplary embodiment, the apparatus further comprises a calibration module 1506 configured to:
acquiring a plurality of reference images of a gray target object with a preset gray value under different given color temperature values;
for each reference image, taking the average value of the pixel values of all pixel points as the pixel value of each reference image;
According to the pixel value of the reference image, determining a white balance gain value corresponding to the reference image;
and determining the corresponding relation between the white balance gain value and the color temperature value according to the white balance gain value and the given color temperature value.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
When the image acquisition apparatus is a terminal, fig. 16 is a block diagram showing a processing apparatus 1600 for an image according to an exemplary embodiment. For example, apparatus 1600 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 16, apparatus 1600 may include one or more of the following components: a processing component 1602, a memory 1604, a power component 1606, a multimedia component 1608, an audio component 1610, an input/output (I/O) interface 1612, a sensor component 1614, and a communication component 1616.
The processing component 1602 generally controls overall operation of the device 1600, such as operations associated with display, telephone call, data communication, camera operation, and recording operations. The processing component 1602 may include one or more processors 1620 to execute instructions to perform all or part of the steps of the methods described above. In addition, the processing component 1602 may include one or more modules that facilitate interactions between the processing component 1602 and other components. For example, the processing component 1602 may include a multimedia module to facilitate interactions between the multimedia component 1608 and the processing component 1602.
The memory 1604 is configured to store various types of data to support operations at the device 1600. Examples of such data include instructions for any application or method operating on device 1600, contact data, phonebook data, messages, pictures, video, and the like. The memory 1604 may be implemented by any type of volatile or nonvolatile memory device or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
A power supply component 1606 provides power to the various components of the device 1600. Power supply component 1606 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for device 1600.
The multimedia component 1608 includes a screen between the device 1600 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1608 includes a front-facing camera and/or a rear-facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 1600 is in an operational mode, such as a capture mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 1610 is configured to output and/or input audio signals. For example, the audio component 1610 includes a Microphone (MIC) configured to receive external audio signals when the device 1600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 1604 or transmitted via the communication component 1616. In some embodiments, the audio component 1610 further includes a speaker for outputting audio signals.
The I/O interface 1612 provides an interface between the processing component 1602 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 1614 includes one or more sensors for providing status assessment of various aspects of the device 1600. For example, the sensor assembly 1614 may detect an on/off state of the device 1600, a relative positioning of the components, such as a display and keypad of the device 1600, the sensor assembly 1614 may also detect a change in position of the device 1600 or a component of the device 1600, the presence or absence of user contact with the device 1600, an orientation or acceleration/deceleration of the device 1600, and a change in temperature of the device 1600. The sensor assembly 1614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1614 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 1616 is configured to facilitate communication between the apparatus 1600 and other devices, either wired or wireless. The device 1600 may access a wireless network based on a communication standard, such as WiFi,2G, or 3G, or a combination thereof. In one exemplary embodiment, the communication component 1616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 1616 also includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 1600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as a memory 1604 that includes instructions executable by the processor 1620 of the apparatus 1600 to perform the above-described methods. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of an apparatus, causes the apparatus to perform a method of processing an image, the method comprising any of the methods described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
The method can more accurately find out the white point area and accurately obtain the target white balance gain value for white balance adjustment, so that the display effect of the image after white balance adjustment is better.
Claims (16)
- A method of processing an image, applied to an image acquisition device, the method comprising:acquiring an initial image acquired by the image acquisition device;determining a corresponding gray scale map and a dark channel map according to the initial image;determining a white point area in the initial image according to the gray scale image and the dark channel image;and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
- The image processing method according to claim 1, wherein the determining a target color temperature value and a target white balance gain value for white balance adjustment according to the correspondence between the white balance gain value and the color temperature and the white balance gain value of the white point region includes:determining a white balance gain value of each pixel point in the white point region;according to the white balance gain value of each pixel point, determining the white balance gain value of the white point area;and determining a target color temperature value and a target white balance gain value for white balance adjustment according to the corresponding relation between the white balance gain value and the color temperature and the white balance gain value of the white point area.
- The image processing method according to claim 2, wherein the determining the white balance gain value of the white point region according to the white balance gain value of each pixel point includes:determining a first color Wen Quanchong associated with an exposure index and a second color temperature weight associated with a color histogram corresponding to each pixel in the white point region;and determining a white balance gain value of the white point area according to the pixel value of each pixel point and the first color Wen Quanchong and the second color temperature weight.
- The method of processing an image according to claim 3, wherein determining a first color Wen Quanchong associated with an exposure index for each pixel in the white point region comprises:dividing the initial image into a plurality of exposure intervals according to the exposure index;dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;and determining the first color Wen Quanchong of each pixel point in the white point region according to the color temperature interval of each pixel point in the white point region.
- The method of processing the image of claim 4, wherein said determining the first color Wen Quanchong from a color temperature interval in which each pixel point in the white point region is located comprises:Determining the number of all pixel points in the white point area and the color temperature interval in which each pixel point is positioned;determining a ratio of the number of pixel points in the color temperature interval to the number of all the pixel points as a first initial color temperature weight for each color temperature interval;the first initial color temperature weight is adjusted based on ambient light information to determine the first color Wen Quanchong.
- The method of processing an image of claim 3, wherein determining a second color temperature weight associated with a color histogram for each pixel point in the white point region comprises:dividing the initial image into a plurality of exposure intervals according to the exposure index;dividing each exposure interval into a plurality of color temperature intervals according to the color temperature;determining an average white balance gain value of each color temperature interval according to the corresponding relation between the white balance gain value and the color temperature;according to the average white balance gain value, gain is carried out on the pixel points in each color temperature interval in the white point area, and the RGB value of each color temperature interval after the gain of the white point area is obtained;and determining the second color temperature weight of each color temperature interval according to the RGB value of each color temperature interval after gain.
- The method for processing an image according to claim 6, wherein said determining the second color temperature weight of each color temperature section according to the RGB values of each color temperature section after gain comprises:according to the RGB value of each color temperature interval after gain, three channel histograms of an R channel, a G channel and a B channel of each color temperature interval are determined;determining the superposition areas of three channels in the three-channel histograms of the R channel, the G channel and the B channel of each color temperature interval;and determining the second color temperature weight of each color temperature interval according to the superposition area in each color temperature interval.
- The image processing method according to claim 4 or 6, wherein the size of the color temperature section at the intermediate position is smaller than the size of the color temperature section at the both end positions according to the size of the color temperature value.
- The image processing method according to any one of claims 1 to 8, wherein determining a target color temperature value and a target white balance gain value for white balance adjustment based on a correspondence of a white balance gain value and a color temperature and a white balance gain value of the white point region, comprises:and selecting the white balance gain value corresponding to the coordinate with the smallest distance from the coordinate corresponding to the white balance gain value of the white point area in the corresponding relation between the white balance gain value and the color temperature value as a target white balance gain value, and the corresponding color temperature value as a target color temperature value.
- The method of processing an image according to claim 9, the method further comprising:and adjusting a target white balance gain value according to the relation between the color temperature value of the white point area and the target color temperature value.
- The method of processing an image according to claim 1, wherein determining a white point region in the initial image from the gray scale map and the dark channel map comprises:determining pixel values corresponding to RGB three channels of each pixel of the initial image;determining a dark channel value corresponding to each pixel in a dark channel map according to the pixel values corresponding to the RGB three channels;determining a gray value corresponding to each pixel of the initial image;and determining the white point area according to the dark channel value and the gray value.
- The method of processing an image according to claim 11, wherein determining the white point region from the dark channel value and the gray scale value comprises:determining a first area in the initial image with a dark channel value greater than a first preset threshold;determining a second region in the initial image, wherein the gray value is larger than a second preset threshold value and smaller than a third preset threshold value;an intersection between the first region and the second region is determined as a white point region in the initial image.
- The method of processing an image according to claim 1, the method further comprising:acquiring a plurality of reference images of a gray target object with a preset gray value under different given color temperature values;for each reference image, taking the average value of the pixel values of all pixel points as the pixel value of each reference image;according to the pixel value of the reference image, determining a white balance gain value corresponding to the reference image;and determining the corresponding relation between the white balance gain value and the color temperature value according to the white balance gain value and the given color temperature value.
- An image processing apparatus applied to an image acquisition apparatus, the apparatus comprising:an acquisition module configured to acquire an initial image acquired by the image acquisition device;a first determining module configured to determine a corresponding gray scale map and dark channel map from the initial image;a second determination module configured to determine a white point region in the initial image from the gray scale map and the dark channel map;and a third determining module configured to determine a target color temperature value and a target white balance gain value for white balance adjustment according to a correspondence relation between the white balance gain value and the color temperature and the white balance gain value of the white point region.
- An image acquisition apparatus comprising:a processor;a memory for storing processor-executable instructions;wherein the processor is configured to perform the method of any of claims 1-13.
- A non-transitory computer readable storage medium, which when executed by a processor of an apparatus, causes the apparatus to perform the method of any of claims 1-13.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2022/098665 WO2023240444A1 (en) | 2022-06-14 | 2022-06-14 | Image processing method, apparatus and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117616774A true CN117616774A (en) | 2024-02-27 |
Family
ID=89192935
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202280004379.6A Pending CN117616774A (en) | 2022-06-14 | 2022-06-14 | Image processing method, device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117616774A (en) |
WO (1) | WO2023240444A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116095292A (en) * | 2023-02-13 | 2023-05-09 | 锐芯微电子股份有限公司 | White balance adjustment method, computer-readable storage medium, and electronic device |
CN118175274B (en) * | 2024-05-15 | 2024-09-06 | 福思(杭州)智能科技有限公司 | Image processing method, device, storage medium and electronic equipment |
CN118365754B (en) * | 2024-06-19 | 2024-08-23 | 杭州群核信息技术有限公司 | Labeling method and device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2004320671A (en) * | 2003-04-21 | 2004-11-11 | Sony Corp | White balance adjusting device, white balance adjusting method |
KR101477736B1 (en) * | 2013-04-17 | 2014-12-31 | 중앙대학교 산학협력단 | Apparatus and method for white point estimation based dark channel prior for auto white balance |
CN105554489A (en) * | 2015-07-10 | 2016-05-04 | 宇龙计算机通信科技(深圳)有限公司 | White balance adjusting method and shooting terminal |
CN105681775B (en) * | 2016-03-08 | 2017-12-19 | 福州瑞芯微电子股份有限公司 | A kind of white balance method and device |
CN107360410A (en) * | 2017-07-10 | 2017-11-17 | 广东欧珀移动通信有限公司 | Method for controlling white balance, device and terminal device |
CN107483909A (en) * | 2017-10-11 | 2017-12-15 | 凌云光技术集团有限责任公司 | White balancing treatment method and device |
-
2022
- 2022-06-14 WO PCT/CN2022/098665 patent/WO2023240444A1/en active Application Filing
- 2022-06-14 CN CN202280004379.6A patent/CN117616774A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
WO2023240444A1 (en) | 2023-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104156947B (en) | Image partition method, device and equipment | |
CN117616774A (en) | Image processing method, device and storage medium | |
CN108470322B (en) | Method and device for processing face image and readable storage medium | |
CN107967459B (en) | Convolution processing method, convolution processing device and storage medium | |
CN104050645B (en) | Image processing method and device | |
CN109672830B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN106651777B (en) | Image processing method and device and electronic equipment | |
CN104182967B (en) | image processing method, device and terminal | |
CN105528765A (en) | Method and device for processing image | |
CN105574834B (en) | Image processing method and device | |
CN106210446A (en) | saturation enhancement method and device | |
CN107730443B (en) | Image processing method and device and user equipment | |
CN106469446B (en) | Depth image segmentation method and segmentation device | |
CN107564047B (en) | Image processing method and device, electronic equipment and computer readable storage medium | |
CN105472228B (en) | Image processing method and device and terminal | |
CN115526774A (en) | Image interpolation method, device, storage medium and electronic equipment | |
CN115914848A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN108062787B (en) | Three-dimensional face modeling method and device | |
CN112016595A (en) | Image classification method and device, electronic equipment and readable storage medium | |
CN114338956A (en) | Image processing method, image processing apparatus, and storage medium | |
CN114418865A (en) | Image processing method, device, equipment and storage medium | |
CN116363148B (en) | Image processing method, device, chip and storage medium | |
CN114339187B (en) | Image processing method, image processing apparatus, and storage medium | |
CN118553183A (en) | Display processing method, display processing device, electronic equipment and storage medium | |
CN115619879A (en) | Image processing method, image processing device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |