White balance parameter determination method and device, equipment, storage medium and program product

By generating multiple second stats points and determining white balance parameters based on multiple stats points, the problem of insufficient accuracy of white balance parameters in the prior art is solved, and more efficient white balance processing is achieved.

CN119653063APending Publication Date: 2025-03-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411907062.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The accuracy of white balance parameters in the prior art is insufficient, which affects the effect of white balance treatment.

Method used

By obtaining the partition statistics stats graph of the target original image, a plurality of second stats points are generated, and the white balance parameters are determined based on the plurality of first stats points and the second stats points.

Benefits of technology

By expanding the number of stats points, the accuracy of white balance parameters is improved, thereby improving the effect of white balance processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653063A_ABST
    Figure CN119653063A_ABST
Patent Text Reader

Abstract

The invention relates to a white balance parameter determination method and device, equipment, a storage medium and a program product. The method comprises the steps that a partition statistical data stats graph corresponding to a target original image is acquired, and the stats graph comprises a plurality of first stats points; according to the plurality of first stats points, generating a plurality of second stats points; and according to the plurality of first stats points and the plurality of second stats points, white balance parameters are determined, and the white balance parameters are used for carrying out image processing on the target original image. By adopting the method, the accuracy of white balance parameters can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, device, equipment, storage medium and program product for determining white balance parameters. Background Art

[0002] White Balance (WB) is a common image processing method. Its main function is to correct the color of the object under different light sources so that the white in the image looks real and natural, thereby ensuring the accuracy of overall color reproduction.

[0003] In the related art, a general method of white balance is to obtain a stats (partitioned statistical data; statistics) graph based on the original image, where the stats graph includes multiple stats points, and then obtain white balance parameters based on the multiple stats points in the stats graph, and use the white balance parameters to perform image processing on the original image.

[0004] However, the white balance parameters obtained based on the related technology have the problem of insufficient accuracy, which seriously affects the processing effect of white balance. Summary of the invention

[0005] Based on this, it is necessary to provide a method, device, equipment, storage medium and program product for determining white balance parameters that can improve the accuracy of white balance parameters in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for determining white balance parameters, comprising:

[0007] Obtain a partition statistical data stats graph corresponding to a target original image, wherein the stats graph includes a plurality of first stats points; generate a plurality of second stats points based on the plurality of first stats points; determine a white balance parameter based on the plurality of first stats points and the plurality of second stats points, and the white balance parameter is used to perform image processing on the target original image.

[0008] In a second aspect, the present application further provides a white balance parameter determination device, comprising:

[0009] An acquisition module, used to acquire a partition statistical data stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points;

[0010] A generating module, configured to generate a plurality of second stats points according to the plurality of first stats points;

[0011] A determination module is used to determine a white balance parameter according to the plurality of first stats points and the plurality of second stats points, wherein the white balance parameter is used to perform image processing on the target original image.

[0012] In a third aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps described in the first aspect when executing the computer program.

[0013] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps described in the first aspect above.

[0014] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which implements the steps described in the first aspect when executed by a processor.

[0015] The above-mentioned white balance parameter determination method, device, equipment, storage medium and program product obtain a stats graph corresponding to the target original image, wherein the stats graph includes multiple first stats points, and then, based on the multiple first stats points, multiple second stats points are generated, and then, based on the multiple first stats points, white balance parameters are determined, wherein the white balance parameters are used to perform image processing on the target original image. The white balance parameter determination method provided in the present application achieves an expansion of stats points and increases the number of stats points by generating multiple second stats points, and then, the white balance parameters are determined based on the multiple first stats points and the multiple second stats points, that is, the white balance parameters are determined based on the stats points after the number is expanded, which can improve the accuracy of the white balance parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 is a schematic flow chart of a method for determining white balance parameters in one embodiment;

[0018] Figure 2 is a schematic diagram of a color temperature curve in one embodiment;

[0019] Figure 3A schematic diagram of a process for generating multiple second stats points in one embodiment;

[0020] Figure 4 A schematic diagram of a process for determining multiple seed points in one embodiment;

[0021] Figure 5 A schematic diagram of a process for generating multiple second stats points in one embodiment;

[0022] Figure 6 A schematic diagram of a process for determining multiple seed points in one embodiment;

[0023] Figure 7 A schematic diagram of a process for generating multiple second stats points in one embodiment;

[0024] Figure 8 is a structural block diagram of a device for determining white balance parameters in one embodiment;

[0025] Fig. 9 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] Color temperature was first proposed by British physicist William Kelvin in the late 19th century to describe the color characteristics of light sources. In practical applications, different light sources (such as sunlight, fluorescent lamps, tungsten lamps, etc.) have different color temperatures, and cameras will capture different color shifts (such as yellowish, bluish, etc.) under light sources of different color temperatures.

[0028] With the development of photography technology, especially the emergence of color photography, white balance has become an important technical means to correct the impact of changes in light source color temperature on image color, making the white in the image look real and natural, thereby ensuring the accuracy of overall color reproduction.

[0029] In the related art, the general method of white balance is: based on the original image, a stats (partitioned statistical data; statistics) graph is obtained, and the stats graph includes multiple stats points. Then, each stats point is mapped to the rpg-bpg coordinate system according to the pixel value of each stats point, and the distance of each stats point from the color temperature curve is determined in the coordinate system, wherein the color temperature curve is located in the rpg-bpg coordinate system. Then, the weight of each stats point is determined according to the distance of each stats point from the color temperature curve. Then, the white balance parameters can be obtained according to the weight of each stats point and the pixel value of each stats point, and the original image can be processed based on the white balance parameters.

[0030] However, the white balance parameters obtained based on the related technology have the problem of insufficient accuracy, which seriously affects the processing effect of white balance.

