White balance processing method and device, electronic equipment and storage medium

By using the positional relationship between the reference blackbody curve and the target white balance landing point in the white balance algorithm to correct the white balance gain, the problem of white balance color cast in large blue or yellow scenes is solved, and the accuracy and stability of the algorithm are improved. .

CN119342358AActive Publication Date: 2025-01-21ZHEJIANG UNIVIEW TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202310899240.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-01-21
Estimated Expiration
2043-07-20

AI Technical Summary

Technical Problem

In scenes containing large areas of blue or yellow solid colors, the automatic white balance algorithm performs poorly and has color castration, resulting in insufficient accuracy and stability of white balance.

Method used

By determining the reference blackbody curve and the target white balance landing point, the white balance gain is corrected based on these positional relationships to improve the white balance color cast problem in large-area blue or yellow scenes.

Benefits of technology

It improves the accuracy and stability of the automatic white balance algorithm and reduces the color cast of the picture, especially in large-area blue or yellow scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119342358A_ABST
    Figure CN119342358A_ABST
Patent Text Reader

Abstract

The invention discloses a white balance processing method and device, electronic equipment and a storage medium. The method comprises the following steps: determining a reference black body curve adopted by a first image area, wherein the reference black body curve is obtained by fitting white balance drop points which represent different reference white balance gains and are represented as white points; determining a target white balance drop point of a second image region in the first image region, wherein the second image region is a sub-image region obtained by performing region division on the first image region; and based on a position relationship between a target white balance drop point in a second image area and the reference black body curve, determining a white balance gain adopted for white balance of the first image area. According to the scheme, the problem of white balance color cast in large-area blue and yellow scenes can be improved, so that the accuracy of an automatic white balance algorithm is improved, and the color cast condition of a picture is avoided as far as possible under the condition that the algorithm complexity is relatively low and the influence on the performance is relatively small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of white balance, and in particular to a white balance processing method, device, electronic equipment and storage medium. Background Art

[0002] White balance is a standard configuration function in video capture equipment in the fields of intelligent transportation and public security monitoring, which enables video capture equipment to capture clear images.

[0003] Video recording equipment uses an automatic white balance algorithm that has a good performance in most common scenes and can basically achieve the observation effect of the human eye. However, in shooting scenes with large areas of pure color, such as large areas of blue or yellow, the white balance performance is very poor and there will be a certain degree of color cast. Therefore, how to improve the accuracy and stability of the white balance algorithm has become an urgent problem to be solved. Summary of the invention

[0004] The present invention provides a white balance processing method, device, electronic device and storage medium to solve the problem of color cast caused by large-area blue and yellow pure color scenes during white balance.

[0005] According to one aspect of the present invention, a white balance processing method is provided, the method comprising:

[0006] Determine a reference blackbody curve used in the first image area, where the reference blackbody curve is obtained by fitting white balance drop points characterized by different reference white balance gains and represented as white points, where the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources with different color temperatures are used to illuminate a reference target;

[0007] Determine a target white balance landing point of a second image area within the first image area, where the second image area is a sub-image area obtained by dividing the first image area;

[0008] Based on the positional relationship between the target white balance point in the second image area and the reference blackbody curve, a white balance gain used for white balancing the first image area is determined.

[0009] According to another aspect of the present invention, a white balance processing device is provided, the device comprising:

[0010] A first determination module is used to determine a reference black body curve used in the first image area, wherein the reference black body curve is obtained by fitting white balance drop points characterized by different reference white balance gains and represented as white points, wherein the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources with different color temperatures are used to illuminate a reference target;

[0011] A second determination module is used to determine a target white balance landing point of a second image area in the first image area, where the second image area is a sub-image area obtained by dividing the first image area;

