Image processing method, device, storage medium and electronic device

By judging the target monochrome conditions in image processing, calculating the pixel gain value and color temperature value, and using the standard color card to correct the image, the problem of white balance algorithm failure in large-area monochrome scenes is solved, and the accuracy and effect of image processing are improved. .

CN118175274BActive Publication Date: 2024-09-06CHANGXING JIRUI INTELLIGENT SYSTEMS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410602309.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-09-06
Estimated Expiration
2044-05-15

AI Technical Summary

Technical Problem

When the existing technology processes large-area monochrome scenes, the white balance algorithm lacks an effective white point or gray point reference, resulting in inaccurate color temperature determination, which in turn causes image color cast and affects the processing effect.

Method used

By obtaining multiple pixel values ​​in the image, it is determined whether the target monochrome condition is met, and the matching pixel gain value and target color temperature value are calculated. The correction coefficient is determined according to the standard color card to process the image to ensure color accuracy.

Benefits of technology

It effectively solves the color cast problem in image processing of large-area monochrome scenes and improves the accuracy and effect of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118175274B
    Figure CN118175274B
Patent Text Reader

Abstract

The present application discloses an image processing method, device, storage medium and electronic device. The method includes: obtaining a current image and pixel values ​​corresponding to each of the multiple pixels in the current image; determining that the current image is an image to be processed that meets the target monochrome condition according to the pixel values ​​corresponding to each of the multiple pixels, obtaining a pixel gain value that matches the image to be processed; determining the target color temperature value corresponding to the image to be processed according to the pixel gain value, and obtaining a target correction coefficient according to the target color temperature value; processing the pixel values ​​corresponding to each of the multiple pixels in the image to be processed according to the target correction coefficient to obtain the target image. The present application solves the technical problem that the related image processing methods cannot process large-area monochrome scenes and have poor image processing effects.
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, and in particular, to an image processing method, device, storage medium and electronic device. Background Art

[0002] The commonly used white balance technology now calculates the color temperature value and Rgain, Ggain, and Bgain values ​​of the current picture based on the presence of white spots or gray spots in the scene. However, in actual use, there will be scenes with a single color without any white spots or gray spots. In this case, the traditional white balance algorithm cannot work and cannot calculate the accurate color temperature value and Rgain, Ggain, and Bgain parameters.

[0003] The principle of white balance is to determine the gain coefficient of the three channels of RGB (Red Green Blue) based on the color temperature of the light source in the environment, and amplify the value of the pixel in the three channels of RGB according to the gain coefficient, so that the color of the generated image is closer to the real color. Therefore, the color temperature of the ambient light source needs to be determined before the white balance process, and the accuracy of the color temperature determination of the ambient light source has an important impact on the quality of white balance. The color temperature of the ambient light source needs to be determined based on the pixels in the image taken when taking pictures. Usually, some key points are selected from the pixels of the image to determine the color temperature of the ambient light source.

[0004] That is to say, when the color of the environment is relatively single, the color of the entire picture of the image obtained by shooting the environment is relatively single. Therefore, the key points determined from the image are usually invalid reference points, which makes the color temperature of the ambient light source determined during the white balance processing inconsistent with the actual color temperature, resulting in poor effect when performing white balance based on the determined color temperature, and further causing the final generated image to have a color cast phenomenon, that is, there is a technical problem in the prior art that the processing effect of large-area monochrome scene images is poor. Summary of the invention

[0005] The embodiments of the present application provide an image processing method, device, storage medium and electronic device to at least solve the technical problem of poor processing effect of large-area monochrome scene images in the related art.

[0006] According to one aspect of an embodiment of the present application, an image processing method is provided, comprising: obtaining a current image, and pixel values ​​corresponding to each of a plurality of pixels in the current image; determining, based on the pixel values ​​corresponding to each of the plurality of pixels, that the current image is an image to be processed that satisfies a target monochrome condition, obtaining a pixel gain value that matches the image to be processed, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; determining a target color temperature value corresponding to the image to be processed based on the pixel gain value, and obtaining a target correction coefficient based on the target color temperature value, wherein the target correction coefficient is a value determined based on a standard color card under the target color temperature indicated by the target color temperature value; processing the pixel values ​​corresponding to each of the plurality of pixels in the image to be processed based on the target correction coefficient to obtain a target image.

[0007] According to another aspect of an embodiment of the present application, an image processing device is further provided, including: an acquisition unit, which acquires a current image and pixel values ​​corresponding to each of a plurality of pixels in the current image; a first determination unit, which determines, based on the pixel values ​​corresponding to each of the plurality of pixels, that the current image is an image to be processed that satisfies a target monochrome condition, and acquires a pixel gain value that matches the image to be processed, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; a second determination unit, which determines a target color temperature value corresponding to the image to be processed based on the pixel gain value, and acquires a target correction coefficient based on the target color temperature value, wherein the target correction coefficient is a value determined based on a standard color card under a target color temperature indicated by the target color temperature value; and a processing unit, which processes the pixel values ​​corresponding to each of the plurality of pixels in the image to be processed based on the target correction coefficient to obtain a target image.

[0008] As an optional solution, the above-mentioned image processing device also includes: a first acquisition unit, used to acquire a reference coefficient group corresponding to the above-mentioned target monochrome condition, wherein the above-mentioned reference coefficient group includes reference coefficients corresponding to multiple color temperature values ​​respectively, and the multiple reference coefficients are determined by reference pixel gain values ​​respectively measured under multiple corresponding color temperature conditions according to a target color card matching the above-mentioned target monochrome condition; when the gain coefficient determined according to the above-mentioned pixel gain value matches the target coefficient in the above-mentioned reference coefficient group, the above-mentioned target color temperature value corresponding to the above-mentioned target coefficient is determined as the color temperature value corresponding to the above-mentioned image to be processed; the above-mentioned target correction coefficient is acquired according to the above-mentioned target color temperature value, wherein the above-mentioned target correction coefficient is determined by the target pixel gain value measured under the above-mentioned target color temperature condition indicated by the above-mentioned target color temperature value according to the above-mentioned standard color card, and the above-mentioned target pixel gain value includes a target red gain value, a target green gain value and a target blue gain value.

[0009] As an optional solution, the first acquisition unit includes: a second acquisition unit, used to acquire a first ratio between the red gain value and the green gain value in the pixel gain value, and a second ratio between the blue gain value and the green gain value in the pixel gain value; and determine the first ratio and the second ratio as the gain coefficient.

[0010] As an optional solution, the first acquisition unit includes: a third determination module, which is used to acquire a first color temperature value sequence, wherein the first color temperature value sequence includes N first color temperature values, and the N is an integer greater than 1; acquire the N first pixel gain values ​​respectively measured by the target color card under the color temperature environment corresponding to the N first color temperature values; use a third ratio between a first red gain value and a first green gain value in the first pixel gain values, and a fourth ratio between a first blue gain value and a first green gain value in the first pixel gain values ​​as the first gain coefficient corresponding to the first color temperature value; acquire a second color temperature value sequence matching the first color temperature value sequence, wherein the second color temperature value sequence includes M second color temperature values, and the M is an integer greater than 1; determine a plurality of second gain coefficients by a target interpolation function according to the second color temperature value sequence and the plurality of first gain coefficients; and determine the reference coefficient group according to the first gain coefficient and the plurality of second gain coefficients.

[0011] As an optional solution, the first acquisition unit includes: a first processing module, used to acquire a reference pixel value of a reference pixel in the image to be processed; using a first ratio in the target correction coefficient as a first correction magnification of a red channel value in the reference pixel value, and using a second ratio in the target correction coefficient as a second correction magnification of a blue channel value in the reference pixel value, wherein the target correction coefficient includes the first ratio between a target red gain value and a target green gain value, and the second ratio between a target blue gain value and the target green gain value, and the target red gain value, the target blue gain value and the target green gain value are measured according to the standard color card under the target color temperature condition indicated by the target color temperature value; determining an updated red channel value according to a product of the first correction magnification and the red channel value, and determining an updated blue channel value according to a product of the second correction magnification and the blue channel value; and determining the target pixel value of the reference pixel according to the updated red channel value and the updated blue channel value.

[0012] As an optional scheme, the above-mentioned first acquisition unit is also used to: obtain the corresponding reference pixel values ​​in the reference color space according to the above-mentioned pixel values ​​corresponding to each of the above-mentioned pixels; obtain the color attributes corresponding to the above-mentioned pixels according to the numerical range corresponding to the above-mentioned reference pixel values, wherein each of the above-mentioned numerical ranges corresponds to one of the above-mentioned color attributes; when the number of pixels corresponding to the target color attribute is greater than or equal to the target number, determine that the above-mentioned current image is the above-mentioned image to be processed that meets the above-mentioned target monochrome condition.