[0031] In view of this, embodiments of the present application provide a method, apparatus, device, storage medium and program product for determining white balance parameters. In the method for determining white balance parameters, a stats graph corresponding to a target original image can be obtained, wherein the stats graph includes a plurality of first stats points, and then, based on the plurality of first stats points, a plurality of second stats points are generated, and then, based on the plurality of first stats points, white balance parameters are determined, wherein the white balance parameters are used to perform image processing on the target original image. The method for determining white balance parameters provided in the present application achieves expansion of stats points and increases the number of stats points by generating a plurality of second stats points, and then, the white balance parameters are determined based on the plurality of first stats points and the plurality of second stats points, that is, the white balance parameters are determined based on the stats points after the number is expanded, which can improve the accuracy of the white balance parameters.

[0032] In an exemplary embodiment, Figure 1 As shown, a method for determining white balance parameters is provided, and the method is applied to an electronic device as an example for explanation, wherein the electronic device may be a device with an image processing function, and on this basis, the electronic device may also be a device with an image shooting function, and optionally, the electronic device may be a laptop computer, a smart phone, a tablet computer, an Internet of Things device, and a portable wearable device, etc., wherein the Internet of Things device may be a smart speaker, a smart TV, a smart air conditioner, a smart car device, a projection device, etc., and the portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc., and the head-mounted device may be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. Figure 1As shown, the method for determining white balance parameters may include the following steps:

[0033] Step 101: Obtain a stats graph corresponding to the target original image.

[0034] In an optional embodiment of the present application, the resolution of the target original image can be denoted as imgH*imgW. In step 101, the target original image can be divided into H*W image blocks, wherein it can be understood that each image block can include (imgH*imgW) / (H*W) pixels. For the convenience of explanation, (imgH*imgW) / (H*W) will be denoted as Z in the following text.

[0035] For each image block, the pixel value of each pixel in the Z pixels included in the image block can be obtained, and the pixel value can be an RGB value. Then, the Z RGB values ​​can be averaged to obtain RGB avrg , where the RGB avrg That is the pixel value of the first stats point.

[0036] In other words, a first stats point can be obtained for each image block, and then a stats graph can be obtained based on each first stats point. It can be understood that the stats graph may include H*W first stats points, wherein the H*W first stats points correspond one-to-one to the H*W image blocks, and the pixel value of each first stats point is the average of the pixel values ​​of the Z pixels included in the corresponding image block.

[0037] Step 102: Generate a plurality of second stats points according to the plurality of first stats points.

[0038] According to the above description, the pixel value of the first stats point is obtained according to the pixel value of the pixel in the neighborhood of the target original image. In step 102, the number of stats points can be expanded, that is, multiple second stats points can be generated according to multiple first stats points, wherein, since the second stats point is generated according to the first stats point, that is, the pixel value of the second stats point is actually obtained according to the pixel value of the pixel in the non-neighborhood of the target original image, the generated second stats point is different from the first stats point, and therefore, the effective expansion of the stats point can be achieved.

[0039] Generally speaking, a stats point whose G component in the RGB value is 0 is an invalid point and does not contribute to the determination of the white balance parameters. Correspondingly, a stats point whose G component in the RGB value is not 0 is a valid point and can contribute to the determination of the white balance parameters.

[0040] In practical applications, there are many scenarios where the number of valid points in the stats graph is small. For example, in a darker shooting environment, the number of valid points in the stats graph is small. For another example, in the LWB (Local White Balance) algorithm, the stats graph needs to be processed in blocks to obtain multiple statistical blocks. Then, the local white balance parameters corresponding to each statistical block are determined based on the valid points in each statistical block. Then, based on the local white balance parameters corresponding to each statistical block, image processing is performed on the image area in the target original image corresponding to each statistical block. In actual implementation, the number of valid points in each statistical block may be small.

[0041] A small number of effective points will result in a decrease in the accuracy of the determined white balance parameters, thereby affecting the effect of white balance. In order to ensure the accuracy of the white balance parameters and then ensure the effect of white balance, in the embodiment of the present application, step 102 can be performed, and step 102 can be used to expand the number of stats points, thereby increasing the number of effective points, and then ensuring the accuracy of the white balance parameters and the effect of white balance.

[0042] Step 103: Determine white balance parameters according to the plurality of first stats points and the plurality of second stats points.

[0043] In an optional embodiment of the present application, the white balance parameter is used to perform image processing on the target original image. Optionally, the white balance parameter may include a white balance correction gain coefficient, wherein the white balance correction gain coefficient may include a white balance correction gain coefficient corresponding to the R component (denoted as rGain) and a white balance correction gain coefficient corresponding to the B component (denoted as bGain).

[0044] In an optional embodiment of the present application, for each valid stats point (G component is not 0) among the multiple first stats points and the multiple second stats points, the rpg and bpg of the stats point can be determined according to the pixel value of the stats point, wherein rpg is the ratio of the R component to the G component in the pixel value, and bpg is the ratio of the B component to the G component in the pixel value.

[0045] Then, the stats point can be mapped to the rpg-bpg coordinate system according to the rpg and bpg of the stats point, so as to obtain the mapping point of the stats point in the rpg-bpg coordinate system, wherein there is a color temperature curve in the rpg-bpg coordinate system, and the distance between the mapping point and the color temperature curve (hereinafter referred to as the curve distance) can be determined in the rpg-bpg coordinate system.

[0046] like Figure 2An exemplary color temperature curve is shown. In actual implementation, the color temperature curve can be approximated by a line segment between every two adjacent color temperature points among multiple color temperature points (hereinafter referred to as a color temperature segment), wherein each color temperature point corresponds to a different light source color temperature. Assuming there are 7 color temperature points, the color temperature curve can be approximated by 6 color temperature segments, and the two endpoints of each color temperature segment are two adjacent color temperature points among the 7 color temperature points.

[0047] In actual implementation, the curve distance can be the minimum value of the distance between the mapping point and each color temperature segment. For example, assuming that the color temperature curve is approximated by 6 color temperature segments, the distance between the mapping point and each color temperature segment can be obtained, thereby obtaining 6 distance values, and the minimum distance value among the 6 distance values ​​is used as the curve distance.