[0012] The third determination module is used to determine the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance point in the second image area and the reference black body curve.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the white balance processing method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the white balance processing method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention, when performing white balance on the first image area, determines the reference black body curve obtained by fitting the white balance landing points characterized by different reference white balance gains and represented as white points, and determines the target white balance landing point of the second image area in the first image area, the second image area is a sub-image area obtained by dividing the first image area, and then determines the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance landing point and the reference black body curve in the second image area. This solution can correct the white balance gain by the positional relationship between the white balance landing point and the reference black body curve that meet the preset conditions, and can improve the white balance color cast problem in large-area blue and yellow scenes, thereby improving the accuracy of the automatic white balance algorithm, and ensuring that the picture does not have color cast as much as possible under the condition that the algorithm complexity is low and the performance is less affected.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a white balance processing method provided according to an embodiment of the present invention;

[0022] Figure 2 is a schematic diagram of fitting of a blackbody curve applicable to an embodiment of the present invention;

[0023] Figure 3 is a schematic diagram of dividing an image region including a large area of ​​yellow scene applicable to an embodiment of the present invention;

[0024] Figure 4 is a flow chart of another white balance processing method provided according to an embodiment of the present invention;

[0025] Figure 5a This is a schematic diagram of a large-area blue scene landing point distribution applicable to an embodiment of the present invention;

[0026] Figure 5b This is a schematic diagram of the distribution of landing points in a large-area yellow scene applicable to an embodiment of the present invention;

[0027] Figure 6 is a structural schematic diagram of a white balance processing device provided according to an embodiment of the present invention;

[0028] Figure 7 It is a structural schematic diagram of an electronic device for implementing the white balance processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0031] Figure 1 A flow chart of a white balance processing method provided in an embodiment of the present invention is provided. The embodiment of the present disclosure is applicable to the case where the white balance gain of an image area containing a large area of ​​pure blue or yellow color scenes is corrected. The method can be executed by a white balance processing device, which can be implemented in the form of software and / or hardware. The white balance processing device can be configured in any electronic device with a network communication function, which can be a mobile terminal, a PC, a server, etc.

[0032] like Figure 1 As shown, the white balance processing method of this embodiment may include the following processes:

[0033] S110. Determine a reference blackbody curve used in the first image area, where the reference blackbody curve is obtained by fitting white balance points characterized by different reference white balance gains and represented as white points, where the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources of different color temperatures are used to illuminate a reference target.

[0034] In a light box with reference conditions, the reference target can be illuminated by light sources of different color temperatures. By capturing images of the reference target, the white balance gain of the reference target under light sources of different color temperatures can be calibrated. The reference target can be a grayscale card image.

[0035] The white balance gain can be represented by the red component channel gain and the blue component channel gain corresponding to the pixel, the red component channel gain is the ratio of the red component to the green component, and the blue component channel gain is the ratio of the blue component to the green component. The white balance landing point can be a coordinate point represented by the red component channel gain and the blue component channel gain corresponding to the white balance gain.

[0036] For white or gray illuminated by natural light sources of different color temperatures, they can be represented by some points with different coordinates in the (R / G, B / G) coordinate system. These points are called white points. For this purpose, the coordinate points characterized by the white balance gain obtained by illuminating the reference target with light sources of different color temperatures and taking images can be set as x(x0, x0, …xi). The reference blackbody curve f(xi) can be obtained by fitting the coordinate points characterized by the white balance gain. See Figure 2 Taking three color temperatures A, B, and C as examples, the calibrated white balance gain values ​​are xa, xb, and xc respectively. The corresponding blackbody curve can be obtained by fitting the coordinates of the three points xa, xb, and xc. The white point of each color temperature falls exactly on the point where the reference blackbody curve is fitted.

[0037] S120: Determine a target white balance landing point of a second image area in the first image area, where the second image area is a sub-image area obtained by dividing the first image area.

[0038] See also Figure 3 In order to better perform white balance processing on the first image area, the first image area that needs to be white balanced can be segmented, so that multiple second image areas can be obtained through regional segmentation. For example, the first image area of ​​the current scene can be segmented into m*n second image areas, where m and n can be set to 32.