[0013] As an optional scheme, the above-mentioned device also includes: a fourth determination unit, which is used to determine that the above-mentioned current image satisfies the above-mentioned target monochrome condition according to the above-mentioned pixel values ​​corresponding to each of the above-mentioned multiple pixels when the above-mentioned current image is an image frame in the target video sequence; and when the above-mentioned current image is the Lth above-mentioned image frame that continuously satisfies the above-mentioned target monochrome condition in the above-mentioned target video sequence, determine that the above-mentioned current image is the above-mentioned image to be processed, wherein the above-mentioned L is an integer greater than J, and the above-mentioned J is an integer greater than or equal to 1.

[0014] As an optional scheme, the above-mentioned fourth determination unit is also used to: obtain a target statistical coefficient matching the above-mentioned target monochrome condition; perform self-increment processing on the above-mentioned target statistical coefficient to obtain the updated above-mentioned target statistical coefficient; obtain a reference statistical coefficient matching the reference monochrome condition; perform self-decrement processing on the above-mentioned reference statistical coefficient to obtain the updated above-mentioned reference statistical coefficient.

[0015] As an optional scheme, the above-mentioned fourth determination unit is also used to: determine that the above-mentioned current image does not meet the above-mentioned target monochrome condition based on the above-mentioned pixel values ​​corresponding to each of the above-mentioned multiple pixels; obtain the target statistical coefficient matching the above-mentioned target monochrome condition, and perform self-decrement processing on the above-mentioned target statistical coefficient to obtain the updated above-mentioned target statistical coefficient; when the above-mentioned current image meets the reference monochrome condition, obtain the reference statistical coefficient matching the above-mentioned reference monochrome condition; perform self-increment processing on the above-mentioned reference statistical coefficient to obtain the updated above-mentioned reference statistical coefficient.

[0016] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above image processing method.

[0017] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the image processing method through the computer program.

[0018] In the above-mentioned embodiment of the present application, a current image and pixel values ​​corresponding to each of a plurality of pixels in the current image are obtained; when it is determined according to the pixel values ​​corresponding to each of the plurality of pixels that the current image is an image to be processed that satisfies a target monochrome condition, a pixel gain value matching the image to be processed is obtained, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; a target color temperature value corresponding to the image to be processed is determined according to the pixel gain value, and a target correction coefficient is obtained according to the target color temperature value, wherein the target correction coefficient is a value determined according to a standard color card under a target color temperature indicated by the target color temperature value; and the pixel values ​​corresponding to each of the plurality of pixels in the image to be processed are processed according to the target correction coefficient to obtain a target image.

[0019] Through the above-mentioned implementation mode of the present application, the current image and the pixel values ​​corresponding to each of the multiple pixels in the current image are obtained, and then according to the pixel values ​​corresponding to each of the multiple pixels, when it is determined that the current image is an image to be processed that meets the target monochrome condition, a pixel gain value matching the image to be processed is obtained, and the target color temperature value corresponding to the image to be processed is determined based on the corresponding relationship between the pixel gain value and the color temperature, and the target correction coefficient is obtained, and the pixel values ​​corresponding to the multiple pixels in the image to be processed are further processed according to the target correction coefficient, thereby solving the technical problem that the existing method of processing large-area monochrome scene images has color cast, which leads to poor processing effect of large-area monochrome scene images. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 is a schematic diagram of an application environment of an optional image processing method according to an embodiment of the present application;

[0022] Figure 2 is a flowchart of an optional image processing method according to an embodiment of the present application;

[0023] Figure 3 is a flowchart of another optional image processing method according to an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of an optional image processing method according to an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0026] Figure 6 is a flowchart of another optional image processing method according to an embodiment of the present application;

[0027] Figure 7 is a flowchart of another optional image processing method according to an embodiment of the present application;

[0028] Figure 8 is a schematic diagram of an image processing device according to an embodiment of the present application;

[0029] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] According to one aspect of the embodiments of the present application, an image processing method is provided. Optionally, as an optional implementation, the image processing method can be but is not limited to being applied to Figure 1 In the environment shown, it may include but is not limited to a vehicle terminal 102 and a server 104, the vehicle terminal 102 may include but is not limited to a display, a processor and a memory, and the server 104 includes a database and a processing engine.

[0033] The specific process can be as follows:

[0034] Step S102, the server 104 sends an image processing instruction to the vehicle terminal 102 via the network 110;

[0035] Steps S104-S110, obtaining a current image and pixel values ​​corresponding to each of a plurality of pixels in the current image; determining, based on the pixel values ​​corresponding to each of the plurality of pixels, that the current image is an image to be processed that satisfies a target monochrome condition, obtaining a pixel gain value that matches the image to be processed, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; determining a target color temperature value corresponding to the image to be processed based on the pixel gain value, and obtaining a target correction coefficient based on the target color temperature value, wherein the target correction coefficient is a value determined based on a standard color card under a target color temperature indicated by the target color temperature value; processing the pixel values ​​corresponding to each of the plurality of pixels in the image to be processed based on the target correction coefficient to obtain a target image.

[0036] remove Figure 1 In addition to the examples shown, the above steps can be completed independently by the vehicle terminal or the server, or by the vehicle terminal and the server working together, such as the vehicle terminal 102 directly obtaining the conversion instruction set, thereby reducing the processing pressure of the server 104. The present application does not limit the specific implementation of the vehicle terminal 102. The server 104 can be a single server or a server cluster composed of multiple servers, or a cloud server.

[0037] As an optional implementation, Figure 2 As shown, the image processing method can be executed by an electronic device, such as Figure 1 The user device or server shown in the figure comprises:

[0038] S202, obtaining a current image and pixel values ​​corresponding to a plurality of pixels in the current image;

[0039] S204, when it is determined that the current image is an image to be processed that satisfies a target monochrome condition according to pixel values ​​corresponding to each of the plurality of pixels, a pixel gain value matching the image to be processed is obtained, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value;

[0040] S206, determining a target color temperature value corresponding to the image to be processed according to the pixel gain value, and obtaining a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is a value determined by a standard color card at a target color temperature indicated by the target color temperature value;

[0041] S208, processing pixel values ​​corresponding to a plurality of pixels in the image to be processed respectively according to the target correction coefficient to obtain a target image.

[0042] In S202 of the above embodiment, the current image and the pixel values ​​corresponding to the multiple pixels in the current image are obtained. As an optional embodiment, the R, G, and B data of the pixel values ​​are directly obtained based on the image processing platform. This is only an example and does not specifically limit the method of obtaining the pixel values ​​in the image.

[0043] Further, in the above step S204, it is determined whether the above current image satisfies the target monochrome condition according to the pixel values ​​corresponding to the multiple pixels in the current image, and the image to be processed that satisfies the target monochrome condition is determined. The target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to the target threshold. As an optional implementation, the target monochrome condition can be a large area monochrome or pure monochrome scene, which is not specifically limited here.

[0044] Then, a pixel gain value matching the image to be processed is obtained, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value. As an optional implementation, an ISP (image processing platform) can be used to obtain the R, G, and B values ​​of each pixel or pixel block. The red gain value Rgain=(R+G+B) / 3 / R, the green gain value Ggain=(R+G+B) / 3 / G, and the blue gain value Bgain=(R+G+B) / 3 / B. This is only an example, and no specific limitation is imposed on the method of obtaining and calculating the pixel gain values.

[0045] In the above step S206, the target color temperature value corresponding to the image to be processed is determined according to the pixel gain value. For example, when the (Rgain / Ggain, Bgain / Ggain) value is (1277, 2914), it represents the distribution of the blue scene at a color temperature of 3000K. It should be noted that the parameter values ​​in the above parameters are parameter values ​​obtained by further processing through the target magnification after obtaining the ratio of the actual gain value. For example, in this application, for the convenience of representation, the real values ​​of Rgain / Ggain and Bgain / Ggain are multiplied by 1000;

[0046] Further, the target correction coefficient is obtained according to the target color temperature value. As an optional implementation, a gray-white card with a certain pixel value ratio relationship can be placed in the same color temperature scene, and the (Rgain / Ggain, Bgain / Ggain) value of the gray-white card in the color temperature scene is obtained. The relationship between the (Rgain / Ggain, Bgain / Ggain) value of the actual gray-white card is calculated as (1, 1), and the multiples corresponding to the color temperature scene and the actual gray-white card Rgain and Bgain are obtained. The obtained multiples are used as the target correction coefficient of the image to be processed under the target color temperature value. This is only an example, and the method of obtaining the target correction coefficient of the image to be processed is not specifically limited;

