White balance calibration method, apparatus and device
By segmenting the image into multiple image blocks and calculating the gain value based on the RGB values of edge pixels for white balance calibration, the problem of calibration deviation in pure color areas of the grayscale world method is solved, improving the accuracy and speed of calibration.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-10
- Publication Date
- 2026-03-24
AI Technical Summary
Existing white balance calibration methods based on the grayscale world are prone to calibration deviations when the image scene is not rich and contains a large number of solid color areas.
The image to be processed is divided into multiple image blocks, the RGB mean value of each image block is determined, and under the condition that the preset conditions are met, the RGB channel gain value is calculated based on the RGB value of the edge pixels, and then white balance calibration is performed.
This avoids the influence of solid color pixels on the gain value, reduces the amount of computation, and improves the accuracy and speed of white balance calibration.
Smart Images

Figure CN116132650B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of display, and in particular, to a white balance calibration method, device and equipment. BACKGROUND
[0002] Generally, in order to make the collected image close to the effect seen by the human eye on the spot, color correction needs to be performed by using Auto White Balance technology. Many existing methods have explored this problem, such as Gray World Method, white point detection method, etc.
[0003] However, when the image scene is not rich and there are a large number of pure color regions, the white balance calibration based on the gray world method is prone to calibration deviation. SUMMARY
[0004] The present disclosure provides a white balance calibration method, device and equipment. The specific solutions are as follows:
[0005] An embodiment of the present disclosure provides a white balance calibration method, comprising:
[0006] segmenting a to-be-processed image to obtain a plurality of image blocks;
[0007] determining an RGB mean value corresponding to each of the image blocks;
[0008] in a case where the RGB mean value corresponding to at least one of the image blocks meets a preset condition, determining an RGB channel gain value according to an RGB value corresponding to an edge pixel point in the plurality of image blocks;
[0009] performing white balance calibration on the to-be-processed image based on the RGB channel gain value.
[0010] In a possible implementation form, the segmenting the to-be-processed image to obtain a plurality of image blocks comprises:
[0011] determining a number of pixel points included in the to-be-processed image;
[0012] obtaining a target segmentation mode matching the number of pixel points from a plurality of preset segmentation modes;
[0013] segmenting the to-be-processed image based on the target segmentation mode to obtain a plurality of image blocks.
[0014] In a possible implementation form, the segmenting the to-be-processed image based on the target segmentation mode to obtain a plurality of segmentation images comprises:
[0015] determine a type of each of the photographed objects included in the image to be processed and a position of each of the photographed objects in the image to be processed;
[0016] obtain a segmentation rule corresponding to each of the photographed objects from preset segmentation rules based on the type of each of the photographed objects;
[0017] segment the image to be processed based on the segmentation rule corresponding to each of the photographed objects, the position of each of the photographed objects in the image to be processed, and the target segmentation mode, to obtain a plurality of segmented images.
[0018] In another possible implementation form, before the image to be processed is segmented to obtain a plurality of segmented images, the method further includes:
[0019] determining that the image to be processed includes a plurality of photographed objects.
[0020] In yet another possible implementation form, the determining of the RGB channel gain value according to the RGB values of the edge pixel points in the plurality of segmented images includes:
[0021] extracting each pixel point adjacent to a segmented edge from each of the segmented images to form a pixel point set;
[0022] determining the RGB channel gain value based on the RGB values of the pixel points in the pixel point set.
[0023] Another aspect of the present disclosure provides a white balance calibration device, which includes:
[0024] an obtaining module configured to segment an image to be processed to obtain a plurality of image blocks;
[0025] a determining module configured to determine an RGB mean value corresponding to each of the image blocks;
[0026] a calculating module configured to, in a case where the RGB mean value corresponding to at least one of the image blocks meets a preset condition, determine an RGB channel gain value according to RGB values of edge pixel points in the plurality of image blocks;
[0027] a calibration module configured to perform white balance calibration on the image to be processed based on the RGB channel gain value.
[0028] Optionally, the obtaining module is specifically configured to:
[0029] determine a number of pixel points included in the image to be processed;
[0030] obtain a target segmentation mode matching the number of pixel points from a plurality of preset segmentation modes;
[0031] based on the target segmentation mode, segmenting the image to be processed to obtain a plurality of image blocks.
[0032] Optionally, the obtaining module is specifically configured to:
[0033] determine a type of each of the photographed objects contained in the image to be processed and a position of each of the photographed objects in the image to be processed;
[0034] based on the type of each of the photographed objects, obtain a segmentation rule corresponding to each of the photographed objects from preset segmentation rules;
[0035] based on the segmentation rule corresponding to each of the photographed objects, the position of each of the photographed objects in the image to be processed, and the target segmentation mode, segment the image to be processed to obtain a plurality of segmented images.
[0036] Optionally, the determining module is further configured to:
[0037] determine that the image to be processed contains a plurality of photographed objects.
[0038] Optionally, the calculating module is specifically configured to:
[0039] extract each pixel point adjacent to a segmentation edge from each of the segmented images to form a pixel point set;
[0040] based on RGB values corresponding to each of the pixel points in the pixel point set, determine the RGB channel gain value.
[0041] Another aspect of the present disclosure provides a device, comprising a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to enable the device to perform the method of the first aspect.
[0042] The white balance calibration method, device and equipment provided by the present disclosure first segment the image to be processed to obtain a plurality of image blocks, then determine the RGB mean value corresponding to each image block, and in the case that the RGB mean value corresponding to at least one image block meets a preset condition, determine the RGB channel gain value according to the RGB values corresponding to the edge pixel points in the plurality of image blocks, and then perform white balance calibration on the image to be processed based on the calculated gain value. Thus, not only the calculated RGB gain value is not affected by a large number of pure color pixel points, but also the calculation amount of the RGB gain value is reduced, and the speed and quality of white balance calibration are improved.
[0043] Additional aspects and advantages of the present disclosure will be described in the following description and become apparent from the following description or can be learned by practice of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0044] The above mentioned and / or additional aspects and advantages of the present disclosure will become apparent and appreciated through the following detailed description, taken in conjunction with the accompanying drawings in which:
[0045] Figure 1 A flowchart of a white balance calibration method provided by an embodiment of the present disclosure;
[0046] Figure 2 A flowchart of another white balance calibration method provided by an embodiment of the present disclosure;
[0047] Figure 3 A flowchart of another white balance calibration method provided by an embodiment of the present disclosure;
[0048] Figure 4 A structural diagram of a white balance calibration device provided by an embodiment of the present disclosure;
[0049] Figure 5 A structural diagram of an apparatus provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0050] Embodiments disclosed by the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present disclosure, and cannot be understood as a limitation of the present disclosure.
[0051] When the image is white balanced and calibrated based on the gray world method, it is assumed that for any image, when it has sufficient color variation, the mean value of its RGB components will tend to the same gray value K, so if there is a difference between the mean value of the current channel and the K value, the pixel value of the channel needs to be corrected based on the K value. The K value can be determined based on the mean value of the three channels, or it can be half of the maximum pixel value, that is, 127 or 128 in an 8-bit image.
[0052] When the image contains a large number of pure color regions, the white balance calibration based on the gray world method is prone to calibration deviation. The white balance calibration method proposed by the present disclosure, for images containing a large number of pure color regions, first divides the image to be processed into multiple image blocks, then determines the RGB channel gain value based on the RGB values corresponding to the edge pixel points in the multiple image blocks, and then performs white balance calibration on the image based on the determined gain value. Since the obtained gain value is not determined based on a large number of pure color pixel points, the problem of deviation in white balance calibration is avoided, and the reliability of white balance calibration is improved.
[0053] Figure 1A flowchart of a white balance calibration method provided by an embodiment of the present disclosure is shown in FIG. 1. As shown in FIG. 1, the method includes but is not limited to the following steps: Figure 1
[0054] Step 101, segmenting the image to be processed to obtain a plurality of image blocks.
[0055] Optionally, the image to be processed can be uniformly segmented, or the image to be processed can be non-uniformly segmented, and the present disclosure does not limit this.
[0056] In some possible implementation forms, the image to be processed can be segmented into a preset number of image blocks, such as 10 blocks, 20 blocks, 50 blocks, and the like, and the present disclosure does not limit this.
[0057] Step 102, determining the RGB mean value corresponding to each image block.
[0058] The RGB channel values of each pixel point in each image block can be counted to determine the RGB mean value corresponding to each image block.
[0059] Step 103, in a case where the RGB mean value corresponding to at least one image block meets a preset condition, determining the RGB channel gain value according to the RGB values of the edge pixel points in the plurality of image blocks.
[0060] Optionally, the preset condition can be any condition that can determine whether an image block is a solid color image block or whether the image block contains a large area of solid color region.
[0061] In some possible implementation forms, if the preset condition includes that the RGB mean values are the same and are all 0 or 255, that is, the image block is a solid black image, or the image block is a solid white image. Then, when the RGB mean value corresponding to at least one image block is 0 or 255, it can be determined that the preset condition is met.
[0062] Optionally, the edge pixel points in the image block can be the pixel points in the image block located in an edge region, where the edge region can be a region where a preset column or a preset row of pixel points adjacent to the boundary line are located, such as a region where 1 row, 2 rows, or 3 rows of pixel points adjacent to the boundary line are located, and the present disclosure does not limit this.
[0063] In some possible implementation forms, each pixel point adjacent to a segmentation edge in each segmented image can be extracted to form a pixel point set, and then the RGB channel gain value can be determined based on the RGB value corresponding to each pixel point in the pixel point set. In the embodiment of the present disclosure, since the RGB mean value corresponding to at least one image block in the image to be processed satisfies the preset condition, it is indicated that the image to be processed includes at least one pure color region. In order to reduce the influence of the RGB value corresponding to a large number of pure color pixel points on the gain value as much as possible, the gain value of the RGB channel is calculated based on the RGB value corresponding to the edge pixel point in the plurality of image blocks in the embodiment of the present disclosure, which not only avoids the influence of a large number of connected pure color pixel points on the gain value, but also reduces the data amount for gain value calculation.
[0064] In step 104, the image to be processed is subjected to white balance calibration based on the RGB channel gain value.
[0065] In the present disclosure, any gray world method can be used to perform white balance calibration on the image to be processed. For example, if the mean values of the RGB three channels corresponding to the edge pixel points in the plurality of image blocks are respectively and the uniform value gray in the gray world method is determined by the following formula:
[0066]
[0067] The gain values of the RGB three channels can be calculated based on the following formula respectively:
[0068]
[0069] Then, the RGB pixel value of each pixel point in the image to be processed is subjected to white balance calibration based on the following formula:
[0070]
[0071] wherein Rnew is the pixel value of the red channel of the pixel point after calibration, R is the pixel value of the red channel of the pixel point before calibration, Gnew is the pixel value of the green channel of the pixel point after calibration, G is the pixel value of the green channel of the pixel point before calibration, Bnew is the pixel value of the blue channel of the pixel point after calibration, and B is the pixel value of the blue channel of the pixel point before calibration.
[0072] In some possible implementation forms, if the image to be processed contains only one shooting object, whether the shooting object is a solid color does not affect the white balance calibration of the image. For example, the image to be processed is an image of a blue sky, and although the area of the solid color region in the image is large, since all the pixels in the image are blue sky, the gain values of the RGB channels calculated based on the pixels in the entire image do not cause white balance deviation of the non-blue-sky pixels. Therefore, the image can be segmented, and the gain of the RGB channel can be calculated based on the RGB values of the edge pixels.
[0073] That is, in some possible implementation forms, the image to be processed can be segmented only when it is determined that the image to be processed contains multiple shooting objects.
[0074] The white balance calibration method provided in the embodiments of the present disclosure first segments the image to be processed to obtain multiple image blocks, then determines the RGB mean values corresponding to each image block, and in the case where the RGB mean values corresponding to at least one image block meet a preset condition, determines the RGB channel gain values based on the RGB values of the edge pixels in the multiple image blocks, and then performs white balance calibration on the image to be processed based on the calculated gain values. In this way, not only is the calculated RGB gain value affected by a large number of solid color pixels avoided, but also the calculation amount of the RGB gain value is reduced, and the speed and quality of the white balance calibration are improved.
[0075] From the above analysis, it can be known that when performing white balance calibration, the image can be first segmented into multiple image blocks, then in the case where the RGB mean values corresponding to at least one image block meet a preset condition, the RGB gain is calculated based on the RGB values of the edge pixels in the multiple image blocks, and then the image to be processed is subjected to white balance calibration based on the obtained RGB gain. In actual processing, if the number of image blocks into which the image to be processed is segmented is too small, the number of edge pixels will be small, thereby causing the calculated RGB gain to be inaccurate, and if the number of image blocks into which the image to be processed is segmented is too large, the number of solid color pixels contained in the edge pixels can be too large, thereby also causing the obtained RGB gain value to be inaccurate. Therefore, in the present disclosure, the image to be processed can be segmented based on the number of pixels contained in the image to be processed, so that the number of edge pixels finally determined is neither too large nor too small, thereby providing a condition for accurately obtaining the RGB gain value. The following will be described in combination with Figure 2 The above case will be described in detail.
[0076] Figure 2 Another flowchart of a white balance calibration method provided in the embodiments of the present disclosure. As shown in the figure, the white balance calibration method includes but is not limited to the following steps: Figure 2
[0077] Step 201, determine the number of pixel points included in the image to be processed.
[0078] Step 202, obtain a target segmentation mode matching the number of pixel points from a plurality of preset segmentation modes.
[0079] The plurality of segmentation modes can be preset, or can be determined by statistics on a large number of images before and after white balance calibration, which is not limited in the present disclosure.
[0080] Optionally, the segmentation mode can be any mode that can segment the image. For example, the number of image blocks included in different segmentation modes is different, or the size of the image blocks included in different segmentation modes is different, and the like, which is not limited in the present disclosure.
[0081] Step 203, segment the image to be processed based on the target segmentation mode to obtain a plurality of image blocks.
[0082] Optionally, if the target segmentation mode is to segment the image into 20 image blocks, the image to be processed can be uniformly or non-uniformly segmented to obtain 20 image blocks.
[0083] Optionally, if the target segmentation mode is to segment the image into 15 blocks, and the 15 image blocks include at least two image blocks of different sizes, the image to be processed can be non-uniformly segmented to obtain 15 image blocks.
[0084] Step 204, determine the corresponding RGB mean value of each image block.
[0085] Step 205, in the case that the corresponding RGB mean value of at least one image block meets a preset condition, determine the RGB channel gain value according to the RGB value of the edge pixel point in the plurality of image blocks.
[0086] Step 206, perform white balance calibration on the image to be processed based on the RGB channel gain value.
[0087] The specific implementation forms of the above steps 204 to 206 can refer to the detailed description of other embodiments of the present disclosure, which will not be repeated here.
[0088] In the embodiments of the present disclosure, firstly, the number of pixel points included in the image to be processed is determined, then a target segmentation mode matching the number of pixel points is determined, and the image to be processed is segmented based on the target segmentation mode to obtain a plurality of image blocks. Then, the RGB mean value corresponding to each image block is determined. In the case where the RGB mean value corresponding to at least one image block meets a preset condition, the RGB channel gain value is determined according to the RGB value corresponding to the edge pixel point in the plurality of image blocks. Finally, the image to be processed is subjected to white balance calibration based on the determined RGB channel gain value. Thus, by adopting a segmentation mode matching the image to be processed to segment the image, the accuracy of the RGB gain value calculated based on the edge pixel points in the plurality of image blocks is further ensured, and the quality of the image after white balance calibration is further improved.
[0089] From the above analysis, in order to ensure the accuracy of the calculated RGB gain value as much as possible, the target segmentation mode corresponding to the image to be processed can be determined based on the number of pixel points included in the image to be processed. In a possible implementation form, since the photographed objects included in the image to be processed can be different, and the segmentation modes corresponding to different photographed objects can also be different, in the present disclosure, the segmentation mode of the image can also be determined based on the type and position of the photographed object. The following will be described in combination with Figure 3 The above case will be described in detail.
[0090] Figure 3 The flowchart of another white balance calibration method provided by the embodiments of the present disclosure is shown in FIG. 6. As shown in FIG. 6, the white balance calibration method includes but is not limited to the following steps: Figure 3
[0091] Step 301, determining the number of pixel points included in the image to be processed.
[0092] Step 302, acquiring, from a plurality of preset segmentation modes, a target segmentation mode matching the number of pixel points.
[0093] The specific implementation forms of the above steps 301 and 302 can refer to the detailed description of other embodiments of the present disclosure, which will not be described here again.
[0094] Step 303, determining the type of each photographed object included in the image to be processed and the position of the photographed object in the image to be processed.
[0095] The position of the photographed object in the image to be processed can be the position of each pixel point occupied by the photographed object in the image to be processed, or can be the relative distance between the region occupied by the photographed object and the reference pixel point in the image to be processed, which is not limited in the present disclosure.
[0096] Optionally, target recognition can be performed on the image to be processed to determine the type of each photographed object contained in the image to be processed and the location of each photographed object in the image to be processed.
[0097] It should be noted that if the image to be processed contains only one type of photographed object, such as only a blue sky, grass, and the like, then the image to be processed can be directly subjected to white balance calibration without being segmented.
[0098] Step 304: Based on the type of each photographed object, a segmentation rule corresponding to each photographed object is obtained from a preset segmentation rule.
[0099] Optionally, the segmentation rule corresponding to different types of photographed objects can be different. For example, the segmentation rule for a photographed object of a person type is that the photographed object as a whole cannot be segmented; the segmentation rule for a photographed object of a static type is that at most two image blocks can be segmented, and the like. After the type of each photographed object is determined, the segmentation rule corresponding to each photographed object can be obtained from the preset rule according to the type of each photographed object.
[0100] Step 305: Based on the segmentation rule corresponding to each photographed object, the location of each photographed object in the image to be processed, and a target segmentation mode, the image to be processed is segmented to obtain a plurality of segmented images.
[0101] For example, if the target segmentation mode is to segment the image to be processed into 10 image blocks, the image to be processed includes two photographed objects, one photographed object is a person and the segmentation rule corresponding to the photographed object is that the photographed object as a whole cannot be segmented, and the other photographed object is a table and the segmentation rule corresponding to the photographed object is that the photographed object can be segmented into 4 image blocks. When the image to be processed is segmented, the region where the person is located can be first determined as one segmented image block, the region where the table is located is segmented into 4 image blocks, and the other regions, in total, are segmented into 5 image blocks.
[0102] When the image to be processed is segmented, not only the size of the image to be processed is considered, but also the content contained in the image to be processed is considered to determine the specific segmentation mode and rule, so that not only the number of pixel points extracted from the segmented image blocks can be guaranteed to be moderate, but also the pixel points extracted can reflect the overall information of the image to be processed as much as possible.
[0103] Step 306: The RGB mean value corresponding to each image block is determined.
[0104] Step 307: In a case where the RGB mean value corresponding to at least one image block satisfies a preset condition, the RGB channel gain value is determined according to the RGB value corresponding to the edge pixel point in the plurality of image blocks.
[0105] Step 308: Perform white balance calibration on the image to be processed based on the RGB channel gain values.
[0106] The specific implementation of steps 306 to 308 above can be found in the detailed description of other embodiments of this disclosure, and will not be repeated here.
[0107] The white balance calibration method provided in this disclosure first determines the number of pixels in the image to be processed, then determines a target segmentation mode matching the number of pixels, and then determines a segmentation rule corresponding to each subject based on the type of the subject in the image to be processed. Next, based on the target segmentation mode, segmentation rules, and the position of the subject in the image to be processed, the image is segmented into multiple image blocks. Then, the RGB mean value corresponding to each image block is determined. If the RGB mean value of at least one image block meets a preset condition, the RGB channel gain value is determined based on the RGB values corresponding to the edge pixels in the multiple image blocks. Finally, white balance calibration is performed on the image to be processed based on the determined RGB channel gain values. Therefore, by adopting a segmentation method matching the size of the image to be processed and a segmentation rule matching the type of subject in the image to be processed, the image is segmented, further ensuring the accuracy of the RGB gain value calculated based on the edge pixels in the multiple image blocks, and further improving the quality of the image after white balance calibration.
[0108] Figure 4 This is a schematic diagram of the structure of a white balance calibration device provided in an embodiment of this disclosure. Figure 4 As shown, the device 40 includes: an acquisition module 41, a determination module 42, a calculation module 43, and a calibration module 44.
[0109] The acquisition module 41 is used to segment the image to be processed to obtain multiple image blocks;
[0110] The determining module 42 is used to determine the RGB mean value corresponding to each image block;
[0111] Calculation module 43 is used to determine the RGB channel gain value based on the RGB values of edge pixels in the plurality of image blocks, provided that the RGB mean value of at least one of the image blocks meets the preset conditions.
[0112] The calibration module 44 is used to perform white balance calibration on the image to be processed based on the RGB channel gain values.
[0113] Optionally, module 41 is used for:
[0114] Determine the number of pixels in the image to be processed;
[0115] Obtain a target segmentation pattern that matches the number of pixels from a set of preset segmentation patterns;
[0116] Based on the target segmentation pattern, the image to be processed is segmented to obtain multiple image blocks.
[0117] Optionally, the acquisition module 41 is specifically used for:
[0118] Determine the type of each of the captured objects contained in the image to be processed and its location in the image to be processed;
[0119] Based on the type of each of the photographed objects, the segmentation rules corresponding to each of the photographed objects are obtained from the preset segmentation rules;
[0120] Based on the segmentation rule corresponding to each of the photographed objects, their position in the image to be processed, and the target segmentation mode, the image to be processed is segmented to obtain multiple segmented images.
[0121] In some possible implementations, the determining module 42 is further configured to:
[0122] It is determined that the image to be processed contains multiple subjects.
[0123] Optionally, the calculation module 43 is specifically used for:
[0124] Extract each pixel adjacent to the segmentation edge from each segmented image to form a pixel set;
[0125] The RGB channel gain value is determined based on the RGB values corresponding to each pixel in the pixel set.
[0126] The specific implementation process of each of the above modules can be referred to in the detailed description of the method embodiments of this disclosure, and will not be repeated here.
[0127] The white balance calibration apparatus provided in this embodiment first segments the image to be processed to obtain multiple image blocks. Then, it determines the RGB mean value corresponding to each image block. If the RGB mean value of at least one image block meets a preset condition, it determines the RGB channel gain value based on the RGB values corresponding to edge pixels in the multiple image blocks. Finally, based on the calculated gain value, it performs white balance calibration on the image to be processed. This not only avoids the influence of a large number of pure color pixels on the calculated RGB gain value but also reduces the computational load of the RGB gain value, improving the speed and quality of white balance calibration.
[0128] Based on the white balance calibration method and apparatus provided in the above embodiments, this disclosure may also provide a device. Figure 5 This is a schematic diagram of the device structure provided for an embodiment of this disclosure. Figure 5 The device includes a processor 51 and a memory 52, the memory 52 storing a computer program, and the processor 51 executing the computer program stored in the memory 52 to cause the device 50 to perform a white balance calibration method.
[0129] The specific implementation process of the white balance calibration method can be referred to in the detailed description of other embodiments of this disclosure, and will not be repeated here.
[0130] The device in this embodiment first segments the image to be processed to obtain multiple image blocks. Then, it determines the RGB mean value corresponding to each image block. If the RGB mean value of at least one image block satisfies a preset condition, it determines the RGB channel gain value based on the RGB values corresponding to edge pixels in the multiple image blocks. Finally, based on the calculated gain value, it performs white balance calibration on the image to be processed. This not only avoids the influence of a large number of pure color pixels on the calculated RGB gain value but also reduces the computational load of the RGB gain value, improving the speed and quality of white balance calibration.
[0131] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise expressly and specifically defined.
[0132] Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.
Claims
1. A white balance calibration method, characterized in that, include: The image to be processed is segmented to obtain multiple image patches; Determine the RGB mean value corresponding to each of the image blocks; If the RGB mean value of at least one of the image blocks meets the preset condition, the RGB channel gain value is determined according to the RGB value of the edge pixels in the plurality of image blocks. The edge pixels in the image block are the pixels located in the edge region of the image block, and the edge region is the region where the preset column or preset row of pixels adjacent to the boundary line of the image block are located. Based on the RGB channel gain values, white balance calibration is performed on the image to be processed; The step of determining the RGB channel gain value based on the RGB values corresponding to the edge pixels in the plurality of segmented image blocks includes: Extract each pixel adjacent to the segmentation edge from each segmented image to form a pixel set; The RGB channel gain value is determined based on the RGB values corresponding to each pixel in the pixel set.
2. The method as described in claim 1, characterized in that, The process of segmenting the image to be processed to obtain multiple image blocks includes: Determine the number of pixels in the image to be processed; Obtain a target segmentation pattern that matches the number of pixels from a set of preset segmentation patterns; Based on the target segmentation pattern, the image to be processed is segmented to obtain multiple image blocks.
3. The method as described in claim 2, characterized in that, The process of segmenting the image to be processed based on the target segmentation pattern to obtain multiple segmented images includes: Determine the type of each of the captured objects contained in the image to be processed and its location in the image to be processed; Based on the type of each of the photographed objects, the segmentation rules corresponding to each of the photographed objects are obtained from the preset segmentation rules; Based on the segmentation rule corresponding to each of the photographed objects, their position in the image to be processed, and the target segmentation mode, the image to be processed is segmented to obtain multiple segmented images.
4. The method according to any one of claims 1-3, characterized in that, Before segmenting the image to be processed to obtain multiple segmented images, the process further includes: It is determined that the image to be processed contains multiple subjects.
5. A white balance calibration device, characterized in that, include: The acquisition module is used to segment the image to be processed to obtain multiple image patches; A determining module is used to determine the RGB mean value corresponding to each image block; The calculation module is used to determine the RGB channel gain value based on the RGB values of the edge pixels in the plurality of image blocks, provided that the RGB mean value of at least one of the image blocks meets the preset conditions. The edge pixels in the image blocks are pixels located in the edge region of the image block, and the edge region is the region of the image block where the preset column or preset row of pixels adjacent to the boundary line are located. The calibration module is used to perform white balance calibration on the image to be processed based on the RGB channel gain values; The step of determining the RGB channel gain value based on the RGB values corresponding to the edge pixels in the plurality of segmented image blocks includes: Extract each pixel adjacent to the segmentation edge from each segmented image to form a pixel set; The RGB channel gain value is determined based on the RGB values corresponding to each pixel in the pixel set.
6. The apparatus as claimed in claim 5, characterized in that, The acquisition module is specifically used for: Determine the number of pixels in the image to be processed; Obtain a target segmentation pattern that matches the number of pixels from a set of preset segmentation patterns; Based on the target segmentation pattern, the image to be processed is segmented to obtain multiple image blocks.
7. The apparatus as claimed in claim 6, characterized in that, The acquisition module is specifically used for: Determine the type of each of the captured objects contained in the image to be processed and its location in the image to be processed; Based on the type of each of the photographed objects, the segmentation rules corresponding to each of the photographed objects are obtained from the preset segmentation rules; Based on the segmentation rule corresponding to each of the photographed objects, their position in the image to be processed, and the target segmentation mode, the image to be processed is segmented to obtain multiple segmented images.
8. The apparatus according to any one of claims 5-7, characterized in that, The determining module is further configured to: It is determined that the image to be processed contains multiple subjects.
9. A device, characterized in that, The device includes a processor and a memory, the memory storing a computer program, the processor executing the computer program stored in the memory to cause the device to perform the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
White balance processing method and device
CN107483909A
Image processing method and device, electronic equipment and computer readable storage medium
CN114022375A