[0039] See also Figure 3 , the pixels in the image area can be represented by three primary color components, including red component, blue component and green component. The white balance gain of each pixel can be calculated by the red component, blue component and green component, and the coordinate point represented by the red component channel gain and the blue component channel gain of the white balance gain is used as the white balance point of the pixel. Furthermore, the target white balance point of each second image area can be statistically determined, and the target white balance point can be the white balance point corresponding to all pixels in the second image area or the selected part of the white balance points.

[0040] As an optional but non-limiting implementation, determining the target white balance landing point of the second image area in the first image area may include steps A1-A3:

[0041] Step A1: determine a reference white area range of the first image area from a reference black body curve.

[0042] Step A2: remove some abnormal white balance points in the first image area according to the reference white area range, where the white balance points are coordinate points represented by the red component channel gain and the blue component channel gain of the white balance gain of the pixels in the image area.

[0043] Step A3: after removing some white balance points included in the first image area, determine the remaining white balance points in the second image area as target white balance points.

[0044] Based on the reference black body curve f(xi), the reference white area range for screening abnormal white balance points in the first image area can be defined. The white area can be a region composed of white points of different color temperatures and potential white points in their neighborhoods. The reference white area range has the function of screening abnormal white balance points in the first image area. By limiting the reference white area range f(xl) and f(xh), the white balance points with abnormal white balance gains in the first image area can be excluded.

[0045] Optionally, determining a reference white area range of the first image area from a reference black body curve may include: determining color temperature limit information of the first image area, the color temperature limit information including the color temperature range of an environment in which a device is used for performing white balance processing; determining a degree of deviation of each white balance landing point in the first image area relative to the reference black body curve; and determining a reference white area range of the first image area from the reference black body curve based on a degree of deviation of the color temperature limit information of the first image area from the reference black body curve.

[0046] Using the above method for large-area red and green scenes, the landing point information of the white balance data in the pure color area of ​​the pure color scene can be counted, and the area can be directly deducted as an invalid white balance landing point area. However, for large-area blue and yellow scenes, the landing point of the white balance data in the pure color area will still be highly overlapped with the landing point of some color temperature gray areas.

[0047] S130: Determine a white balance gain used for white balancing the first image area based on a positional relationship between a target white balance point in the second image area and a reference black body curve.

[0048] For the first image area, regardless of whether the reference white area range is used to exclude white balance points represented by some abnormal white balance gain values ​​in the first image area, when the first image area is in a large area of ​​blue and yellow scene (such as a pure color scene with yellow and blue), the white balance points in the pure color area still exist in the designated white area, resulting in inaccurate white balance.

[0049] To this end, the target white balance landing point in the second image area can be counted, and the coordinate point represented by the red component channel gain and the blue component channel gain of the white balance gain corresponding to the target white balance landing point in the second image area can be determined, and then the positional relationship between the target white balance landing point and the reference black body curve can be calculated in the coordinate system represented by the red component channel gain and the blue component channel gain. The white balance gain is corrected according to the positional relationship between the white balance landing point and the reference black body curve, thereby solving the problem of being unable to improve the white balance color cast in large-area blue and yellow scenes.

[0050] The technical solution of the embodiment of the present invention determines a reference blackbody curve by fitting white balance landing points characterized by different reference white balance gains and represented as white points, and determines a target white balance landing point of a second image area in a first image area, and corrects the white balance gain of the second image area by calculating the positional relationship between the target white balance landing point and the reference blackbody curve in the second image area. This can improve the white balance color cast problem in large-area blue and yellow scenes, thereby improving the accuracy of the automatic white balance algorithm, and ensuring that the picture does not have color cast while keeping the algorithm complexity as low as possible and having little impact on performance.

[0051] Figure 4 A flow chart of another white balance processing method is provided for an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of determining the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance point and the reference blackbody curve in the second image area in the above embodiment. This embodiment can be combined with various optional schemes in one or more of the above embodiments.