[0047] In the above step S208, the pixel values ​​corresponding to the multiple pixels in the image to be processed are processed according to the target correction coefficient to obtain the target image; it should be noted that if the above image to be processed includes blue and non-blue parts, the same correction coefficient can be used to perform true value processing on the blue and non-blue parts. This is only an example without specific limitation.

[0048] Through the above-mentioned implementation mode of the present application, the current image and the pixel values ​​corresponding to the corresponding pixels in the current image are obtained, and then according to the pixel values ​​corresponding to each of the multiple pixels, when it is determined that the current image is an image to be processed that meets the target monochrome condition, a pixel gain value matching the image to be processed is obtained, and the target color temperature value corresponding to the image to be processed is determined based on the correspondence between the pixel gain value and the color temperature, and the target correction coefficient is obtained, and the pixel values ​​corresponding to the multiple pixels in the image to be processed are further processed according to the target correction coefficient, thereby solving the technical problem that the existing method of processing large-area monochrome scene images has color cast, which leads to poor processing effect of large-area monochrome scene images.

[0049] In an optional implementation, determining a target color temperature value corresponding to the image to be processed according to the pixel gain value, and obtaining a target correction coefficient according to the target color temperature value includes:

[0050] S1, obtaining a reference coefficient group corresponding to a target monochrome condition, wherein the reference coefficient group includes reference coefficients corresponding to a plurality of color temperature values, and the plurality of reference coefficients are determined by reference pixel gain values ​​respectively measured under a plurality of corresponding color temperature conditions according to a target color card matching the target monochrome condition;

[0051] S2, when the gain coefficient determined according to the pixel gain value matches the target coefficient in the reference coefficient group, determining the target color temperature value corresponding to the target coefficient as the color temperature value corresponding to the image to be processed;

[0052] S3, obtaining a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is determined by a target pixel gain value measured according to a standard color card under the target color temperature conditions indicated by the target color temperature value, and the target pixel gain value includes a target red gain value, a target green gain value, and a target blue gain value.

[0053] It can be understood that, in step S1, a reference coefficient group corresponding to the target monochrome condition is obtained, and the reference coefficient group includes reference coefficients corresponding to multiple color temperature values, respectively. The multiple reference coefficients are determined according to reference pixel gain values ​​respectively measured under multiple corresponding color temperature conditions according to a target color card matching the target monochrome condition. As an optional implementation, for example, the target monochrome condition is a blue scene, and the blue scene corresponds to multiple (Rgain / Ggain, Bgain / Ggain) values ​​at different color temperatures: (1070, 3855), / / 2800K; (1277, 2914), / / 3000K; (1593, 2070), / / 4000K; (1734, 1886), / / 5000K; (2089, 1636), / / 6000K; (2242, 1542), / / 7000K; (2328, 1469), / / 8000K; (2449, 1375), / / 10000K;

[0054] A plurality of (Rgain / Ggain, Bgain / Ggain) values ​​corresponding to different color temperatures may be used as the above-mentioned reference coefficient group, and Rgain / Ggain and Bgain / Ggain may be used as reference coefficients. It should be noted that Rgain, Ggain, and Bgain may be determined according to R, G, and B values, specifically Rgain=(R+G+B) / 3 / R, Ggain=(R+G+B) / 3 / G, and Bgain=(R+G+B) / 3 / B, or may be directly measured according to relevant equipment. No specific restriction is imposed on the method for obtaining the reference pixel gain value herein.

[0055] Further, in step S2, when the gain coefficient determined according to the pixel gain value matches the target coefficient in the reference coefficient group, the target color temperature value corresponding to the target coefficient is determined as the color temperature value corresponding to the image to be processed. As an optional implementation, for example, the obtained pixel gain value (Rgain / Ggain, Bgain / Ggain) is (1734, 1886). According to the above content, it can be known that it corresponds to (1734, 1886) / / 5000K, that is, the image to be processed is at a color temperature of 5000K, and 5000K color temperature is determined as the color temperature corresponding to the image to be processed.

[0056] In step S3, a target correction coefficient is obtained according to the target color temperature value. The target correction coefficient is determined by a target pixel gain value measured according to a standard color card under the target color temperature conditions indicated by the target color temperature value. The target pixel gain value includes a target red gain value, a target green gain value, and a target blue gain value. In an optional implementation, for example, in a blue scene with a color temperature of 5000K, the relationship between the measured R, G, B and the actual R1, G1, B1 is: R1=2R, G1=G, B1=3B. At this time, the target correction coefficient is (2,1,3). This is only an example and is not specifically limited.

[0057] Through the above-mentioned implementation mode of the present application, the current image and the pixel values ​​corresponding to the corresponding pixels in the current image are obtained, and then according to the pixel values ​​corresponding to each of the multiple pixels, when it is determined that the current image is an image to be processed that meets the target monochrome condition, a pixel gain value matching the image to be processed is obtained, and the target color temperature value corresponding to the image to be processed is determined based on the correspondence between the pixel gain value and the color temperature, and the target correction coefficient is obtained, and the pixel values ​​corresponding to the multiple pixels in the image to be processed are further processed according to the target correction coefficient, thereby solving the technical problem that the existing method of processing large-area monochrome scene images has color cast, which leads to poor processing effect of large-area monochrome scene images.

[0058] In an optional implementation, when the gain coefficient determined according to the pixel gain value matches the target coefficient in the reference coefficient group, before determining the target color temperature value corresponding to the target coefficient as the color temperature value corresponding to the image to be processed, the method includes:

[0059] S1, obtaining a first ratio between a red gain value and a green gain value in a pixel gain value, and a second ratio between a blue gain value and a green gain value in a pixel gain value;

[0060] S2, determining the first ratio and the second ratio as a gain coefficient.

[0061] It can be understood that, in the present embodiment, for example, the red gain value Rgain=(R+G+B) / 3 / R, the green gain value Ggain=(R+G+B) / 3 / G, the blue gain value Bgain=(R+G+B) / 3 / B, the first ratio between the red gain value and the green gain value is G / R, the second ratio between the blue gain value and the green gain value is G / B, and G / R and G / B are determined as gain coefficients, which is only an example and is not specifically limited;

[0062] Through the above implementation of the present application, a first ratio between the red gain value and the green gain value in the pixel gain value, and a second ratio between the blue gain value and the green gain value in the pixel gain value are obtained; and then the first ratio and the second ratio are determined as gain coefficients, so that the true value processing of the pixel can be directly performed through the gain coefficients, thereby improving the accuracy and efficiency of image processing.

[0063] In an optional implementation, before obtaining the reference coefficient group corresponding to the target monochromatic condition, the method includes:

[0064] S1, obtaining a first color temperature value sequence, wherein the first color temperature value sequence includes N first color temperature values, where N is an integer greater than 1;

[0065] S2, obtaining N first pixel gain values ​​respectively measured by the target color card under the color temperature environments corresponding to the N first color temperature values;

[0066] S3, using a third ratio between a first red gain value and a first green gain value in the first pixel gain value, and a fourth ratio between a first blue gain value and a first green gain value in the first pixel gain value, as first gain coefficients corresponding to the first color temperature value;

[0067] S4, obtaining a second color temperature value sequence matching the first color temperature value sequence, wherein the second color temperature value sequence includes M second color temperature values, where M is an integer greater than 1;

[0068] S5, determining a plurality of second gain coefficients by using a target interpolation function according to the second color temperature value sequence and the plurality of first gain coefficients;

[0069] S6, determining a reference coefficient group according to the first gain coefficient and a plurality of second gain coefficients.

[0070] It can be understood that in the above step S1, a first color temperature value sequence is obtained, and the first color temperature value sequence includes N first color temperature values, where N is an integer greater than 1, for example, the first color temperature sequence is 2800K, 3000K, 4000K, 5000K, 6000K, 7000K, and 10000K;

[0071] Further, in step S2, N first pixel gain values ​​respectively measured by the target color card under the color temperature environment corresponding to the N first color temperature values ​​are obtained, for example, Rgain, Ggain, and Bgain of blue under different color temperatures are obtained. It should be noted that multiple pixel points can be selected under the same color temperature to obtain Rgain, Ggain, and Bgain values ​​corresponding to the multiple pixel points, and then the discrete points are removed, and the average value of the points with relatively concentrated distribution is selected as the calibration value under the color temperature;