[0048] Optionally, if a perpendicular line from a mapping point to a color temperature segment is between the two endpoints of the color temperature segment, the length of the perpendicular line is the distance from the mapping point to the color temperature segment; if a perpendicular line from a mapping point to a color temperature segment is not between the two endpoints of the color temperature segment, the distances between the mapping point and the two endpoints of the color temperature segment can be obtained respectively, and the closer distance can be used as the distance from the mapping point to the color temperature segment.

[0049] After obtaining the curve distance corresponding to each valid stats point in the plurality of first stats points and the plurality of second stats points, the weight corresponding to each valid stats point may be determined, wherein the weight may be calculated based on the following formula:

[0050] .

[0051] in, is the weight corresponding to the i-th valid stats point, is the sum of the curve distances corresponding to each valid stats point, is the curve distance corresponding to the i-th valid stats point.

[0052] After obtaining the weight corresponding to each valid stats point, the white balance correction gain coefficient can be determined based on the weight corresponding to each valid stats point and the pixel value of each valid stats point, wherein the white balance correction gain coefficient can be calculated based on the following formula:

[0053] ;

[0054] ;

[0055] ;

[0056] .

[0057] in, is the number of valid stats points in the plurality of first stats points and the plurality of second stats points, is the rpg of the i-th valid stats point, is the bpg of the i-th valid stats point.

[0058] The method for determining white balance parameters provided in the present embodiment obtains a stats graph corresponding to a target original image, wherein the stats graph includes a plurality of first stats points, and then, based on the plurality of first stats points, generates a plurality of second stats points, and then, based on the plurality of first stats points, determines white balance parameters, wherein the white balance parameters are used to perform image processing on the target original image. The method for determining white balance parameters provided in the present application achieves expansion of stats points and increases the number of stats points by generating a plurality of second stats points, and then, determines the white balance parameters based on the plurality of first stats points and the plurality of second stats points, that is, determines the white balance parameters based on the stats points after the number is expanded, and the accuracy of the white balance parameters can be improved.

[0059] Please refer to Figure 3 In an optional embodiment of the present application, an optional technical process for generating multiple second stats points is provided, such as Figure 3 As shown, the technical process includes the following steps:

[0060] Step 301: Determine multiple seed points according to multiple first stats points.

[0061] In an optional embodiment of the present application, the seed point may also be referred to as a reference point, a basic point, etc., which is a point used to generate a second stats point. In practical applications, there may be a variety of ways to determine the seed point, for example, the seed point may be obtained by screening from a plurality of first stats points, or, for another example, the plurality of first stats points may be processed, and the seed point may be obtained based on the processing result, wherein the processing of the first stats point may include a processing method of fusing adjacent first stats points.

[0062] Step 302: Generate multiple second stats points based on multiple seed points.

[0063] The embodiment of the present application provides two different technical scenarios, one of which is a technical scenario for local white balance, and optionally, a technical scenario for white balance using an LWB algorithm, and the other is a technical scenario for global white balance, and optionally, a technical scenario for white balance using an AWB (Auto White Balance) algorithm. Below, the embodiment of the present application will respectively describe the methods of determining seed points, generating multiple second stats points, and determining white balance parameters in these two technical scenarios.

[0064] Please refer to Figure 4 , which shows an exemplary technical process of determining multiple seed points in the technical scenario of local white balance, such as Figure 4 As shown, the technical process may include the following steps:

[0065] Step 401: Divide the stats graph into blocks to obtain multiple statistical blocks.

[0066] In an optional embodiment of the present application, the stats graph may be divided into P*Q statistical graph blocks. As described above, the stats graph may include H*W first stats points. It can be understood that each statistical graph block may include (H*W) / (P*Q) first stats points. For the convenience of explanation, (H*W) / (P*Q) will be denoted as K in the following text.

[0067] Step 402: for each statistical block, determine a seed point corresponding to the statistical block according to the first stats point included in the statistical block.

[0068] In an optional embodiment of the present application, determining a seed point corresponding to a statistical block according to a first stats point included in the statistical block may include one of the following methods:

[0069] 1. Each first stats point included in the statistical block is used as the seed point corresponding to the statistical block.

[0070] As described above, each statistical block may include K first stats points. In this manner, the number of seed points corresponding to the statistical block may be K.

[0071] 2. Eliminate invalid points from the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0072] As mentioned above, invalid points are stats points whose G component of pixel value is 0, which has no effect on the determination of white balance parameters. Therefore, the invalid points in the first stats points included in the statistical block can be eliminated, and the remaining valid points can be used as seed points. In this way, the number of seed points corresponding to the statistical block is less than or equal to K.

[0073] 3. Downsample the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0074] In an optional embodiment of the present application, the downsampling process may be, for example, a 2x downsampling process, or a higher multiple downsampling process. Through the downsampling process, the number of seed points corresponding to the statistical block can be reduced. For example, in the case of a 2x downsampling, the number of seed points corresponding to the statistical block may be K / 2. Reducing the number of seed points helps to reduce the amount of calculation for generating a second stats point based on the seed points, thereby speeding up the white balance processing speed.

[0075] In an optional embodiment of the present application, the seed points obtained by the downsampling process are not adjacent to each other in the statistical block. For example, the seed points obtained by the downsampling process may be (0,2), (0,4), (0,6) ... (1,1), (1,3), (1,5) ... (2,2), (2,4), (2,6) ...

[0076] According to the above description, the weight of the stats point is negatively correlated with the curve distance corresponding to the stats point. In other words, the smaller the curve distance corresponding to the stats point is, the higher its weight is. In addition, the higher the weight of the stats point is, the greater the contribution of the pixel value of the stats point in determining the white balance parameters is. In other words, the smaller the curve distance corresponding to the generated second stats point is, the greater its contribution is in determining the white balance parameters. Therefore, in actual implementation, it is hoped that the curve distance corresponding to the generated second stats point is as small as possible.