[0052] like Figure 4 As shown, the white balance processing method of this embodiment may include the following processes:

[0053] S410. Determine a reference blackbody curve used in the first image area, where the reference blackbody curve is obtained by fitting white balance points characterized by different reference white balance gains and represented as white points, where the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources of different color temperatures are used to illuminate a reference target.

[0054] S420: Determine a target white balance landing point of a second image area in the first image area, where the second image area is a sub-image area obtained by dividing the first image area.

[0055] S430: Determine a white balance point circumscribed rectangle that can accommodate each target white balance point in the second image area.

[0056] As an optional but non-limiting implementation, determining a white balance point circumscribed rectangle that can accommodate each target white balance point of the second image area may include steps B1-B2:

[0057] Step B1: determining the white balance point distribution state of each target white balance point in the second image area according to the position of each target white balance point in the second image area.

[0058] Step B2: If the white balance point distribution state of the second image area satisfies the preset point distribution state, a white balance point circumscribed rectangle of the target white balance point of the second image area is determined. The preset point distribution state includes that each target white balance point is clustered in a strip-like distribution or each target white balance point is clustered to form two white balance point clusters and the number of target white balance points in the two white balance point clusters is greater than a preset number value. The white balance point circumscribed rectangle is used to accommodate the target white balance points distributed in a strip-like distribution or to accommodate the target white balance points in a single white balance point cluster distributed in two white balance point clusters.

[0059] For each second image area in the first image area, the positions of each target white balance landing point of each second image area relative to the coordinate system of the reference blackbody curve can be counted, and then the white balance landing point distribution of each target white balance landing point of each second image area can be determined.

[0060] According to the white balance point distribution of each target white balance point in the second image area, it can be determined whether each target white balance point is distributed in a band or distributed in two white balance point clusters and the number of target white balance points in the two white balance point clusters is greater than a preset number value. The parameter of the preset number value N is adjusted based on the m*n second image areas demarcated by the first image area.

[0061] Optionally, when the target white balance points are distributed in a band shape, a white balance point circumscribed rectangle that can accommodate the target white balance points of the second image area can be directly calculated according to the band distribution, and the white balance point circumscribed rectangle is the minimum circumscribed rectangular frame that can accommodate the target white balance points of the second image area.

[0062] Optionally, when each target white balance point presents two white balance point cluster distributions, based on the principle that all white balance points are contained in the scope of the circumscribed rectangle determined by subsequent calculation, the circumscribed rectangle acquisition process specifically includes: respectively calculating two medians C1 and C2 corresponding to the outer edge polygons of the two white balance point clusters; fitting the corresponding finite curve f(xc) through the two medians C1 and C2; extending the finite curve according to the current positions and areas of the two white balance point clusters, and the extended distance is the radius r1 and r2 of the circumscribed circle corresponding to the white balance point cluster area where the finite curve is located; calculating the two medians C1 and C2 of the extended finite curve f(xc) The tangent line between the endpoint value and the white balance point cluster where it is located can be represented as f1(xc) and f2(xc); the finite curve f(xc) is extended by translation up and down respectively, and the moving distance is the maximum value rmax of the radius of the circumscribed circle of the two white balance point clusters, where: rmax=max(r1,r2), until the moved curve is tangent to the circumscribed circle corresponding to the two white balance point clusters, and the finite curves after the movement are fl(xc) and fh(xc); the four curves f1(xc), f2(xc) and fl(xc), fh(xc) are combined, and the rectangle formed by the intersection of the above four curves is used as the circumscribed rectangle of the two white balance point clusters. See Figure 5a and Figure 5b It shows a large area of ​​blue and yellow scenes and the distribution of falling points. Figure 5a This is the distribution of white balance points (low color temperature 3700K) for large-area blue scenes. Figure 5b The figure shows the distribution of white balance points (high color temperature 7340K) for a large area of ​​yellow scene.