[0072] In step S3, a third ratio between a first red gain value and a first green gain value in the first pixel gain value, and a fourth ratio between a first blue gain value and a first green gain value in the first pixel gain value are used as first gain coefficients corresponding to the first color temperature value. For example, the (Rgain / Ggain, Bgain / Ggain) values ​​of blue at different color temperatures are: (1070, 3855), / / 2800K; (1277, 2914), / / 3000K; (1593, 2070), / / 4000K; (1734,1886), / / 5000K; (2089, 1636), / / 6000K; (2242, 1542), / / 7000K; (2449, 1375), / / 10000K;

[0073] In steps S4-S6, a second color temperature value sequence matching the first color temperature value sequence is obtained, wherein the second color temperature value sequence includes M second color temperature values, and M is an integer greater than 1; a plurality of second gain coefficients are determined by a target interpolation function according to the second color temperature value sequence and the plurality of first gain coefficients; a reference coefficient group is determined according to the first gain coefficient and the plurality of second gain coefficients; as an optional implementation, for example, the color temperatures corresponding to the second color temperature value sequence are: 2500K, 3500K, 4500K, 5500K, 6500K, 7500K, 10500K, and the second gain coefficients corresponding to the second color temperature sequence are further obtained according to the interpolation method, that is, (Rgain / Ggain, Bgain / Ggain) values, and the first gain coefficients corresponding to the color temperatures of all the first color temperature value sequences and the second gain coefficients corresponding to the second color temperature value sequences are used as the reference coefficient group;

[0074] Specifically, the RGB values ​​under unknown color temperature can be obtained by interpolation method by performing linear interpolation between known color temperature values. Assuming that the RGB values ​​of color temperature T are to be calculated, the RGB values ​​of known color temperatures T1 and T2 are R1, G1, B1 and R2, G2, B2 respectively. First, the interpolation weight w between T1 and T2 is calculated, and the formula is: w = (T - T1) / (T2 - T1). Then, according to the interpolation weight w, the new RGB values ​​are calculated: R = R1 + w * (R2 - R1), G = G1 + w * (G2 - G1), B = B1+ w * (B2 - B1), and then the Rgain, Ggain, Bgain, and (Rgain / Ggain, Bgain / Ggain) values ​​under different color temperatures can be obtained. This is only an example and no specific limitation is made to the above implementation manner.

[0075] Through the above-mentioned implementation mode of the present application, since the field of view of the lens is large, and there are dark corners and distortions, and some other points in the background are also captured, there will be some discrete points in the data distribution. In actual operation, these discrete points can be removed, and then the mean of these relatively concentrated points can be selected as the distribution representation of the blue scene at the color temperature, thereby obtaining more accurate data and improving the accuracy of image processing.

[0076] In an optional implementation, the above-mentioned processing of the pixel values ​​corresponding to the plurality of pixels in the image to be processed according to the target correction coefficient includes:

[0077] S1, obtaining a reference pixel value of a reference pixel in an image to be processed;

[0078] S2, using a first ratio in the target correction coefficient as a first correction magnification of a red channel value in a reference pixel value, and using a second ratio in the target correction coefficient as a second correction magnification of a blue channel value in a reference pixel value, wherein the target correction coefficient includes a first ratio between a target red gain value and a target green gain value, and a second ratio between a target blue gain value and a target green gain value, and the target red gain value, the target blue gain value, and the target green gain value are measured according to a standard color card under a target color temperature condition indicated by a target color temperature value;

[0079] S3, determining an updated red channel value according to the product of the first correction ratio and the red channel value, and determining an updated blue channel value according to the product of the second correction ratio and the blue channel value;

[0080] S4, determining a target pixel value of the reference pixel according to the updated red channel value and the updated blue channel value.

[0081] The above process is described in detail below as an optional implementation. For example, the pixel values ​​of the current blue image measured at a color temperature of 5000K are R1, B1, and G1, and the pixel values ​​of the grayscale card are r1, b1, and g1. Since the R, G, and B values ​​of the grayscale card have a relationship of R=G=B, Rgain=(R+G+B) / 3 / R, Ggain=(R+G+B) / 3 / G, and Bgain=(R+G+B) / 3 / B, then Rgain / Ggain and Bgain / Ggain are G / R and G / B, and G / R=1 and G / B=1 of the grayscale card.

[0082] That is to say, in the 5000K color temperature scene, the pixel values ​​in the actual grayscale card need to satisfy g1 / r1=1, g1 / b1=1, so r1*x=g1, b1*y=g1, that is, x=g1 / r1, y=g1 / b1, then x, y are the correction coefficients of the grayscale card at 5000K color temperature, which are also the correction coefficients of the blue color card at the same color temperature, that is to say, R2=x*R1, G2 remains unchanged, B2=y*B1 of the real blue color card at 5000K color temperature, which is only an example and is not specifically limited;

[0083] Through the above-mentioned implementation mode of the present application, according to the relationship between pixel points R=G=B in the grayscale card and the actual data under different color temperatures, the magnification of each channel is obtained, and this magnification is used as the magnification for true value processing of blue pixels under the same color temperature, thereby making the true value processing of large-area or full-area monochrome images under different color temperatures more scientific and accurate.

[0084] In an optional implementation, when the current image is determined to be an image to be processed that meets the target monochrome condition according to the pixel values ​​corresponding to the plurality of pixels, before obtaining the pixel gain value matching the image to be processed, the method further includes:

[0085] S1, obtaining corresponding reference pixel values ​​in a reference color space according to pixel values ​​corresponding to a plurality of pixels;

[0086] S2, obtaining color attributes corresponding to the plurality of pixels respectively according to the numerical interval corresponding to the reference pixel value, wherein each numerical interval corresponds to one color attribute;

[0087] S3: When the number of pixels corresponding to the target color attribute is greater than or equal to the target number, determine that the current image is an image to be processed that meets the target monochrome condition.

[0088] It should be noted that, in step S1, the corresponding reference pixel value in the reference color space is obtained according to the pixel values ​​corresponding to each of the plurality of pixels. As an optional implementation, the RGB value is converted into the HSV color space in the following manner:

[0089] First, normalize the RGB values ​​to the range of 0 to 1: R = R / 255, G = G / 255, B = B / 255;

[0090] Then calculate the maximum and minimum RGB values:

[0091] Cmax = max(R, G, B), Cmin = min(R, G, B);

[0092] Further calculate the hue (H), which represents the basic attribute of color: if Cmax = Cmin, then H = 0; otherwise, if Cmax = R, then H = 60 * ((G - B) / (Cmax - Cmin)) mod 360; otherwise, if Cmax = G, then H = 60 * ((B - R) / (Cmax - Cmin)) + 120; otherwise, if Cmax = B, then H = 60 * ((R -G) / (Cmax - Cmin)) + 240;

[0093] Calculate the saturation (S) to indicate the purity of the color or the intensity of the color: if Cmax = 0, then S = 0; otherwise, S = (Cmax - Cmin) / Cmax;

[0094] Calculate the brightness (V) to indicate the brightness of a color or the darkness of a color: V = Cmax. The final HSV value is (H, S, V). This is only an example and is not a specific limitation.

[0095] Then, in step S2, the color attributes corresponding to the plurality of pixels are obtained according to the numerical interval corresponding to the reference pixel value, and each numerical interval corresponds to a color attribute. For example, the numerical interval corresponding to the HSV data in the blue scene is: 170 <H<220,60<S<100,v> 2; The numerical range of HSV data in green scene is: 110 <H<130,70<S<90,v> 2;

[0096] As an optional implementation, in step S3, when the number of pixels corresponding to the target color attribute is greater than or equal to the target number, the current image is determined to be an image to be processed that meets the target monochrome condition. For example, the preset target number is 100 pixels, and the current image meets the numerical interval (170 <H<220,60<S<100,v> 2) The number of pixels is 120, that is, the number of pixels corresponding to the target color attribute is greater than the target number, and the current image is determined to be an image to be processed that meets the target monochrome condition;

[0097] It should be noted that the same processing can be performed using the above method when a pixel block composed of multiple pixels is obtained. This is only an example and is not specifically limited.

[0098] Based on the above steps, by converting R, G, B values ​​into H, S, V values, the number of pixels that meet the conditions can be more accurately determined, and then whether the scene is a large-area monochrome or full-area monochrome scene can be determined, and then the corresponding processing method can be more accurately selected to improve the accuracy and efficiency of image processing.

[0099] In an optional implementation, after obtaining the current image and the pixel values ​​corresponding to the multiple pixels in the current image, the method further includes:

[0100] S1, when the current image is an image frame in a target video sequence, determining, based on pixel values ​​corresponding to a plurality of pixels, that the current image satisfies a target monochrome condition;