[0077] Through many experiments, it is found that the probability of a smaller curve distance corresponding to the second stats point generated based on non-adjacent seed points (non-adjacent means non-adjacent in the stats graph) is higher, while the probability of a smaller curve distance corresponding to the second stats point generated based on adjacent seed points (adjacent means adjacent in the stats graph) is lower. Taking this into account, the first stats points that are non-adjacent to each other in the statistical block can be retained as seed points during the downsampling process, thereby increasing the probability of a smaller curve distance corresponding to the generated second stats point.

[0078] Please refer to Figure 5 , which shows an exemplary technical process of generating multiple second stats points in the technical scenario of local white balance, such as Figure 5 As shown, the technical process may include the following steps:

[0079] Step 501: For each statistical block, obtain a plurality of first point combinations according to the seed points corresponding to the statistical block.

[0080] The first point combination includes N seed points, where N is a positive integer greater than or equal to 2. It can be understood that for each statistical block, the number of the first point combination is , where F is the number of seed points corresponding to the statistical block. For the convenience of description, the number of the first point combination of each statistical block is recorded as T.

[0081] Step 502: For each first point combination, generate a second stats point corresponding to the first point combination according to the N seed points included in the first point combination.

[0082] In an optional embodiment of the present application, for each first point combination, the pixel values ​​of the N seed points included in the first point combination can be averaged to obtain an average pixel value, which is the pixel value of the second stats point. In this way, the generation of the second stats point is achieved.

[0083] In an optional embodiment of the present application, invalid points can also be eliminated in the process of generating the second stats points. It should be pointed out that if invalid points have been eliminated in the process of generating seed points, that is, if there are no invalid points in the seed points, there will be no invalid points in the generated second stats points. In this case, the technical process of eliminating invalid points in the process of generating the second stats points may not be performed.

[0084] Among them, optionally, in the process of generating the second stats point, invalid points are eliminated, which may include the following steps: for each first point combination, a first candidate stats point is generated according to the N seed points included in the first point combination, optionally, the pixel values ​​of the N seed points included in the first point combination may be averaged to obtain an average pixel value, and the average pixel value is the pixel value of the first candidate stats point. In this way, the generation of the first candidate stats point is realized, and then, it is determined whether the first candidate stats point is an invalid point. If the first candidate stats point is not an invalid point, the first candidate stats point is used as the second stats point corresponding to the first point combination. If the first candidate stats point is an invalid point, the first candidate stats point is eliminated.

[0085] As mentioned above, the number of first point combinations of each statistical block is T, and based on the T first point combinations, Second stats point, that is, each statistical block can correspond to Second stats point, where Less than or equal to T, the number of stat blocks is P*Q, then the number of all second stats points generated can be P*Q* .

[0086] In addition, the embodiment of the present application also provides an exemplary technical process for determining white balance parameters in the technical scenario of local white balance, and the technical process may include:

[0087] For each statistical block, a local white balance parameter corresponding to the statistical block is determined according to a first stats point included in the statistical block and a second stats point corresponding to the statistical block.

[0088] As mentioned above, the number of first stats points included in the statistical block is K, and the number of second stats points corresponding to the statistical block is , that is, according to K+ stats points determine the local white balance parameters corresponding to the statistical block. Optionally, you can use K+ The effective stats points among the stats points determine the local white balance parameters corresponding to the statistical block, wherein the technical process of determining the local white balance parameters is the same as described above, and the embodiments of the present application will not be repeated here.

[0089] After obtaining the local white balance parameters corresponding to each statistical block, the local white balance parameters corresponding to each statistical block can be used to perform image processing on the image area in the target original image corresponding to each statistical block.

[0090] Please refer to Figure 6 , which shows an exemplary technical process of determining multiple seed points in the technical scenario of global white balance, such as Figure 6 As shown, the technical process may include the following steps:

[0091] Step 601: Determine whether a merging condition is met according to the number of the first stats points.

[0092] In an optional embodiment of the present application, if the number of multiple first stats points is greater than a preset number threshold, it is determined that the merging condition is met; alternatively, invalid points are removed from the multiple first stats points, and if the number of remaining first stats points is greater than a preset number threshold, it is determined that the merging condition is met.

[0093] Among them, the preset quantity threshold can be pre-set by a technician, and the embodiments of the present application do not specifically limit this.

[0094] Step 602: According to the result of determining whether the merging condition is met, a seed point determination method is obtained, and a seed point is determined according to the seed point determination method and a plurality of first stats points.

[0095] In a possible implementation, if the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each area are obtained according to the first stats points in each area, and the first statistical stats points corresponding to each area are used as seed points.

[0096] In an optional embodiment of the present application, for each region, the pixel values ​​of the first stats point in the region can be averaged to obtain an average pixel value, which is the pixel value of the first statistical stats point, thereby obtaining the first statistical stats point of the region. Then, the first statistical stats point corresponding to each region can be used as a seed point. Optionally, the first statistical stats point corresponding to each region can also be processed to eliminate invalid points, and the remaining first statistical stats points can be used as seed points.

[0097] In another possible implementation, if the merging condition is met, invalid points are eliminated from multiple first stats points, and then the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained based on the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as seed points.

[0098] In another possible implementation, if the merging condition is not met, multiple first stats points are used as seed points.

[0099] In another possible implementation, if the merging condition is not met, invalid points are removed from the multiple first stats points, and the remaining first stats points are used as seed points.

[0100] In practical applications, if there are a large number of first stats points in the stats graph, then if all the first stats points in the stats graph (or all the valid points in the stats graph) are used as seed points, it will result in a large amount of calculation, thereby affecting the generation speed of the second stats points, and then affecting the speed of determining the white balance parameters, affecting the performance of the white balance processing. Therefore, in the embodiment of the present application, when there are a large number of first stats points in the stats graph, it can be determined that it meets the merging condition, and then, the first stats points in the stats graph are merged to obtain statistical stats points, and the statistical stats points are used as seed points. In this way, the number of seed points can be greatly reduced, thereby improving the calculation speed, and then the performance of the white balance processing can be guaranteed.