[0063] S440: Determine a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points, where the target color temperature difference is the maximum value of the color temperature difference between each target white balance point within the circumscribed rectangle of the white balance points.

[0064] As an optional but non-limiting implementation, determining the target color temperature difference between target white balance points within the circumscribed rectangle of the white balance points may include steps C1-C3:

[0065] Step C1, based on the reference blackbody curve, determine the reference color temperature of the target white balance point of the second image area, the reference color temperature is the orthogonal line from the target white balance point of the second image area to the reference blackbody curve, and the color temperature corresponding to the white balance point represented by the reference white balance gain on the reference blackbody curve that intersects the reference blackbody curve.

[0066] Step C2: determining a maximum reference color temperature and a minimum reference color temperature from the reference color temperatures of the target white balance points of the second image area.

[0067] Step C3: determining a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points based on the maximum reference color temperature and the minimum reference color temperature.

[0068] S450: If the target color temperature difference is greater than the preset color temperature difference, determine the shortest distances from two target white balance points that can form the target color temperature difference to the reference blackbody curve.

[0069] The target color temperature difference CTdiff between the maximum color temperature CTh and the minimum color temperature CTl is determined from the reference color temperature of the target white balance point of the second image area. When the target color temperature difference CTdiff is greater than the preset color temperature difference CTtheo, it can be considered that the captured second image area may be in a large area of ​​yellow and blue scene. Among them, the default value of the preset color temperature difference CTtheo is set to 3000K, and is adjusted according to the color temperature range used by the device for image area acquisition. Then, the shortest distance values ​​dh and dl from the white balance point corresponding to the maximum color temperature CTh and the white balance point corresponding to the minimum color temperature CTl to the black body curve can be calculated respectively.

[0070] S460: Determine a white balance gain used for white balancing the first image area according to the shortest distances from the two target white balance points to the reference black body curve.

[0071] As an optional but non-limiting implementation, determining the white balance gain used for white balancing the first image area according to the shortest distances from the two target white balance points to the reference black body curve may include steps D1-D2:

[0072] Step D1: Determine the weighted coefficients of white balance gains corresponding to the two target white balance points according to the shortest distances from the two target white balance points to the reference black body curve.

[0073] Step D2: weighting the white balance gains corresponding to the two target white balance points according to the weighting coefficients of the white balance gains corresponding to the two target white balance points to obtain the white balance gain used for white balancing the first image area.

[0074] After calculating the shortest distance values ​​dh and dl between the white balance point corresponding to the maximum color temperature CTh and the white balance point corresponding to the minimum color temperature CTl and the blackbody curve, the weighted calculation coefficient value α is calculated using the shortest distance values ​​dh and dl, and its value range is [0,1].

[0075] The weighted coefficients α and β of the white balance gain corresponding to the two target white balance points are calculated as follows: α=1-dh / (dh+dl), and the corresponding weighted calculation coefficient value β is set to have a certain relationship with the coefficient α. The default relationship between the two parameters is: α+β=1.

[0076] The weighted coefficients α and β of the white balance gain corresponding to the two target white balance points are respectively weighted with CTh(rgcth, bgcth) and CTl(rgctl, bgctl) to obtain the white balance gain value A(rg′, bg′) used in the first image area in the current scene. The specific calculation method is as follows:

[0077] rg′=α*rgcth+β*rgctl;

[0078] bg′=α*bgcth+β*bgctl;

[0079] The weighting coefficient is calculated through the positional relationship between the two color temperature values ​​and the blackbody curve. The original white balance gain value can be calculated again based on the weighting coefficients α and β to achieve the purpose of re-screening the effective white balance gain value point, and then the final white balance gain value is calculated and obtained.