[0101] S2, when the current image is the Lth image frame that continuously satisfies the target monochrome condition in the target video sequence, determine that the current image is the image to be processed, where L is an integer greater than J, and J is an integer greater than or equal to 1.

[0102] It can be understood that if the current image is an image frame in a target video sequence, it can be determined that the current image meets the target monochrome condition based on multiple pixel values ​​in the current image in the sequence frames;

[0103] Furthermore, when the current image is the Lth image frame that continuously satisfies the target monochrome condition in the target video sequence, the current image is determined to be the image to be processed. For example, there are 10 frames of images in the target video sequence, and the continuous images corresponding to the 3rd to 6th frames all satisfy the target monochrome condition, and the current image of the 7th frame is determined to be the image to be processed. It should be noted that when the continuous frames after the 7th frame continue to satisfy the target monochrome condition, the images corresponding to the above continuous frames are all images to be processed, and image true value processing is performed. In this way, color oscillation can be avoided and a more stable current image can be selected for true value processing.

[0104] Through the above-mentioned implementation mode of the present application, since the color temperature of the environment may be changing, when only one frame is checked, if the color temperature of the environment changes, the currently set value will cause serious color cast of the picture; in a monochrome scene, there may be a situation where the previous scene is not monochrome, that is, there may be a situation where it is not the color temperature that changes, but the captured picture that changes, so the stable picture is the target scene that needs to be processed. Therefore, when the current image is an image frame in the target video sequence, according to the pixel values ​​corresponding to each of the multiple pixels, it is determined that the current image meets the target monochrome condition. When the current image is the Lth image frame that continuously meets the target monochrome condition in the target video sequence, it is determined that the current image is the image to be processed, thereby preventing image oscillation from causing the selected image to be an abnormal image, so that the image to be processed can be selected more accurately, thereby improving the accuracy of image processing.

[0105] In an optional implementation, after determining the target monochrome condition satisfied by the current image according to the pixel values ​​corresponding to the plurality of pixels, the method further includes:

[0106] S1, obtain the target statistical coefficients matching the target monochromatic conditions;

[0107] S2, perform self-increment processing on the target statistical coefficient to obtain the updated target statistical coefficient;

[0108] S3, obtaining reference statistical coefficients matching the reference monochromatic conditions;

[0109] S4, performing a self-decrement process on the reference statistical coefficient to obtain an updated reference statistical coefficient.

[0110] In an optional implementation, firstly, a target statistical coefficient matching the target monochrome condition is obtained, for example, the target monochrome condition is a blue scene, and the target statistical coefficient is initialized to 0. This is only an example, and no specific limitation is imposed on the value of the target statistical coefficient.

[0111] Further, the target statistical coefficient is self-incremented to obtain an updated target statistical coefficient. As an optional implementation, when the current image matches a blue scene, that is, when the target monochrome condition is met, the target statistical coefficient is self-incremented, for example, by +1, to obtain an updated target statistical coefficient.

[0112] In the above step S3, a reference statistical coefficient matching the reference monochrome condition is obtained. For example, the reference monochrome condition is a green scene, and the reference statistical coefficient is initialized to 0. This is only an example, and no specific limitation is imposed on the value of the reference statistical coefficient.

[0113] Further, in step S4, the reference statistical coefficient is subtracted to obtain an updated reference statistical coefficient. As an optional implementation, when the current image matches a blue scene, the reference statistical coefficient is subtracted, for example, by -1, to obtain an updated reference statistical coefficient.

[0114] Through the above-mentioned implementation mode of the present application, when it is determined that a certain number of continuous frame images meet the target monochrome conditions, the image is processed starting from the Nth frame whose target coefficient meets the threshold. When the target coefficient does not meet the threshold, the image corresponding to the frame is processed by the existing white balance algorithm, thereby improving the accuracy of the selected image processing method and thereby improving the accuracy of image processing.

[0115] In an optional implementation, after obtaining the current image and the pixel values ​​corresponding to the multiple pixels in the current image, the method further includes:

[0116] S1, determining, based on the pixel values ​​corresponding to the plurality of pixels, that the current image does not meet the target monochrome condition;

[0117] S2, obtaining a target statistical coefficient that matches the target monochromatic condition, and performing a self-subtraction process on the target statistical coefficient to obtain an updated target statistical coefficient;

[0118] S3, when the current image meets the reference monochrome condition, obtain the reference statistical coefficients matching the reference monochrome condition; perform self-increment processing on the reference statistical coefficients to obtain updated reference statistical coefficients.

[0119] As an optional implementation, when it is determined that the current image does not meet the target monochrome condition according to the pixel values ​​corresponding to each of the multiple pixels, a target statistical coefficient matching the target monochrome condition is obtained, and the target statistical coefficient is self-decreased to obtain an updated target statistical coefficient. For example, in a video sequence image of 10 frames, the first to fourth frames meet the target monochrome condition, and the above target statistical coefficient is 4 after each self-increment process. The fifth to sixth frames do not meet the target monochrome condition, and the above target statistical coefficients are 3 and 2 respectively after each self-decrement process, and the updated target statistical coefficient is obtained. This is only an example and is not specifically limited.

[0120] It should be noted that, when the current image meets the reference monochrome condition, a reference statistical coefficient matching the reference monochrome condition is obtained; the reference statistical coefficient is self-incremented to obtain an updated reference statistical coefficient. For example, in a 10-frame video sequence image, the 5th to 6th frames meet the reference monochrome condition, and the reference statistical coefficient is self-incremented to obtain an updated reference statistical coefficient. This is only an example and is not specifically limited.

[0121] Through the above-mentioned implementation mode of the present application, according to the pixel values ​​corresponding to each of the multiple pixels, it is determined that the current image does not meet the target monochrome condition; the target statistical coefficient matching the target monochrome condition is obtained, and the target statistical coefficient is self-decremented to obtain the updated target statistical coefficient; when the current image meets the reference monochrome condition, the reference statistical coefficient matching the reference monochrome condition is obtained; the reference statistical coefficient is self-incremented to obtain the updated reference statistical coefficient, and by judging the relationship between the current image and the reference monochrome condition, when the current image does not meet the target monochrome condition but matches the reference monochrome condition, the reference statistical coefficient is self-incremented, and the target statistical coefficient is self-decremented, thereby improving the accuracy of judging whether the image meets the target condition, thereby improving the accuracy and efficiency of image processing.

[0122] The following combination Figure 3A complete implementation of this application is described below:

[0123] First, a calibration work is performed for a large area of ​​monochrome scene. For example, the problem of white balance correction for a large area of ​​blue scene needs to be solved in this solution. S302 is executed to calibrate the blue color card at different color temperatures. The blue color card is placed in light boxes with different color temperatures, and the (Rgain / Ggain, Bgain / Ggain) distribution of the pixel points or pixel blocks of the current scene is recorded respectively. Figure 4 As shown in the figure, the distribution of blue dots at a color temperature of 3000k is taken as an example. Due to the large field of view of the lens, the presence of dark corners and distortion, and the presence of some other points in the background, there will be some discrete points in the data distribution. In actual operation, these discrete points can be removed, and then the mean of these relatively concentrated points can be selected as the distribution of the blue scene at this color temperature. Similarly, after calibrating the (Rgain / Ggain, Bgain / Ggain) distribution of the blue scene at all color temperatures and calculating the mean, Figure 4 The middle white point (the pixel point in the grayscale card) is the multiple pixel values ​​actually obtained, and the black point is the average of the pixel value results of all white points. Through the above processing, the following set of parameters under different color temperatures are obtained (it should be noted that the parameter values ​​in the following parameters are obtained by further processing the target ratio after obtaining the ratio of the actual gain values, for example: multiplying the actual values ​​of Rgain / Ggain and Bgain / Ggain by 1000): (1070, 3855), / / 2800K; (1277, 2914), / / 3000K; (1593,2070), / / 4000K; (1734, 1886), / / 5000K; (2089, 1636), / / 6000K; (2242, 1542), / / 7000K; (2328, 1469), / / 8000K; (2449, 1375), / / 10000K, as shown in Figure 2 Figure 5 As shown;

[0124] S304, replace the grayscale card at the corresponding color temperature; specifically, in the above light box, replace it with a grayscale card, select the corresponding color temperature values ​​of the above gears, and then calculate the accurate Rgain, Ggain, Bgain values ​​and color temperature values, and then convert Rgain, Ggain, Bgain into Rgain / Ggain, Bgain / Ggain formats, as shown below: (1000, 3803), / / 2800k; (1179, 2866), / / 3000K; (1437, 2007), / / 4000k; (1668, 1879), / / 5000K; (2020, 1535), / / 6000K; (2309, 1503), / / 7000K; / / (2328, 1042), 8000K; (2460,1480), / / 10000K;