[0101] Please refer to Figure 7 , which shows an exemplary technical process of generating multiple second stats points in the technical scenario of global white balance, such as Figure 7 As shown, the technical process may include the following steps:

[0102] Step 701: Acquire multiple second point combinations.

[0103] The second point combination includes M seed points, where M is a positive integer greater than or equal to 2. It can be understood that the number of the second point combination is , where Y is the number of seed points corresponding to the stats graph. For the convenience of description, the number of second point combinations is recorded as S.

[0104] Step 702: For each second point combination, generate a second stats point corresponding to the second point combination according to the M seed points included in the second point combination.

[0105] In an optional embodiment of the present application, for each second point combination, the pixel values ​​of the M seed points included in the second point combination can be averaged to obtain an average pixel value, which is the pixel value of the second stats point. In this way, the generation of the second stats point is achieved.

[0106] In an optional embodiment of the present application, invalid points can also be eliminated in the process of generating the second stats points. It should be pointed out that if invalid points have been eliminated in the process of generating seed points, that is, if there are no invalid points in the seed points, there will be no invalid points in the generated second stats points. In this case, the technical process of eliminating invalid points in the process of generating the second stats points may not be performed.

[0107] Among them, optionally, in the process of generating the second stats point, invalid points are eliminated, which may include the following steps: for each second point combination, a second candidate stats point is generated according to the M seed points included in the second point combination; optionally, the pixel values ​​of the M seed points included in the second point combination may be averaged to obtain an average pixel value, which is the pixel value of the second candidate stats point. In this way, the generation of the second candidate stats point is achieved, and then, it is determined whether the second candidate stats point is an invalid point; if the second candidate stats point is not an invalid point, the second candidate stats point is used as the second stats point corresponding to the second point combination; if the second candidate stats point is an invalid point, the second candidate stats point is eliminated.

[0108] As mentioned above, the number of second point combinations is S, and based on the S first point combinations, Second stats point, where Less than or equal to S, that is, for the stats graph, you can generate A second stats point.

[0109] In addition, the embodiment of the present application also provides an exemplary technical process for determining white balance parameters in the technical scenario of global white balance, and the technical process may include:

[0110] A global white balance parameter is determined according to the plurality of first stats points and the plurality of second stats points, wherein the global white balance parameter is used to perform global image processing on the target original image.

[0111] As mentioned above, the number of first stats points included in the stats graph is H*W, and the number of second stats points corresponding to the stats graph is , that is, according to H*W+ stats points to determine the global white balance parameters, optionally, based on H*W+ The global white balance parameters are determined by the valid stats points among the stats points, wherein the technical process of determining the global white balance parameters is the same as described above, and the embodiments of the present application will not be repeated here.

[0112] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0113] Based on the same inventive concept, the embodiment of the present application also provides a white balance parameter determination device for implementing the white balance parameter determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more white balance parameter determination device embodiments provided below can refer to the limitations of the white balance parameter determination method above, and will not be repeated here.

[0114] In an exemplary embodiment, Figure 8 As shown, a white balance parameter determination device 800 is provided, including: an acquisition module 801, a generation module 802 and a determination module 803.

[0115] The acquisition module 801 is used to acquire a stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points.

[0116] The generating module 802 is used to generate a plurality of second stats points according to a plurality of first stats points.

[0117] The determination module 803 is used to determine a white balance parameter according to the plurality of first stats points and the plurality of second stats points, where the white balance parameter is used to perform image processing on the target original image.

[0118] In an optional embodiment of the present application, the generating module 802 is specifically used to: determine a plurality of seed points according to a plurality of first stats points; and generate a plurality of second stats points according to the plurality of seed points.

[0119] In an optional embodiment of the present application, the generation module 802 is specifically used to: perform block processing on the stats graph to obtain multiple statistical graph blocks; for each statistical graph block, determine a seed point corresponding to the statistical graph block according to the first stats point included in the statistical graph block.

[0120] In an optional embodiment of the present application, the generation module 802 is specifically used for one of the following: taking each first stats point included in the statistical block as a seed point corresponding to the statistical block; removing invalid points from the first stats points included in the statistical block to obtain the seed point corresponding to the statistical block; downsampling the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0121] In an optional embodiment of the present application, the seed points obtained by downsampling processing are not adjacent to each other in the statistical block.

[0122] In an optional embodiment of the present application, the generation module 802 is specifically used to: for each statistical block, obtain multiple first point combinations according to the seed points corresponding to the statistical block, the first point combination includes N seed points, N is a positive integer greater than or equal to 2, and for each first point combination, generate a second stats point corresponding to the first point combination according to the N seed points included in the first point combination.

[0123] In an optional embodiment of the present application, the generation module 802 is specifically used to: generate a first candidate stats point based on the N seed points included in the first point combination; if the first candidate stats point is not an invalid point, use the first candidate stats point as the second stats point corresponding to the first point combination; if the first candidate stats point is an invalid point, eliminate the first candidate stats point.

[0124] In an optional embodiment of the present application, the determination module 803 is specifically used to: for each statistical block, determine the local white balance parameter corresponding to the statistical block according to the first stats point included in the statistical block and the second stats point corresponding to the statistical block, the local white balance parameter is used to perform image processing on the target image area in the target original image, and the target image area is the image area corresponding to the statistical block.

[0125] In an optional embodiment of the present application, the generation module 802 is specifically used to: determine whether the merging condition is met based on the number of multiple first stats points; obtain a seed point determination method based on the determination result of whether the merging condition is met, and determine the seed point based on the seed point determination method and multiple first stats points.

[0126] In an optional embodiment of the present application, the generation module 802 is specifically used to: if the number of multiple first stats points is greater than a preset number threshold, determine that the merging condition is met; or, remove invalid points from the multiple first stats points, and if the number of remaining first stats points is greater than a preset number threshold, determine that the merging condition is met.