[0080] The technical solution of the embodiment of the present invention determines the reference black body curve obtained by fitting the white balance landing point characterized by different reference white balance gains and represented as a white point, and determines the target white balance landing point of the second image area in the first image area. By calculating the positional relationship between the target white balance landing point and the reference black body curve in the second image area, the white balance gain of the second image area is corrected, which can improve the white balance color cast problem in large-area blue and yellow scenes, thereby improving the accuracy of the automatic white balance algorithm, and ensuring that the picture does not have color cast when the algorithm complexity is low and the performance has little impact. Specifically, the weighting coefficient is calculated by the positional relationship between the two color temperature values ​​and the black body curve, and the weighting coefficient is combined with the white balance gain values ​​of the two color temperature points for calculation. The purpose of re-screening the white balance landing point and re-optimizing the white balance gain value is achieved by the joint calculation, and then the final white balance gain value is calculated.

[0081] Figure 6 This is a schematic diagram of the structure of a white balance processing device provided in an embodiment of the present invention. The embodiment of the present disclosure is suitable for correcting the white balance gain of an image area with a large area of ​​blue or yellow pure color scenes. The device can be implemented in the form of software and / or hardware. The white balance processing device can be configured in any electronic device with a network communication function, which can be a mobile terminal, a PC or a server, etc.

[0082] like Figure 1 As shown, the white balance processing device of this embodiment includes: a first determination module 610, a second determination module 620 and a third determination module 630

[0083] A first determination module 610 is used to determine a reference black body curve used in the first image area, where the reference black body curve is obtained by fitting white balance points characterized by different reference white balance gains and represented as white points, where the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources with different color temperatures are used to illuminate a reference target;

[0084] A second determination module 620 is used to determine a target white balance landing point of a second image area in the first image area, where the second image area is a sub-image area obtained by dividing the first image area;

[0085] The third determination module 630 is used to determine the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance point in the second image area and the reference black body curve.

[0086] Based on the above embodiment, optionally, determining a target white balance landing point of the second image area in the first image area includes:

[0087] Determine a reference white area range of the first image area from the reference black body curve;

[0088] Eliminating some abnormal white balance points in the first image region according to the reference white area range, wherein the white balance points are coordinate points represented by the red component channel gain and the blue component channel gain of the white balance gain corresponding to the pixels in the image region;

[0089] After some white balance points included in the first image area are eliminated, the remaining white balance points in the second image area are determined as target white balance points.

[0090] Based on the above embodiment, optionally, determining a reference white area range of the first image area from the reference black body curve includes:

[0091] Determining color temperature restriction information of the first image area, wherein the color temperature restriction information includes a color temperature range of a use environment of a device for performing white balance processing;

[0092] Determining the degree of deviation of each white balance point in the first image area relative to the reference blackbody curve;

[0093] According to the degree of deviation between the color temperature limit information of the first image area and the reference black body curve, a reference white area range of the first image area is determined from the reference black body curve.

[0094] Based on the above embodiment, optionally, determining a white balance gain used for white balancing the first image area based on a positional relationship between a target white balance point of the second image area and the reference blackbody curve includes:

[0095] Determine a white balance landing point circumscribed rectangle that can accommodate each target white balance landing point of the second image area;

[0096] Determine a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points, wherein the target color temperature difference is a maximum value of color temperature differences between target white balance points within a circumscribed rectangle of the white balance points;

[0097] If the target color temperature difference is greater than the preset color temperature difference, determining the shortest distances from two target white balance points that can form the target color temperature difference to the reference blackbody curve;

[0098] A white balance gain used for white balancing the first image area is determined according to the shortest distances from the two target white balance points to the reference black body curve.

[0099] Based on the above embodiment, optionally, determining a white balance point circumscribed rectangle that can accommodate each target white balance point of the second image area includes:

[0100] Determining a white balance point distribution state of each target white balance point in the second image area according to the position of each target white balance point in the second image area;