[0125] S306, obtaining a mapping relationship; specifically, combining the two arrays in S302 and S304, and then obtaining a mapping relationship, a set of current monochrome (Rgain / Ggain, Bgain / Ggain) values, corresponding to an accurate Rgain, Ggain, Bgain value, can accurately restore monochrome, calculate the (Rgain / Ggain, Bgain / Ggain) average of blue pixels in a large area or full area blue picture scene, and convert the Rgain, Ggain, Bgain values ​​of blue pixels at other color temperatures by interpolation, according to an (Rgain / Ggain, Bgain / Ggain) white balance value of the actual white point (pixel of the grayscale card) and the (Rgain / Ggain, Bgain / Ggain) values ​​obtained at different color temperatures, so as to obtain the actual values ​​of Rgain, Ggain, Bgain of blue pixels at different color temperatures;

[0126] S308, determining the color temperature of the image to be processed according to the calibration result, and processing the image that meets the conditions. The specific process is as follows: Figure 6 As shown:

[0127] First, S602 is executed to select a certain monochrome color card. For example, in the case of a large area of ​​blue scene, a blue color card is selected;

[0128] S604, calculating HSV according to the RGB statistical value; then executing S606, determining the range of HSV as the threshold of the color;

[0129] It should be noted that during the scene detection process, while the camera is working properly, the algorithm constantly detects whether the current frame is a scene with a large area of single color. Generally, the platform where image processing runs has statistical values of R, G, and B. The values in the HSV color space need to be obtained through formulas. For example, the numerical range corresponding to the HSV data in a blue scene is: 170 < H < 220, 60 < S < 100, v > 2;

[0130] After further converting the pixel values of the obtained pixel points into the values in the HSV space, then according to H1 < H < H2, S1 < S < S2, V1 < V < V2, calculate how many points in the current scene meet this condition. At the same time, check whether the number of white points is extremely small or none. Among them, the group of values (H1, H2, S1, S2, V1, V2) can have multiple sets, which are determined according to different scenes and can be determined during the algorithm calibration process. Different scenes correspond to different mapping relationships. Finally, the values of Rgain / Ggain and Bgain / Ggain can be obtained, and some other color temperature data can be obtained through interpolation;

[0131] As an optional implementation method, to convert RGB values into the HSV color space, it can be done in the following way: First, normalize the RGB values to the range from 0 to 1, i.e., R = R / 255, G = G / 255, B = B / 255; then calculate the maximum and minimum RGB values: Cmax = max(R, G, B), Cmin = min(R, G, B); further calculate the hue (H), which represents the basic attribute of the color: If Cmax = Cmin, then H = 0; otherwise, if Cmax = R, then H = 60 * ((G - B) / (Cmax - Cmin)) mod 360; otherwise, if Cmax = G, then H = 60 * ((B - R) / (Cmax - Cmin)) + 120; otherwise, if Cmax = B, then H = 60 * ((R - G) / (Cmax - Cmin)) + 240; calculate the saturation (S), which represents the purity or the shade of the color: If Cmax = 0, then S = 0; otherwise, S = (Cmax - Cmin) / Cmax; calculate the value (V), which represents the brightness or the darkness of the color: V = Cmax. The finally obtained HSV value is (H, S, V);

[0132] S608, performing the same calibration at each color temperature, for example, selecting R, G, B values ​​of 10 pixels at the same color temperature, and then performing average processing to obtain the calibration result at the color temperature, and performing the same processing at each color temperature;

[0133] S610, obtaining a set of R, G, and B mean values ​​of the color at each color temperature;

[0134] S612, perform the same calibration on the grayscale card at each color temperature to obtain another set of correct true values ​​of R, G, and B gains; specifically, since the R, G, and B values ​​of the grayscale card have the relationship R=G=B, for example, in a 5000K color temperature scene, the pixel value in the actual grayscale card needs to satisfy g1 / r1=1 and g1 / b1=1, so the above conditions that need to be satisfied are r1*x=g1 and b1*y=g1, that is, x=g1 / r1 and y=g1 / b1, where x and y are the correction coefficients of the grayscale card at the 5000K color temperature and also the correction coefficients of the blue color card at the same color temperature, thereby obtaining the true value of the pixel value of the blue color card at the corresponding color temperature;

[0135] S614, obtaining a correspondence between a monochrome color card and a true white balance value. Specifically, for example, taking the calculation method of red gain value Rgain=(R+G+B) / 3 / R, green gain value Ggain=(R+G+B) / 3 / G, and blue gain value Bgain=(R+G+B) / 3 / B as an example, the pixel value of a blue pixel at a color temperature of 5000K satisfies (Rgain / Ggain, Bgain / Ggain) of (1734, 1886), and the grayscale card at the corresponding color temperature is (1668, 1879). When true value processing is performed on the blue pixel value at a color temperature of 5000K, the magnification of the red channel is Rgain / Ggain =G / R=1.668 of the white point, and the magnification of the blue channel is Bgain / Ggain of the white point. =G / B=1.879. It should be noted that the parameter values ​​in the parameters recorded in this application are parameter values ​​obtained by further processing through the target multiplier after obtaining the ratio of the actual gain values. For example, in some embodiments, for ease of representation, the real values ​​of Rgain / Ggain and Bgain / Ggain are multiplied by 1000.

[0136] It is understandable that due to the large difference in the algorithms for determining a monochrome scene and a non-monochrome scene, the calculation results have a large contrast. In order to prevent color oscillation in the performance results, a set of protection mechanisms is added: strict entry and strict exit. The specific approach is: only when it is determined that N consecutive frames meet the characteristics of a monochrome scene and are the same monochrome scene, will this algorithm be entered for calculation. The rule for exiting this algorithm is: only when M consecutive frames do not meet the characteristics of a monochrome scene will this mechanism be exited. It should be noted that if there is a slight change in the judgment rules of the above processing method, the white balance strategy will be switched between two different algorithms, resulting in different calculation results and causing oscillation of the color effect of the picture. The specific implementation method is as follows: Figure 7 As shown:

[0137] S702, obtaining R, G, B data through hardware; then executing S704, calculating H, S, V data;

[0138] Determine S706 whether the number of single-color blocks is greater than K1;

[0139] If the number of monochrome color blocks is not greater than K1, determine S708 whether the number of monochrome color blocks is less than K2; if the number of monochrome color blocks is not less than K2, execute S702 to obtain the R, G, B data of the next frame of image through hardware;

[0140] If the number of monochrome blocks is greater than K1, execute S706-2, the number of pure monochrome frames N++, for example, N can be initialized to 0; then continue to determine 706-4, whether the number of frames N is greater than the threshold 1;

[0141] If the number of frames N is greater than the threshold 1, execute S706-6 to count the R, G, and B mean values ​​of the monochrome color block; S706-8 to find the correct white balance true value through the mapping relationship table; S706-10 to process the image using the true value; if the number of frames N is not greater than the threshold 1, execute S702 to obtain the R, G, and B data of the next frame of image through hardware;

[0142] If the number of monochrome blocks is less than K2, execute S708-2, the number of pure monochrome frames N--; determine S708-4 whether the number of frames N is equal to 0;

[0143] If the number of frames N is equal to 0, execute S708-6 to execute the normal white balance algorithm channel; if the number of frames N is not equal to 0, execute S702 to obtain the R, G, B data of the next frame image through hardware;

[0144] S710, end; it should be noted that K1 is greater than or equal to K2, and the threshold can be determined according to actual conditions;

[0145] That is, first determine the number of monochrome color blocks to see if it reaches the threshold number K1, then add 1 to the number of frames in the statistical single-frame state, and then determine the number. If it reaches the threshold 1, determine to enter the algorithm for monochrome color block processing, that is, use the above-mentioned magnification method recorded in this scheme to perform true value processing on the frame; in addition, determine whether the number of monochrome color blocks is less than K2. If so, subtract 1 from the number of frames in the statistical single-frame state. When the number of frames is reduced to 0, exit the algorithm and enter the normal white balance algorithm channel calculation. It should be noted that the above steps can be optimized to perform the judgment operations on S706 and S708 simultaneously.

[0146] S310, performing true value processing on the image to be processed according to the mapping relationship under the corresponding color temperature; specifically, obtaining (Rgain / Ggain, Bgain / Ggain) of the white point according to the mapping relationship, thereby calculating the values ​​of Rgain, Ggain, Bgain, and the current color temperature value, for example, obtaining (Rgain / Ggain, Bgain / Ggain) of the blue color card, determining the color temperature of the blue color card according to (Rgain / Ggain, Bgain / Ggain), and obtaining the correction coefficient corresponding to the pixel in the white point (grayscale card) under the corresponding color temperature, and calculating the true pixel value of blue under the color temperature according to the correction coefficient as a multiplier.