[0127] In an optional embodiment of the present application, the generation module 802 is specifically used to: if the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each area are obtained according to the first stats points in each area, and the first statistical stats points corresponding to each area are used as seed points; or, if the merging condition is met, invalid points are removed from multiple first stats points, the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained according to the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as seed points.

[0128] In an optional embodiment of the present application, the generation module 802 is specifically used to: if the merging condition is not met, use multiple first stats points as seed points; or, if the merging condition is not met, remove invalid points from multiple first stats points and use the remaining first stats points as seed points.

[0129] In an optional embodiment of the present application, the generation module 802 is specifically used to: obtain multiple second point combinations, the second point combination includes M seed points, M is a positive integer greater than or equal to 2; for each second point combination, generate a second stats point corresponding to the second point combination according to the M seed points included in the second point combination.

[0130] In an optional embodiment of the present application, the generation module 802 is specifically used to: generate a second candidate stats point based on the M seed points included in the second point combination; if the second candidate stats point is not an invalid point, use the second candidate stats point as the second stats point corresponding to the second point combination; if the second candidate stats point is an invalid point, eliminate the second candidate stats point.

[0131] In an optional embodiment of the present application, the determination module 803 is specifically used to determine a global white balance parameter according to a plurality of first stats points and a plurality of second stats points, where the global white balance parameter is used to perform global image processing on the target original image.

[0132] Each module in the above-mentioned white balance parameter determination device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in the electronic device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0133] In an exemplary embodiment, an electronic device is provided, the internal structure of which can be as shown in FIG. Fig. 9 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a method for determining white balance parameters is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0134] Those skilled in the art will understand that Fig. 9The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0135] In an exemplary embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0136] Obtain a partition statistical data stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points; generate a plurality of second stats points based on the plurality of first stats points; determine a white balance parameter based on the plurality of first stats points and the plurality of second stats points, and the white balance parameter is used to perform image processing on the target original image.

[0137] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determining a plurality of seed points according to the plurality of first stats points; and generating a plurality of second stats points according to the plurality of seed points.

[0138] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the stats graph is processed into blocks to obtain multiple statistical graph blocks; for each statistical graph block, a seed point corresponding to the statistical graph block is determined according to the first stats point included in the statistical graph block.

[0139] In one embodiment, when the processor executes the computer program, it also implements one of the following: taking each first stats point included in the statistical block as a seed point corresponding to the statistical block; removing invalid points from the first stats points included in the statistical block to obtain the seed point corresponding to the statistical block; downsampling the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0140] In one embodiment, the seed points obtained by the downsampling process are not adjacent to each other in the statistical block.

[0141] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for each statistical block, multiple first point combinations are obtained according to the seed points corresponding to the statistical block, the first point combination includes N seed points, N is a positive integer greater than or equal to 2, and for each first point combination, a second stats point corresponding to the first point combination is generated according to the N seed points included in the first point combination.

[0142] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating a first candidate stats point based on the N seed points included in the first point combination; if the first candidate stats point is not an invalid point, using the first candidate stats point as the second stats point corresponding to the first point combination; if the first candidate stats point is an invalid point, eliminating the first candidate stats point.

[0143] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for each statistical block, a local white balance parameter corresponding to the statistical block is determined based on a first stats point included in the statistical block and a second stats point corresponding to the statistical block, and the local white balance parameter is used to perform image processing on a target image area in a target original image, and the target image area is an image area corresponding to the statistical block.

[0144] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining whether a merging condition is met based on the number of multiple first stats points; obtaining a seed point determination method based on the determination result of whether the merging condition is met, and determining the seed point based on the seed point determination method and multiple first stats points.

[0145] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the number of multiple first stats points is greater than a preset number threshold, it is determined that the merging condition is met; or, invalid points are removed from the multiple first stats points, and if the number of remaining first stats points is greater than a preset number threshold, it is determined that the merging condition is met.

[0146] In one embodiment, the processor further implements the following steps when executing the computer program: if the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each area are obtained based on the first stats points in each area, and the first statistical stats points corresponding to each area are used as seed points; or, if the merging condition is met, invalid points are removed from multiple first stats points, the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained based on the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as seed points.

[0147] In one embodiment, when the processor executes the computer program, the following steps are also implemented: if the merging condition is not met, multiple first stats points are all used as seed points; or, if the merging condition is not met, invalid points are removed from multiple first stats points, and the remaining first stats points are used as seed points.

[0148] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining multiple second point combinations, the second point combination includes M seed points, and M is a positive integer greater than or equal to 2; for each second point combination, generating a second stats point corresponding to the second point combination according to the M seed points included in the second point combination.

[0149] In one embodiment, when the processor executes the computer program, the following steps are also implemented: generating a second candidate stats point based on the M seed points included in the second point combination; if the second candidate stats point is not an invalid point, using the second candidate stats point as the second stats point corresponding to the second point combination; if the second candidate stats point is an invalid point, eliminating the second candidate stats point.

[0150] In one embodiment, when the processor executes the computer program, the following steps are further implemented: determining a global white balance parameter based on the plurality of first stats points and the plurality of second stats points, wherein the global white balance parameter is used to perform global image processing on the target original image.

[0151] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0152] Obtain a partition statistical data stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points; generate a plurality of second stats points based on the plurality of first stats points; determine a white balance parameter based on the plurality of first stats points and the plurality of second stats points, and the white balance parameter is used to perform image processing on the target original image.

[0153] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a plurality of seed points based on the plurality of first stats points; and generating a plurality of second stats points based on the plurality of seed points.

[0154] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the stats graph is processed into blocks to obtain multiple statistical graph blocks; for each statistical graph block, a seed point corresponding to the statistical graph block is determined according to the first stats point included in the statistical graph block.