[0101] If the white balance point distribution state of the second image area satisfies a preset point distribution state, a white balance point circumscribed rectangle of the target white balance point of the second image area is determined, wherein the preset point distribution state includes that each target white balance point is clustered in a strip-like distribution or each target white balance point is clustered to form two white balance point clusters and the number of target white balance points in the two white balance point clusters is greater than a preset number value, and the white balance point circumscribed rectangle is used to accommodate the target white balance points distributed in a strip-like distribution or to accommodate the target white balance points in a single white balance point cluster distributed in two white balance point clusters.

[0102] Based on the above embodiment, optionally, determining a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points includes:

[0103] Based on the reference blackbody curve, determine a reference color temperature of a target white balance point in the second image area, where the reference color temperature is a color temperature corresponding to a white balance point represented by a reference white balance gain on a reference blackbody curve that intersects an orthogonal line from the target white balance point in the second image area to the reference blackbody curve;

[0104] Determining a maximum reference color temperature and a minimum reference color temperature from the reference color temperatures of the target white balance points of the second image area;

[0105] A target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points is determined based on the maximum reference color temperature and the minimum reference color temperature.

[0106] Based on the above embodiment, optionally, determining a white balance gain used for white balancing the first image area according to the shortest distances from the two target white balance points to the reference black body curve respectively includes:

[0107] Determine weighted coefficients of white balance gains corresponding to the two target white balance points according to the shortest distances from the two target white balance points to the reference blackbody curve;

[0108] According to the weighting coefficients of the white balance gains corresponding to the two target white balance points, weighted processing is performed on the white balance gains corresponding to the two target white balance points to obtain the white balance gain used for white balancing the first image area.

[0109] The technical solution of the embodiment of the present invention, when performing white balance on the first image area, determines the reference black body curve obtained by fitting the white balance landing point characterized by different reference white balance gains and represented as a white point, and determines the target white balance landing point of the second image area in the first image area, the second image area is a sub-image area obtained by dividing the first image area, and then determines the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance landing point and the reference black body curve in the second image area. In this case, the white balance gain can be corrected by the positional relationship between the white balance landing point and the reference black body curve that meet the preset conditions, which can improve the white balance color cast problem in large-area blue and yellow scenes, thereby improving the accuracy of the automatic white balance algorithm, and ensuring that the picture does not have color cast as much as possible under the condition that the algorithm complexity is low and the performance is less affected.

[0110] The white balance processing device provided in the embodiment of the present invention can execute the white balance processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of executing the white balance processing method.

[0111] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0112] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0113] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0114] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0115] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a white balance processing method.

[0116] In some embodiments, the white balance processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the white balance processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the white balance processing method in any other appropriate manner (e.g., by means of firmware).

[0117] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0118] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0119] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0121] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0122] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0123] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0124] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A white balance processing method, characterized in that: The method comprises: Determine a reference blackbody curve used in the first image area, where the reference blackbody curve is obtained by fitting white balance drop points characterized by different reference white balance gains and represented as white points, where the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources with different color temperatures are used to illuminate a reference target; Determine a target white balance landing point of a second image area within the first image area, where the second image area is a sub-image area obtained by dividing the first image area; Based on the positional relationship between the target white balance point in the second image area and the reference blackbody curve, a white balance gain used for white balancing the first image area is determined.

2. The method according to claim 1, characterized in that Determining a target white balance landing point of a second image area in the first image area includes: Determine a reference white area range of the first image area from the reference black body curve; Eliminating some abnormal white balance points in the first image region according to the reference white area range, wherein the white balance points are coordinate points represented by the red component channel gain and the blue component channel gain of the white balance gain corresponding to the pixels in the image region; After some white balance points included in the first image area are eliminated, the remaining white balance points in the second image area are determined as target white balance points.