[0147] Through the algorithm framework in the above implementation of the present application, the conditions are first used to determine whether it is a large area of ​​monochrome or a full area of ​​monochrome, where the judgment standard can be achieved by parameter debugging of a fixed scene. The RGB data needs to be converted into the HSV color space, and then the special scene is defined according to the performance of the HSV data in this scene, so that when encountering such a scene, it can be identified as a special scene and special processing can be performed;

[0148] Special processing means that, for example, a scene with a large area of ​​blue needs to be processed. The (Rgain / Ggain, Bgain / Ggain) distribution data of the scene at different color temperatures is captured and statistically analyzed. Then, a data curve of the calculation results corresponding to the blue scene at different color temperatures will be obtained. Each color temperature is a group of (Rgain / Ggain, Bgain / Ggain) data. The number of calibrated color temperatures is the number of (Rgain / Ggain, Bgain / Ggain) data. Then, correspondingly, the scene is transformed into a gray-white card, and the traditional white balance algorithm is used to calculate the prepared Rgain, Ggain, and Bgain values ​​at each color temperature. Then, an accurate (Rgain / Ggain, Bgain / Ggain) of N groups is calculated. Finally, two N groups of (Rgain / Ggain, Bgain / Ggain) data are obtained. One group is the value calculated under the blue scene, and the other group is the actual and accurate value representing the white balance parameters. The above is a calibration process.

[0149] In the actual test environment, we first determine whether the scene is a calibrated known scene, such as the blue scene mentioned above, which meets the scene judgment criteria. Then we enter the calculation process for this special scene. We calculate the (Rgain / Ggain, Bgain / Ggain) values ​​of all pixels or pixel blocks that meet the calibration conditions according to the current scene, and then find the accurate white balance result corresponding to this set of calculation results based on the mapping relationship. Then, we can calculate the Rgain, Ggain, and Bgain values ​​that accurately reflect the color temperature environment without a white point, thereby restoring the blue color of the scene and improving the accuracy of image processing.

[0150] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0151] According to another aspect of the embodiments of the present application, an image processing device for implementing the above-mentioned image processing method is also provided. Figure 8 As shown, the device comprises:

[0152] An acquisition unit 802 acquires a current image and pixel values ​​corresponding to a plurality of pixels in the current image;

[0153] The first determining unit 804 determines, based on the pixel values ​​corresponding to the plurality of pixels, that the current image is an image to be processed that satisfies a target monochrome condition, and obtains a pixel gain value that matches the image to be processed, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value;

[0154] The second determining unit 806 determines a target color temperature value corresponding to the image to be processed according to the pixel gain value, and obtains a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is a value determined by a standard color card at a target color temperature indicated by the target color temperature value;

[0155] The processing unit 808 processes the pixel values ​​corresponding to the plurality of pixels in the image to be processed according to the target correction coefficient to obtain a target image.

[0156] Optionally, the above-mentioned image processing device also includes: a first acquisition unit, used to acquire a reference coefficient group corresponding to the above-mentioned target monochrome condition, wherein the above-mentioned reference coefficient group includes reference coefficients corresponding to multiple color temperature values, and the multiple reference coefficients are determined by reference pixel gain values ​​respectively measured under multiple corresponding color temperature conditions according to a target color card matching the above-mentioned target monochrome condition; when the gain coefficient determined according to the above-mentioned pixel gain value matches the target coefficient in the above-mentioned reference coefficient group, the above-mentioned target color temperature value corresponding to the above-mentioned target coefficient is determined as the color temperature value corresponding to the above-mentioned image to be processed; the above-mentioned target correction coefficient is acquired according to the above-mentioned target color temperature value, wherein the above-mentioned target correction coefficient is determined by the target pixel gain value measured under the above-mentioned target color temperature condition indicated by the above-mentioned target color temperature value according to the above-mentioned standard color card, and the above-mentioned target pixel gain value includes a target red gain value, a target green gain value and a target blue gain value.

[0157] Optionally, the first acquisition unit includes: a second acquisition unit, used to acquire a first ratio between the red gain value and the green gain value in the pixel gain value, and a second ratio between the blue gain value and the green gain value in the pixel gain value; and determine the first ratio and the second ratio as the gain coefficient.

[0158] Optionally, the first acquisition unit includes: a third determination module, used to acquire a first color temperature value sequence, wherein the first color temperature value sequence includes N first color temperature values, and the N is an integer greater than 1; acquire the N first pixel gain values ​​respectively measured by the target color card under the color temperature environment corresponding to the N first color temperature values; use a third ratio between a first red gain value and a first green gain value in the first pixel gain values, and a fourth ratio between a first blue gain value and a first green gain value in the first pixel gain values ​​as the first gain coefficient corresponding to the first color temperature value; acquire a second color temperature value sequence matching the first color temperature value sequence, wherein the second color temperature value sequence includes M second color temperature values, and the M is an integer greater than 1; determine a plurality of second gain coefficients through a target interpolation function according to the second color temperature value sequence and the plurality of first gain coefficients; and determine the reference coefficient group according to the first gain coefficient and the plurality of second gain coefficients.

[0159] As an optional solution, the first acquisition unit includes: a first processing module, used to acquire a reference pixel value of a reference pixel in the image to be processed; using a first ratio in the target correction coefficient as a first correction magnification of a red channel value in the reference pixel value, and using a second ratio in the target correction coefficient as a second correction magnification of a blue channel value in the reference pixel value, wherein the target correction coefficient includes the first ratio between a target red gain value and a target green gain value, and the second ratio between a target blue gain value and the target green gain value, and the target red gain value, the target blue gain value and the target green gain value are measured according to the standard color card under the target color temperature condition indicated by the target color temperature value; determining an updated red channel value according to a product of the first correction magnification and the red channel value, and determining an updated blue channel value according to a product of the second correction magnification and the blue channel value; and determining the target pixel value of the reference pixel according to the updated red channel value and the updated blue channel value.

[0160] Optionally, the first acquisition unit is further used to: acquire corresponding reference pixel values ​​in a reference color space according to the pixel values ​​corresponding to the plurality of pixels; acquire color attributes corresponding to the plurality of pixels respectively according to the numerical range corresponding to the reference pixel values, wherein each of the numerical ranges corresponds to one of the color attributes; and when the number of pixels corresponding to the target color attribute is greater than or equal to the target number, determine that the current image is the image to be processed that meets the target monochrome condition.

[0161] Optionally, the above-mentioned device also includes: a fourth determination unit, which is used to determine that the above-mentioned current image satisfies the above-mentioned target monochrome condition according to the above-mentioned pixel values ​​corresponding to each of the above-mentioned multiple pixels when the above-mentioned current image is an image frame in the target video sequence; and when the above-mentioned current image is the Lth above-mentioned image frame that continuously satisfies the above-mentioned target monochrome condition in the above-mentioned target video sequence, determine that the above-mentioned current image is the above-mentioned image to be processed, wherein the above-mentioned L is an integer greater than J, and the above-mentioned J is an integer greater than or equal to 1.

[0162] Optionally, the fourth determination unit is also used to: obtain a target statistical coefficient that matches the target monochrome condition; perform self-increment processing on the target statistical coefficient to obtain the updated target statistical coefficient; obtain a reference statistical coefficient that matches the reference monochrome condition; perform self-decrement processing on the reference statistical coefficient to obtain the updated reference statistical coefficient.

[0163] Optionally, the fourth determination unit is also used to: determine, based on the pixel values ​​corresponding to each of the multiple pixels, that the current image does not satisfy the target monochrome condition; obtain a target statistical coefficient that matches the target monochrome condition, and perform self-decrement processing on the target statistical coefficient to obtain the updated target statistical coefficient; when the current image satisfies the reference monochrome condition, obtain a reference statistical coefficient that matches the reference monochrome condition; perform self-increment processing on the reference statistical coefficient to obtain the updated reference statistical coefficient.

[0164] For the specific implementation, reference may be made to the example shown in the above-mentioned image processing method, which will not be described in detail in this example.

[0165] Among them, the memory 902 can be used to store software programs and modules, such as program instructions / modules corresponding to the image processing method and device in the embodiments of the present invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, realizing the above-mentioned image processing method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely located relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 can be specifically, but not limited to, used to store file information such as target logical files. As an example, such as Fig. 9As shown, the memory 902 may include but is not limited to the acquisition unit 802, the first determination unit 804, the second determination unit 806 and the processing unit 808 in the image processing device. In addition, it may also include but is not limited to other module units in the image processing device, which will not be repeated in this example.