[0155] In one embodiment, when the computer program is executed by the processor, it also implements one of the following: taking each first stats point included in the statistical block as a seed point corresponding to the statistical block; removing invalid points from the first stats points included in the statistical block to obtain the seed point corresponding to the statistical block; downsampling the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0156] In one embodiment, the seed points obtained by the downsampling process are not adjacent to each other in the statistical block.

[0157] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each statistical block, multiple first point combinations are obtained based on the seed points corresponding to the statistical block, the first point combination includes N seed points, N is a positive integer greater than or equal to 2, and for each first point combination, a second stats point corresponding to the first point combination is generated based on the N seed points included in the first point combination.

[0158] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a first candidate stats point based on the N seed points included in the first point combination; if the first candidate stats point is not an invalid point, using the first candidate stats point as the second stats point corresponding to the first point combination; if the first candidate stats point is an invalid point, eliminating the first candidate stats point.

[0159] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each statistical block, a local white balance parameter corresponding to the statistical block is determined based on a first stats point included in the statistical block and a second stats point corresponding to the statistical block, and the local white balance parameter is used to perform image processing on a target image area in a target original image, and the target image area is an image area corresponding to the statistical block.

[0160] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining whether a merging condition is met based on the number of multiple first stats points; obtaining a seed point determination method based on the determination result of whether the merging condition is met, and determining the seed point based on the seed point determination method and multiple first stats points.