3. The method according to claim 2, characterized in that Determining a reference white area range of the first image area from the reference black body curve includes: Determining color temperature restriction information of the first image area, wherein the color temperature restriction information includes a color temperature range of a use environment of a device for performing white balance processing; Determining the degree of deviation of each white balance point in the first image area relative to the reference blackbody curve; According to the degree of deviation between the color temperature limit information of the first image area and the reference black body curve, a reference white area range of the first image area is determined from the reference black body curve.

4. The method according to claim 1 or 2, characterized in that: Determining a white balance gain used for white balancing the first image area based on a positional relationship between a target white balance point of the second image area and the reference blackbody curve includes: Determine a white balance landing point circumscribed rectangle that can accommodate each target white balance landing point of the second image area; Determine a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points, wherein the target color temperature difference is a maximum value of color temperature differences between target white balance points within a circumscribed rectangle of the white balance points; If the target color temperature difference is greater than the preset color temperature difference, determining the shortest distances from two target white balance points that can form the target color temperature difference to the reference blackbody curve; A white balance gain used for white balancing the first image area is determined according to the shortest distances from the two target white balance points to the reference black body curve.

5. The method according to claim 4, characterized in that Determining a white balance point circumscribed rectangle that can accommodate each target white balance point in the second image area includes: Determining a white balance point distribution state of each target white balance point in the second image area according to the position of each target white balance point in the second image area; If the white balance point distribution state of the second image area satisfies a preset point distribution state, a white balance point circumscribed rectangle of the target white balance point of the second image area is determined, wherein the preset point distribution state includes that each target white balance point is clustered in a strip-like distribution or each target white balance point is clustered to form two white balance point clusters and the number of target white balance points in the two white balance point clusters is greater than a preset number value, and the white balance point circumscribed rectangle is used to accommodate the target white balance points distributed in a strip-like distribution or to accommodate the target white balance points in a single white balance point cluster distributed in two white balance point clusters.

6. The method according to claim 4, characterized in that Determining a target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points includes: Based on the reference blackbody curve, determine a reference color temperature of a target white balance point in the second image area, where the reference color temperature is a color temperature corresponding to a white balance point represented by a reference white balance gain on a reference blackbody curve that intersects an orthogonal line from the target white balance point in the second image area to the reference blackbody curve; Determining a maximum reference color temperature and a minimum reference color temperature from the reference color temperatures of the target white balance points of the second image area; A target color temperature difference between target white balance points within a circumscribed rectangle of the white balance points is determined based on the maximum reference color temperature and the minimum reference color temperature.

7. The method according to claim 4, characterized in that Determining a white balance gain used for white balancing the first image area according to the shortest distances from the two target white balance points to the reference black body curve, including: Determine weighted coefficients of white balance gains corresponding to the two target white balance points according to the shortest distances from the two target white balance points to the reference blackbody curve; According to the weighting coefficients of the white balance gains corresponding to the two target white balance points, weighted processing is performed on the white balance gains corresponding to the two target white balance points to obtain the white balance gain used for white balancing the first image area.

8. A white balance processing device, characterized in that: The device comprises: A first determination module is used to determine a reference black body curve used in the first image area, wherein the reference black body curve is obtained by fitting white balance drop points characterized by different reference white balance gains and represented as white points, wherein the different reference white balance gains are white balance gains corresponding to different color temperatures calibrated when light sources with different color temperatures are used to illuminate a reference target; A second determination module is used to determine a target white balance landing point of a second image area in the first image area, where the second image area is a sub-image area obtained by dividing the first image area; The third determination module is used to determine the white balance gain used for white balancing the first image area based on the positional relationship between the target white balance point in the second image area and the reference black body curve.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the white balance processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the white balance processing method according to any one of claims 1 to 7 when executed.

Citation Information

Patent Citations

  • Image white balance processing method and device

    CN105872510A

  • White balance adjustment method and system, white balance terminal and storage medium

    CN114222105A

  • Image white balance processing method and electronic equipment

    CN115334295A

  • Automatic white balance

    EP3188481A1

  • White balance processing method, electronic device and computer readable storage medium

    EP3477943A1