[0166] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0167] In addition, the electronic device mentioned above further includes: a display 908, and a connection bus 910, which is used to connect various module components in the electronic device mentioned above.

[0168] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0169] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0170] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0171] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.

[0172] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.

[0173] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0174] S1, obtaining a current image and pixel values ​​corresponding to a plurality of pixels in the current image;

[0175] S2, when it is determined that the current image is an image to be processed that satisfies a target monochrome condition according to pixel values ​​corresponding to each of the plurality of pixels, a pixel gain value matching the image to be processed is obtained, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value;

[0176] S3, determining a target color temperature value corresponding to the image to be processed according to the pixel gain value, and obtaining a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is a value determined by a standard color card at a target color temperature indicated by the target color temperature value;

[0177] S4, processing the pixel values ​​corresponding to the plurality of pixels in the image to be processed respectively according to the target correction coefficient to obtain the target image.

[0178] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0179] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0180] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0181] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0182] In the several embodiments provided in the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0183] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0184] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0185] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An image processing method, It is characterized in that include: Obtaining a current image and pixel values ​​corresponding to a plurality of pixels in the current image; In a case where the current image is an image frame in a target video sequence, determining whether the current image satisfies a target monochrome condition according to the pixel values ​​corresponding to each of the plurality of pixels; In a case where the current image is the Lth image frame in the target video sequence that continuously satisfies the target monochrome condition, determining that the current image is an image to be processed, wherein L is an integer greater than J, and J is an integer greater than or equal to 1; When it is determined that the current image is an image to be processed that satisfies a target monochrome condition according to the pixel values ​​corresponding to each of the plurality of pixels, a pixel gain value matching the image to be processed is obtained, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; Acquire a reference coefficient group corresponding to the target monochrome condition, wherein the reference coefficient group includes reference coefficients corresponding to a plurality of color temperature values, and the plurality of reference coefficients are determined according to reference pixel gain values ​​respectively measured under a plurality of corresponding color temperature conditions according to a target color card matching the target monochrome condition; Acquire a first ratio between the red gain value and the green gain value in the pixel gain value, and a second ratio between the blue gain value and the green gain value in the pixel gain value; and determine the first ratio and the second ratio as gain coefficients; In a case where the gain coefficient determined according to the pixel gain value matches the target coefficient in the reference coefficient group, determining the target color temperature value corresponding to the target coefficient as the color temperature value corresponding to the image to be processed; Acquire a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is determined by a target pixel gain value measured by a grayscale card under the target color temperature condition indicated by the target color temperature value, and the target pixel gain value includes a target red gain value, a target green gain value, and a target blue gain value; The pixel values ​​corresponding to each of the plurality of pixels in the image to be processed are processed according to the target correction coefficient to obtain a target image.

2. The method according to claim 1, It is characterized in that Before obtaining the reference coefficient group corresponding to the target monochromatic condition, the method includes: Acquire a first color temperature value sequence, wherein the first color temperature value sequence includes N first color temperature values, and N is an integer greater than 1; Obtaining N first pixel gain values ​​respectively measured by the target color card under the color temperature environments corresponding to the N first color temperature values; using a third ratio between a first red gain value and a first green gain value in the first pixel gain values, and a fourth ratio between a first blue gain value and a first green gain value in the first pixel gain values, as first gain coefficients corresponding to the first color temperature value; Acquire a second color temperature value sequence matching the first color temperature value sequence, wherein the second color temperature value sequence includes M second color temperature values, and M is an integer greater than 1; Determine a plurality of second gain coefficients by a target interpolation function according to the second color temperature value sequence and the plurality of first gain coefficients; The reference coefficient group is determined according to the first gain coefficient and a plurality of the second gain coefficients.

3. The method according to claim 1, It is characterized in that The processing of the pixel values ​​corresponding to the plurality of pixels in the image to be processed according to the target correction coefficient comprises: Obtaining a reference pixel value of a reference pixel in the image to be processed; Using a first ratio in the target correction coefficient as a first correction magnification of a red channel value in the reference pixel value, and using a second ratio in the target correction coefficient as a second correction magnification of a blue channel value in the reference pixel value, wherein the target correction coefficient includes the first ratio between a target red gain value and a target green gain value, and a second ratio between a target blue gain value and the target green gain value, and the target red gain value, the target blue gain value, and the target green gain value are measured by the grayscale card under the target color temperature condition indicated by the target color temperature value; Determine the updated red channel value according to the product of the first correction magnification and the red channel value, and determine the updated blue channel value according to the product of the second correction magnification and the blue channel value; The target pixel value of the reference pixel is determined according to the updated red channel value and the updated blue channel value.

4. The method according to claim 1, It is characterized in that In the case where it is determined that the current image is an image to be processed that meets the target monochrome condition according to the pixel values ​​corresponding to each of the plurality of pixels, before obtaining the pixel gain value matching the image to be processed, the method further includes: According to the pixel values ​​corresponding to each of the plurality of pixels, obtaining a corresponding reference pixel value in a reference color space; According to the numerical interval corresponding to the reference pixel value, obtaining color attributes corresponding to the plurality of pixels respectively, wherein each of the numerical intervals corresponds to one of the color attributes; When the number of pixels corresponding to the target color attribute is greater than or equal to the target number, the current image is determined to be the image to be processed that meets the target monochrome condition.

5. The method according to claim 1, It is characterized in that After determining whether the current image meets the target monochrome condition according to the pixel values ​​corresponding to each of the plurality of pixels, the method further includes: Obtaining a target statistical coefficient matching the target monochromatic condition; Performing a self-increment process on the target statistical coefficient to obtain an updated target statistical coefficient; Obtaining reference statistical coefficients matching reference monochromatic conditions; The reference statistical coefficient is subjected to self-decrement processing to obtain the updated reference statistical coefficient.

6. The method according to claim 1, It is characterized in that After obtaining the current image and the pixel values ​​corresponding to the multiple pixels in the current image, the method further includes: Determining, according to the pixel values ​​corresponding to each of the plurality of pixels, that the current image does not satisfy the target monochrome condition; Acquire a target statistical coefficient that matches the target monochrome condition, and perform a self-subtraction process on the target statistical coefficient to obtain an updated target statistical coefficient; In the case where the current image satisfies the reference monochrome condition, a reference statistical coefficient matching the reference monochrome condition is obtained; and a self-increment process is performed on the reference statistical coefficient to obtain the updated reference statistical coefficient.

7. An image processing device, It is characterized in that include: An acquisition unit, which acquires a current image and pixel values ​​corresponding to a plurality of pixels in the current image; In a case where the current image is an image frame in a target video sequence, determining whether the current image satisfies a target monochrome condition according to the pixel values ​​corresponding to each of the plurality of pixels; In a case where the current image is the Lth image frame in the target video sequence that continuously satisfies the target monochrome condition, determining that the current image is an image to be processed, wherein L is an integer greater than J, and J is an integer greater than or equal to 1; a first determining unit, which determines, based on the pixel values ​​corresponding to each of the plurality of pixels, that the current image is an image to be processed that satisfies a target monochrome condition, and obtains a pixel gain value that matches the image to be processed, wherein the target monochrome condition is used to indicate that the number of target pixel points matching the target monochrome in the image to be processed is greater than or equal to a target threshold, and the pixel gain value includes a red gain value, a green gain value, and a blue gain value; a second determination unit, obtaining a reference coefficient group corresponding to the target monochrome condition, wherein the reference coefficient group includes reference coefficients corresponding to a plurality of color temperature values, and the plurality of reference coefficients are determined according to reference pixel gain values ​​respectively measured under a plurality of corresponding color temperature conditions according to a target color card matching the target monochrome condition; obtaining a first ratio between the red gain value and the green gain value in the pixel gain value, and a second ratio between the blue gain value and the green gain value in the pixel gain value; determining the first ratio and the second ratio as gain coefficients; in a case where the gain coefficient determined according to the pixel gain value matches the target coefficient in the reference coefficient group, determining the target color temperature value corresponding to the target coefficient as the color temperature value corresponding to the image to be processed; obtaining a target correction coefficient according to the target color temperature value, wherein the target correction coefficient is determined according to a target pixel gain value measured under the target color temperature condition indicated by the target color temperature value according to a grayscale card, and the target pixel gain value includes a target red gain value, a target green gain value, and a target blue gain value; The processing unit processes the pixel values ​​corresponding to each of the plurality of pixels in the image to be processed according to the target correction coefficient to obtain a target image.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed by an electronic device.

9. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.

10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.