[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: if the number of multiple first stats points is greater than a preset number threshold, it is determined that the merging condition is met; or, invalid points are removed from the multiple first stats points, and if the number of remaining first stats points is greater than a preset number threshold, it is determined that the merging condition is met.

[0162] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each area are obtained based on the first stats points in each area, and the first statistical stats points corresponding to each area are used as seed points; or, if the merging condition is met, invalid points are removed from multiple first stats points, the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained based on the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as seed points.

[0163] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the merging condition is not met, multiple first stats points are all used as seed points; or, if the merging condition is not met, invalid points are removed from multiple first stats points, and the remaining first stats points are used as seed points.

[0164] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining multiple second point combinations, the second point combination includes M seed points, and M is a positive integer greater than or equal to 2; for each second point combination, generating a second stats point corresponding to the second point combination according to the M seed points included in the second point combination.

[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a second candidate stats point based on the M seed points included in the second point combination; if the second candidate stats point is not an invalid point, using the second candidate stats point as the second stats point corresponding to the second point combination; if the second candidate stats point is an invalid point, eliminating the second candidate stats point.

[0166] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining a global white balance parameter based on the plurality of first stats points and the plurality of second stats points, wherein the global white balance parameter is used to perform global image processing on the target original image.

[0167] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0168] Obtain a partition statistical data stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points; generate a plurality of second stats points based on the plurality of first stats points; determine a white balance parameter based on the plurality of first stats points and the plurality of second stats points, and the white balance parameter is used to perform image processing on the target original image.

[0169] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: determining a plurality of seed points based on the plurality of first stats points; and generating a plurality of second stats points based on the plurality of seed points.

[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the stats graph is processed into blocks to obtain multiple statistical graph blocks; for each statistical graph block, a seed point corresponding to the statistical graph block is determined according to the first stats point included in the statistical graph block.

[0171] In one embodiment, when the computer program is executed by the processor, it also implements one of the following: taking each first stats point included in the statistical block as a seed point corresponding to the statistical block; removing invalid points from the first stats points included in the statistical block to obtain the seed point corresponding to the statistical block; downsampling the first stats point included in the statistical block to obtain the seed point corresponding to the statistical block.

[0172] In one embodiment, the seed points obtained by the downsampling process are not adjacent to each other in the statistical block.

[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each statistical block, multiple first point combinations are obtained based on the seed points corresponding to the statistical block, the first point combination includes N seed points, N is a positive integer greater than or equal to 2, and for each first point combination, a second stats point corresponding to the first point combination is generated based on the N seed points included in the first point combination.

[0174] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a first candidate stats point based on the N seed points included in the first point combination; if the first candidate stats point is not an invalid point, using the first candidate stats point as the second stats point corresponding to the first point combination; if the first candidate stats point is an invalid point, eliminating the first candidate stats point.

[0175] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each statistical block, a local white balance parameter corresponding to the statistical block is determined based on a first stats point included in the statistical block and a second stats point corresponding to the statistical block, and the local white balance parameter is used to perform image processing on a target image area in a target original image, and the target image area is an image area corresponding to the statistical block.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: determining whether a merging condition is met based on the number of multiple first stats points; obtaining a seed point determination method based on the determination result of whether the merging condition is met, and determining the seed point based on the seed point determination method and multiple first stats points.

[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: if the number of multiple first stats points is greater than a preset number threshold, it is determined that the merging condition is met; or, invalid points are removed from the multiple first stats points, and if the number of remaining first stats points is greater than a preset number threshold, it is determined that the merging condition is met.

[0178] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each area are obtained based on the first stats points in each area, and the first statistical stats points corresponding to each area are used as seed points; or, if the merging condition is met, invalid points are removed from multiple first stats points, the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained based on the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as seed points.

[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: if the merging condition is not met, multiple first stats points are all used as seed points; or, if the merging condition is not met, invalid points are removed from multiple first stats points, and the remaining first stats points are used as seed points.

[0180] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining multiple second point combinations, the second point combination includes M seed points, and M is a positive integer greater than or equal to 2; for each second point combination, generating a second stats point corresponding to the second point combination according to the M seed points included in the second point combination.

[0181] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: generating a second candidate stats point based on the M seed points included in the second point combination; if the second candidate stats point is not an invalid point, using the second candidate stats point as the second stats point corresponding to the second point combination; if the second candidate stats point is an invalid point, eliminating the second candidate stats point.

[0182] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining a global white balance parameter based on the plurality of first stats points and the plurality of second stats points, wherein the global white balance parameter is used to perform global image processing on the target original image.

[0183] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for determining white balance parameters, characterized in that: The method comprises: Obtain a partition statistical data stats graph corresponding to the target original image, wherein the stats graph includes a plurality of first stats points; Generating a plurality of second stats points according to the plurality of first stats points; A white balance parameter is determined according to the plurality of first stats points and the plurality of second stats points, and the white balance parameter is used to perform image processing on the target original image.

2. The method according to claim 1, characterized in that: The step of generating a plurality of second stats points according to the plurality of first stats points comprises: Determine a plurality of seed points according to the plurality of first stats points; The plurality of second stats points are generated according to the plurality of seed points.

3. The method according to claim 2, characterized in that The step of determining a plurality of seed points according to the plurality of first stats points comprises: The stats graph is divided into blocks to obtain a plurality of statistical blocks; For each of the statistical blocks, a seed point corresponding to the statistical block is determined according to a first stats point included in the statistical block.

4. The method according to claim 3, characterized in that The determining of the seed point corresponding to the statistical block according to the first stats point included in the statistical block includes one of the following methods: Taking each first stats point included in the statistical block as a seed point corresponding to the statistical block; Eliminate invalid points from the first stats points included in the statistical block to obtain seed points corresponding to the statistical block; Downsampling is performed on the first stats point included in the statistical block to obtain a seed point corresponding to the statistical block.

5. The method according to claim 4, characterized in that The seed points obtained by the downsampling process are not adjacent to each other in the statistical block.

6. The method according to any one of claims 3 to 5, characterized in that: The step of generating the plurality of second stats points according to the plurality of seed points comprises: For each of the statistical blocks, multiple first point combinations are obtained based on the seed points corresponding to the statistical blocks, the first point combinations include N seed points, N is a positive integer greater than or equal to 2, and for each of the first point combinations, second stats points corresponding to the first point combination are generated based on the N seed points included in the first point combination.

7. The method according to claim 6, characterized in that The step of generating a second stats point corresponding to the first point combination according to the N seed points included in the first point combination includes: Generate a first candidate stats point according to the N seed points included in the first point combination; If the first candidate stats point is not an invalid point, taking the first candidate stats point as the second stats point corresponding to the first point combination; If the first candidate stats point is an invalid point, the first candidate stats point is eliminated.

8. The method according to any one of claims 3 to 5, characterized in that: The step of determining white balance parameters according to the plurality of first stats points and the plurality of second stats points comprises: For each of the statistical blocks, the local white balance parameters corresponding to the statistical block are determined based on the first stats point included in the statistical block and the second stats point corresponding to the statistical block, and the local white balance parameters are used to perform image processing on the target image area in the target original image, and the target image area is the image area corresponding to the statistical block.

9. The method according to claim 2, characterized in that: The step of determining a plurality of seed points according to the plurality of first stats points comprises: Determining whether a merging condition is met according to the number of the plurality of first stats points; A seed point determination method is acquired according to a result of determining whether the merging condition is satisfied, and the seed point is determined according to the seed point determination method and the plurality of first stats points.

10. The method according to claim 9, characterized in that The determining, according to the number of the plurality of first stats points, whether a merging condition is satisfied comprises: If the number of the plurality of first stats points is greater than a preset number threshold, it is determined that the merging condition is met; or, Invalid points are removed from the plurality of first stats points, and if the number of remaining first stats points is greater than the preset number threshold, it is determined that the merging condition is satisfied.

11. The method according to claim 9, characterized in that The step of acquiring a seed point determination method according to a result of determining whether the merging condition is satisfied, and determining the seed point according to the seed point determination method and the plurality of first stats points includes: If the merging condition is met, the stats graph is partitioned, and the first statistical stats points corresponding to each region are obtained according to the first stats points in each region, and the first statistical stats points corresponding to each region are used as the seed points; or, If the merging condition is met, invalid points are eliminated from the multiple first stats points, the stats graph is partitioned, and the second statistical stats points corresponding to each area are obtained based on the remaining first stats points in each area, and the second statistical stats points corresponding to each area are used as the seed points.

12. The method according to claim 9, characterized in that The step of acquiring a seed point determination method according to a result of determining whether the merging condition is satisfied, and determining the seed point according to the seed point determination method and the plurality of first stats points includes: If the merging condition is not met, all of the multiple first stats points are used as the seed points; or, If the merging condition is not met, invalid points are removed from the multiple first stats points, and the remaining first stats points are used as the seed points.

13. The method according to any one of claims 9 to 12, characterized in that: Generating the plurality of second stats points according to the seed point comprises: Acquire multiple second point combinations, where the second point combinations include M seed points, where M is a positive integer greater than or equal to 2; For each of the second point combinations, a second stats point corresponding to the second point combination is generated according to the M seed points included in the second point combination.

14. The method according to claim 13, characterized in that The step of generating a second stats point corresponding to the second point combination according to the M seed points included in the second point combination includes: Generate a second candidate stats point according to the M seed points included in the second point combination; If the second candidate stats point is not an invalid point, taking the second candidate stats point as the second stats point corresponding to the second point combination; If the second candidate stats point is an invalid point, the second candidate stats point is eliminated.

15. The method according to any one of claims 9 to 12, characterized in that: The step of determining white balance parameters according to the plurality of first stats points and the plurality of second stats points comprises: A global white balance parameter is determined according to the plurality of first stats points and the plurality of second stats points, and the global white balance parameter is used to perform global image processing on the target original image.

16. A device for determining white balance parameters, characterized in that: The device comprises: An acquisition module, used to acquire a stats graph corresponding to a target original image, wherein the stats graph includes a plurality of first stats points; A generating module, configured to generate a plurality of second stats points according to the plurality of first stats points; A determination module is used to determine a white balance parameter according to the plurality of first stats points and the plurality of second stats points, wherein the white balance parameter is used to perform image processing on the target original image.

17. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 15 are implemented.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 15 are implemented.

Citation Information

Cited By

  • White balance parameter determination method and device, equipment, storage medium and program product

    CN122269156A

  • White balance parameter determination methods, devices, equipment, storage media, and software products.

    CN122269156B