A color correction method, system and electronic device

By obtaining the color temperature value and dynamic range of the image sensor, selecting the corresponding color correction data set, calculating the color correction coefficient, and correcting the original color correction data, the problem of color deviation of the image sensor in different target scenarios is solved, and color consistency and efficient correction are achieved.

CN115866414BActive Publication Date: 2025-08-01ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211554733.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-08-01
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

In the prior art, due to inconsistent dynamic range in different target scenarios, image sensors have color deviations during color correction, and the details of high-light or low-light areas cannot be effectively displayed.

Method used

By obtaining the color temperature value and dynamic range of the image sensor, selecting the corresponding color correction data set, calculating the color correction coefficient, and correcting the original color correction data to ensure color consistency and efficiency.

Benefits of technology

The consistent expression of image color is improved, the calculation amount of color correction coefficient is reduced, and the efficiency of color correction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115866414B_ABST
    Figure CN115866414B_ABST
Patent Text Reader

Abstract

The present application provides a color correction method, system and electronic device, which relates to the technical field of image processing. In the present application, first, the current image currently collected by the image sensor is obtained, and the color temperature value of the current image is calculated; then, the first original color correction data set and the second original color correction data set corresponding to the color temperature value are selected from the preset original color correction data set, and then, in the second original color correction data set, the second original color correction data value that meets the color temperature value and the dynamic range is searched for and filtered out, and then the second target color correction data value in the image sensor is extracted, and based on the second original color correction data value and the second target color correction data value, the color correction coefficient of the image is calculated; finally, based on the color correction coefficient, the first original color correction data included in the first original color correction data set is corrected. By adopting the above method, the consistent expression of image colors can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technologies, and in particular, to a color correction method, system, and electronic device. Background Art

[0002] Video surveillance is an important part of a security prevention system and is widely used in life because it can intuitively and promptly provide rich information. With the development of image processing technologies, the quality of video images recorded by image sensors has also been correspondingly improved. For example, color, as an important part of the quality of video images, the visual perception presented by the style characteristics of colors is usually an important indicator for users to evaluate the quality of video images. Since there are differences in the spectral responses of image sensors and human eyes, and there will be color casts after the white balance processing of video images, it is necessary to perform color correction on video images so that the video images are more in line with the visual characteristics of human eyes.

[0003] Currently, a Color Correction Matrix (CCM) is usually used to correct the colors of video images. When formulating the CCM, first determine the color temperature corresponding to each test scene. For example, the high, medium, and low color temperatures corresponding to test scene one. Then determine a set of target CCMs corresponding to each color temperature in the test scene. Then use a color temperature value estimation algorithm to estimate the color temperature value of the current video image. Finally, determine the target CCM corresponding to the current color temperature by interpolating the color temperature value based on the corresponding relationship between the color temperature value interpolation and the target CCM.

[0004] However, when performing color correction on images, in addition to the color temperature affecting the color expression of images, different scenes correspond to different dynamic ranges in the image sensor. Therefore, the change in this dynamic range will also affect the final color expression of the image. The dynamic range corresponding to a specific test scene is determined, while the dynamic range corresponding to the target scene faced by the image sensor is unpredictable. Applying the dynamic range corresponding to a specific test scene to the target scene may cause the video images in the brightest or darkest areas of the image sensor in different target scenes to not reflect the detail information of the scene. For example, the image output by the image sensor is overexposed in the highlight area of the image or too dark in the low-light area of the image, and the detail information of the image in the highlight or low-light area cannot be displayed.

[0005] The image sensor can adjust the corresponding control parameter values by a dynamic range adjustment module in the internal image processing unit according to the dynamic range corresponding to the current target scene, so that the dynamic range of the video sensor can as much as possible meet the dynamic range requirements of the current target scene, and further obtain more scene detail information from the target image output by the video sensor.

[0006] Since the actual dynamic range of the target scene is inconsistent with the dynamic range corresponding to a specific test scene, when the image sensor corrects the image color in the target scene, the corrected image obtained only based on the target CCM corresponding to the specific test scene and the dynamic range control parameter value corresponding to the specific test scene will have a color deviation from the target image. Summary of the Invention

[0007] The present invention provides a color correction method, system and electronic device to improve the consistent expression of image color during the process of adjusting the dynamic range by the image sensor under different color temperature conditions. The specific technical solutions are as follows:

[0008] In a first aspect, the present application provides a color correction method, including:

[0009] Obtain the current image currently collected by the image sensor, and calculate the color temperature value of the current image based on a preset color temperature estimation algorithm;

[0010] Based on the color temperature value, select a first original color correction data set and a second original color correction data set corresponding to the color temperature value from a preset original color correction data set, wherein the second original color correction data included in the second original color correction data set represents the degree of adjustment of the brightness corresponding to the current dynamic range of the image sensor;

[0011] In the second original color correction data set, search for and filter out the second original color correction data value that meets the color temperature value and the dynamic range, and extract the second target color correction data value corresponding to the color temperature value and the dynamic range in the image sensor;

[0012] Calculate the color correction coefficient of the image based on the second original color correction data value and the second target color correction data value;

[0013] Correct the first original color correction data included in the first original color correction data set based on the color correction coefficient.

[0014] Based on the above method, the second target color correction data value corresponding to the color temperature value and the dynamic range in the current sensor can be extracted, and the second target color correction data value and the second original color correction data value are used as the operation data of the color correction coefficient to correct the first original color correction data. This can not only improve the consistent expression of image color, but also reduce the calculation amount of the color correction coefficient and improve the efficiency of correcting the first original correction data.

[0015] In a possible design, before obtaining the current image currently collected by the image sensor, it further includes:

[0016] In a set scenario, extract the original images collected by the image sensor at various color temperatures, compare the original images with a standard image color card respectively, and estimate the color temperature value corresponding to the original image;

[0017] Establish a mapping relationship between the color temperature value and the first original color correction data to obtain a first original color correction data set;

[0018] Establish a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain a second original color correction data set;

[0019] Classify the color correction data in the first original color correction data set and the second original color correction data set according to different color temperature values and different dynamic ranges to obtain the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively.

[0020] Through the above method, in a set environment, the corresponding first original color correction data and second original color correction data can be respectively matched according to different color temperature values and different dynamic ranges of the image sensor.

[0021] In a possible design, obtain the current image currently collected by the image sensor, and calculate the color temperature value of the current image based on a preset color temperature estimation algorithm, including:

[0022] Calculate the first white balance gain value of the current image according to a preset white balance calculation formula;

[0023] Based on the first white balance gain value of the current image and the second white balance gain values corresponding to the original images at preset color temperatures in the set scenario, calculate the distance deviation between the first white balance gain value and the second white balance gain values;

[0024] Determine the color temperature value of the current image according to the distance deviation.

[0025] Through the above method, the color temperature value of the current image can be estimated.

[0026] In a possible design, in the second original color correction data set, search for and screen out the second original color correction data values that meet the color temperature value and the dynamic range, and extract the second target color correction data values corresponding to the color temperature value and the dynamic range in the image sensor, including:

[0027] Extract the respective color channel values in the image sensor;

[0028] Based on the respective color channel values, screen the respective color channel values according to a preset brightness threshold range to obtain respective color channel screening values;

[0029] According to the respective color channel screening values, respectively find a second original color correction data value and a second target color correction data value corresponding to the respective color channel screening values in the second original color correction data set and the second target color correction data set.

[0030] By the above method, data blocks that are too dark or too bright in the image can be removed, and data blocks within the brightness threshold range are used as the conditions for calculation, improving the accuracy of image brightness calculation, and further improving the accuracy of image color correction.

[0031] In a possible design, correcting the first original color correction data included in the first original color correction data set based on the color correction coefficient includes:

[0032] Perform a multiplication operation on the color correction coefficient and the first original color correction data included in the first original color correction data set to obtain corrected first original color correction data;

[0033] Perform normalization processing on the corrected first original color correction data to obtain first target color correction data.

[0034] By the above method, while adjusting the second original color correction data, the first original color correction data corresponding to the color temperature and the dynamic range of the image sensor can be corrected, which can not only improve the consistency of the color expression of the image output by the image sensor, but also improve the efficiency of image color correction.

[0035] In a second aspect, the present application provides a color correction system, including:

[0036] A data acquisition module, configured to acquire a current image currently collected by an image sensor, and calculate a color temperature value of the current image based on a preset color temperature estimation algorithm;

[0037] A data search module, configured to select a first original color correction data set and a second original color correction data set corresponding to the color temperature value from a preset original color correction data set based on the color temperature value, where the second original color correction data included in the second original color correction data set represents the degree of adjustment of the brightness corresponding to the current dynamic range of the image sensor;

[0038] In the second original color correction data set, search for and filter out the second original color correction data values that meet the color temperature value and the corresponding dynamic range, and extract the second target color correction data values corresponding to the color temperature value and the dynamic range in the image sensor;

[0039] A color correction module, configured to calculate a color correction coefficient of the image based on the second original color correction data value and the second target color correction data value;

[0040] Based on the color correction coefficient, correct the first original color correction data included in the first original color correction data set.

[0041] In a possible design, the data acquisition module is further configured to:

[0042] In a set scene, extract the original images collected by the image sensor at each color temperature, compare the original images with a standard image color card respectively, and estimate the color temperature value corresponding to the original images;

[0043] Establish a mapping relationship between the color temperature value and the first original color correction data to obtain a first original color correction data set;

[0044] Establish a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain a second original color correction data set;

[0045] Classify the color correction data in the first original color correction data set and the second original color correction data set according to different color temperature values and different dynamic ranges, to obtain the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively.

[0046] In a possible design, the data search module is specifically configured to:

[0047] Extract each color channel value in the image sensor;

[0048] Based on each color channel value, filter each color channel value according to a preset brightness threshold range to obtain each color channel filter value;

[0049] According to each color channel filter value, respectively search for the second original color correction data value and the second target color correction data value corresponding to each color channel filter value in the second original color correction data set and the second target color correction data set.

[0050] In a third aspect, the present application provides an electronic device, including:

[0051] A memory for storing a computer program;

[0052] A processor for implementing the steps of the above color correction method when executing the computer program stored in the memory.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the above color correction method are implemented.

[0054] For the various aspects in the second to fourth aspects above and the possible technical effects that each aspect may achieve, please refer to the technical effects that can be achieved for the first aspect or various possible solutions in the first aspect described above, and will not be repeated here. Description of the Drawings

[0055] Figure 1 It is a flowchart of a color correction method provided by the present application;

[0056] Figure 2 It is a schematic diagram of the architecture of a color correction system provided by the present application;

[0057] Figure 3 It is a schematic diagram of the structure of a color correction system provided by the present application;

[0058] Figure 4 It is a schematic diagram of the structure of an electronic device provided by the present application. Detailed Embodiments

[0059] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The specific operation methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of the present application, "a plurality of" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The connection between A and B may represent: A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, words such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.

[0060] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0061] As people's awareness of security increases, more and more high-performance surveillance equipment is appearing in our lives. Video surveillance is a crucial component of security systems, providing intuitive and timely feedback of rich information and finding widespread application across various industries. With the advancement of image processing technology, the quality of video images recorded by image sensors has also improved accordingly. For example, image color is a crucial component of video quality, and the visual experience presented by color stylistic characteristics is often used as a key indicator in user evaluation of video image quality. Due to differences in the spectral response of image sensors and the human eye, and the color cast that occurs after white balancing, video images require color correction to better reflect the visual characteristics of the human eye.

[0062] Currently, a color correction matrix (CCM) is commonly used to correct the color of video images to ensure a good visual experience for users. When developing a CCM, the color temperature corresponding to each test scene is first determined. For example, test scene 1 corresponds to high, medium, and low color temperatures. A set of target CCMs is then determined for each color temperature in the test scene. A color temperature estimation algorithm is then used to estimate the color temperature of the current video image. Finally, based on the correspondence between the interpolated color temperature value and the target object, the interpolated color temperature value of the current video image is determined to obtain the target CCM corresponding to the current color temperature.

[0063] However, when calibrating an image's color, in addition to color temperature affecting the image's color expression, different scenes correspond to different dynamic ranges in the image sensor. Therefore, changes in this dynamic range will also affect the image's final color expression. Generally, the CCM value is calibrated under a specific test scene. The dynamic range corresponding to a specific test scene is fixed, while the dynamic range corresponding to the target scene faced by the image sensor is unpredictable. Applying the dynamic range corresponding to a specific test scene to the target scene may cause the image sensor's video images of the brightest or darkest areas in different target scenes to fail to reflect the scene's detailed information. For example, the image output by the image sensor may be overexposed in the image's highlights or too dark in the image's low-light areas, thus failing to display the image's detailed information in the highlights or low-light areas.

[0064] The image sensor can adjust the corresponding control parameter values according to the dynamic range corresponding to the current target scene through the dynamic range adjustment module in the internal image processing unit, so that the dynamic range of the video sensor can meet the dynamic range requirements of the current target scene as much as possible, and thus obtain more scene detail information from the target image output by the video sensor.

[0065] Since the actual dynamic range of the target scene is inconsistent with the dynamic range corresponding to a specific test scene, when the image sensor corrects the image color in the target scene, only based on the target CCM corresponding to the specific test scene and the dynamic range control parameter value corresponding to the specific test scene, the corrected image will have a color deviation from the target image.

[0066] In view of this, in order to ensure the consistency of image color when the image sensor is under various color temperature conditions and during the process of changing the dynamic range of the image sensor, the present application provides a color correction method, which specifically includes: obtaining the current image currently collected by the image sensor, calculating the color temperature value of the current image based on a preset color temperature estimation algorithm, and then based on the color temperature value, selecting a first original color correction data set and a second original color correction data set corresponding to the color temperature value from a preset original color correction data set, then in the second original color correction data set, searching for and filtering out the second original color correction data value that meets the color temperature value and the corresponding dynamic range, extracting the second target color correction data value corresponding to the color temperature value and the dynamic range in the image sensor, then calculating the color correction coefficient of the image based on the second original color correction data value and the second target color correction data value, and finally correcting the first original color correction data included in the first original color correction data set based on the color correction coefficient.

[0067] It is not difficult to see that through the above method, the second target color correction data value corresponding to the color temperature value and the dynamic range in the current image sensor can be extracted, and the second target color correction data value and the second original color correction data value are used as the operation data of the color correction coefficient to correct the first original color correction data. This can not only correct the first original correction data while correcting the second original color correction data value, improving the consistent expression of image color; but also reduce the calculation amount of the color correction coefficient and improve the efficiency of correcting the first original correction data.

[0068] Refer to Figure 1 As shown, it is a flowchart of a color correction method provided by an embodiment of the present application. The method includes:

[0069] S1, obtaining the current image currently collected by the image sensor, and calculating the color temperature value of the current image based on a preset color temperature estimation algorithm.

[0070] First of all, the method provided by the present application can be applied to Figure 2 the system architecture shown. In this system architecture, it includes an image sensor, a user terminal, and a server. This system can be applied to remote monitoring of scene pictures.

[0071] The image sensor includes a camera and an image processing unit. The camera can record the original image information of the current scene, and the image processing unit can process the original image information of the current scene. The user terminal can send a video interface display request to the server to obtain the target image output by the image processing unit. The server receives the video interface display request from the user terminal and pushes the corresponding target image to the user.

[0072] In practical applications, first, before obtaining the current image currently captured by the image sensor, it is necessary to match the corresponding color correction data values for the original images under different color temperatures.

[0073] Exemplarily, in a set scene, the image processing unit extracts the original images captured by the image sensor under different color temperatures. For example, the images 1, 2, 3, 4, and 5 corresponding to the color temperatures under the five light source conditions of D75, D65, D50, TL84, and A respectively.

[0074] The original images are respectively compared with a standard image color card to estimate the color temperature value corresponding to the original image in the current set scene. For example, in the current set scene, if the similarity between image 2 and the target image of the standard image color card under the D65 light source condition is the highest, then the color temperature in the current scene is estimated to be D65.

[0075] Then, in order to keep the colors of the images output by the image sensor consistent with the colors of the target images under different color temperature conditions, the image processing unit establishes a mapping relationship between the color temperature values and the first original color correction data to obtain the first original color correction data set. Among them, the first original color correction data can be a color correction matrix corresponding to different color temperature conditions. Here, no specific restrictions are imposed on the first original color correction data. The obtained first original color correction data set can be shown in Table 1:

[0076]

[0077] Table 1

[0078] Furthermore, in order to keep the colors of the images with different dynamic ranges consistent with the colors of the target images when the image sensor adjusts the dynamic range, the image processing unit establishes a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain the second original color correction data set. Among them, the second original color correction data can be the gamma value Gamma corresponding to different dynamic range conditions. Here, no specific restrictions are imposed on the second original color correction data. The obtained second original color correction data set can be shown in Table 2:

[0079] Table 2

[0080] Finally, the image processing unit classifies the color correction data in the first original color correction dataset and the second original color correction dataset according to different color temperatures and different dynamic ranges, and obtains the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively.

[0081] Different color temperature conditions correspond to different dynamic ranges respectively. Therefore, the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively can be as shown in Table 3:

[0082] Table 3

[0083] Therefore, through the above method, the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively can be obtained.

[0084] In the embodiment of the present application, since the color temperature of the image sensor in the current environment is uncertain, therefore, first, the image processing unit calculates the first white balance gain value of the current image according to the preset image white balance calculation formula.

[0085] Then, the first white balance gain value of the current image is compared with the second white balance gain values corresponding to the original images under the preset color temperatures respectively, and the distance deviation between the first white balance gain value and the second white balance value is calculated. Among them, the distance deviation can be the Euclidean distance between the two. Here, there is no limitation on the distance calculation between the first white balance gain value and the second white balance value.

[0086] Finally, according to the distance deviation between the first white balance gain value and the second white balance value, the color temperature value of the current image is determined. For example, under the current color temperature condition, the obtained first white balance gain value is (rGain1, bGain1), and under the D50 color temperature condition in the set environment, the obtained second white balance gain value is (rGain2, bGain2). Then, the Euclidean distance between the gain values (rGain1, bGain1) and the gain values (rGain2, bGain2) is calculated, and the color temperature value corresponding to the gain value with the smallest distance deviation between the second white balance gain value and the first white balance gain value is selected as the color temperature value currTemp corresponding to the current environment.

[0087] Through the above method, the color temperature value corresponding to the current image can be obtained.

[0088] S2. Based on the color temperature value, select the first original color correction dataset and the second original color correction dataset corresponding to the color temperature value from the preset original color correction dataset.

[0089] In the embodiment of the present application, after the image processing unit obtains the current color temperature value, based on the current color temperature value, from the preset original color correction data set, the first original color correction data set and the second original color correction data set corresponding to the current color temperature value are selected. Here, assuming that the current color temperature value is D50, as shown in Table 3, the color correction matrices CCM3, CCM8, CCM13, CCM18, CCM23 are used as the first original color correction data set; the gamma values Gamma3, Gamma8, Gamma13, Gamma18, Gamma23 are used as the second original color correction data set.

[0090] In the above manner, the first original color correction data set and the second original color correction data set corresponding to the current color temperature can be found.

[0091] S3. In the second original color correction data set, find and filter out the second original color correction data values that meet the color temperature value and the dynamic range, and extract the second target color correction data values corresponding to the color temperature value and the dynamic range in the image sensor.

[0092] In the embodiment of the present application, after the image processing unit obtains the first original color correction data set and the second original color correction data set corresponding to the current color temperature, first, each color channel value H3A in the image sensor is extracted. For example, the red (R) channel value, the green (G) channel value, and the blue (B) channel value in H3A.

[0093] Then, based on the data of each color channel value and the preset brightness calculation formula, the brightness of the current image is calculated. The calculation formula is as follows:

[0094] Y = 0.299R + 0.587G + 0.114B

[0095] Wherein, Y represents the brightness of the image, R is the red channel value, G is the green channel value, and B is the blue channel value.

[0096] Then, according to the preset brightness threshold range, each color channel value is filtered to obtain each color channel filtered value. Assuming that the threshold range of the image brightness is set between 0.05 and 0.95, the data blocks with the image brightness between 0.05 and 0.95 are retained.

[0097] Then, the image processing unit extracts the second target color correction data values corresponding to the color temperature value and the dynamic range in the image sensor.

[0098] Exemplarily, the second target color correction data value can be obtained through the Gamma module algorithm in the image processing unit:

[0099] First, calculate the brightness values of each data block in the current image, then perform a histogram statistics on the brightness values of each data block, and then, based on the histogram statistics result, determine whether the distribution state of the brightness values obtained from the histogram statistics tends to be a normal distribution. If it satisfies the normal distribution, output the corresponding Gamma data; if it does not satisfy the normal distribution, adjust the Gamma data, and then repeat the above steps of calculating and statistics of the brightness values until the distribution state of the brightness values satisfies the normal distribution, and finally obtain the second target color correction data set corresponding to different brightness values.

[0100] Finally, the image processing unit respectively searches for the second original color correction data value and the second target color correction data value corresponding to each color channel screening value in the second original color correction data set and the second target color correction data set.

[0101] Here, it should be noted that there is a definite mapping relationship between each color channel screening value and the dynamic range. Therefore, the second original color correction data value corresponding to the current dynamic range can also be determined through each color channel screening value, that is: the original Gamma data in the set scene.

[0102] Therefore, through the above method, data blocks that are too dark or too bright in the image can be removed, and data blocks within the brightness threshold range are used as the conditions for operation, improving the accuracy of image brightness calculation.

[0103] S4. Calculate the color correction coefficient of the image based on the second original color correction data value and the second target color correction data value.

[0104] In the embodiment of the present application, after the image processing unit obtains the second original color correction data value and the second target color correction data value corresponding to each color channel screening value, assuming that the second original color correction data value is matrix RGB1 and the second target color correction data value is matrix RGB2, the color correction coefficient coef can be obtained by calculating the inverse matrix of matrix RGB1 and then multiplying the inverse matrix of RGB1 by matrix RGB2. The calculation formula of the color correction coefficient is as follows:

[0105] coef = RGB1 ,

[0104] ,

[0105] , , , -1 ,

[0106] , , -1 ,

[0107] , ×RGB2

[0106] where coef is the color correction coefficient, RGB1 -1 is the inverse matrix of RGB1, and RGB2 is the matrix corresponding to the second target color correction data value.

[0107] Through the above method, each color channel screening value can be used as the input data for calculating the color correction coefficient, which can simplify the steps of calculating the color correction coefficient and improve the efficiency of image color correction.

[0108] S5. Based on the color correction coefficient, correct the first original color correction data included in the first original color correction dataset.

[0109] In the embodiment of the present application, after the image processing unit obtains the color correction coefficient, first, assume that the color correction coefficient is obtained under the condition that the current color temperature is D50 (5000K) and the dynamic range of the image sensor is 1. As shown in Table 3, under the current color temperature and dynamic range conditions, the first original color correction data is CCM3.

[0110] Then perform a multiplication operation on the color correction coefficient and the first original color correction data CCM3 included in the first original dataset to obtain the corrected first original color correction data. For example, CCM 校正 = coef × CCM3.

[0111] Finally, perform a normalization process on the corrected first original color correction data to obtain the first target color correction data. The normalization process for the corrected first original color correction data can be the following method:

[0112] Assume that the result of the operation of CCM 校正 is [c00 c01 c02; c10 c11 c12; c20 c21 c22]. Constraints can be added to the elements of each row of the 3*3 matrix CCM 校正 , for example, c02 = 1 - c00 - c01; c12 = 1 - c10 - c11; c22 = 1 - c20 - c21. The present application does not make specific limitations on the constraints added to the elements of each row of the matrix CCM 校正 , and will not elaborate here.

[0113] Here, it should be noted that the obtained first target color correction data after correction can be stored in the image sensor, so that the image processing unit can call the first target color correction data and the second target color correction data corresponding to the current color temperature value and dynamic range in real time according to the current color temperature value and dynamic range.

[0114] In summary, the color correction method provided by the present application can, under various color temperature conditions and during the process of changing the dynamic range of the image sensor, while the image processing unit adjusts the second original color correction data, correct the first original color correction data corresponding to the color temperature and the dynamic range of the image sensor. It can not only improve the consistency of the image color expression output by the image sensor, but also improve the efficiency of image color correction.

[0115] Based on the method provided in the above embodiments, the embodiment of the present application also provides a color correction system, as Figure 3The following is a schematic structural diagram of a color correction system in an embodiment of the present application. The system includes:

[0116] A data acquisition module 301, configured to acquire a current image currently captured by an image sensor, and calculate a color temperature value of the current image based on a preset color temperature estimation algorithm;

[0117] A data search module 302, configured to select a first original color correction data set and a second original color correction data set corresponding to the color temperature value from a preset original color correction data set based on the color temperature value, where the second original color correction data included in the second original color correction data set represents the degree of adjustment of the brightness corresponding to the current dynamic range of the image sensor;

[0118] In the second original color correction data set, search for and filter out a second original color correction data value that satisfies the color temperature value and the dynamic range, and extract a second target color correction data value corresponding to the color temperature value and the dynamic range in the image sensor;

[0119] A color correction module 303, configured to calculate a color correction coefficient of the image based on the second original color correction data value and the second target color correction data value;

[0120] Based on the color correction coefficient, correct the first original color correction data included in the first original color correction data set.

[0121] In a possible design, the data acquisition module 301 is further configured to:

[0122] In a set scene, extract original images captured by the image sensor at various color temperatures, compare the original images with a standard image color card respectively, and estimate the color temperature values corresponding to the original images;

[0123] Establish a mapping relationship between the color temperature value and the first original color correction data to obtain a first original color correction data set;

[0124] Establish a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain a second original color correction data set;

[0125] Classify the color correction data in the first original color correction data set and the second original color correction data set according to different color temperature values and different dynamic ranges to obtain the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively.

[0126] In a possible design, the data search module 302 is specifically configured to:

[0127] Extract the respective color channel values in the image sensor;

[0128] Based on the respective color channel values, screen the respective color channel values according to a preset brightness threshold range to obtain respective color channel screening values;

[0129] According to the respective color channel screening values, respectively search for corresponding second original color correction data values and second target color correction data values in the second original color correction data set and the second target color correction data set.

[0130] Based on the same inventive concept, an electronic device is further provided in an embodiment of the present application. The electronic device can implement the functions of the foregoing color correction method. Refer to Figure 4 , the electronic device includes:

[0131] At least one processor 401, and a memory 402 connected to the at least one processor 401. In the embodiment of the present application, the specific connection medium between the processor 401 and the memory 402 is not limited. Figure 4 In, it is taken as an example that the processor 401 and the memory 402 are connected through a bus 400. The bus 400 is represented by a thick line in Figure 4 . The connection manners between other components are only for illustrative purposes and are not limited thereto. The bus 400 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 4 only a thick line is used to represent it in, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 401 can also be called a controller, and the name is not limited.

[0132] In the embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401. The at least one processor 401 can execute the color correction method described above by executing the instructions stored in the memory 402. The processor 401 can implement Figure 3 the functions of each module in the system shown.

[0133] Among them, the processor 401 is the control center of the device, and can connect various parts of the entire control device through various interfaces and lines. By running or executing the instructions stored in the memory 402 and calling the data stored in the memory 402, various functions of the device and process data, so as to monitor the device as a whole.

[0134] In a possible design, the processor 401 may include one or more processing units. The processor 401 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 401 either. In some embodiments, the processor 401 and the memory 402 may be implemented on the same chip, and in some embodiments, they may also be separately implemented on independent chips.

[0135] The processor 401 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the color correction method disclosed in combination with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.

[0136] As a non-volatile computer-readable storage medium, the memory 402 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 402 may include at least one type of storage medium. For example, it may include flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, and so on. The memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 402 in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.

[0137] By programming the design of the processor 401, the code corresponding to the color correction method introduced in the foregoing embodiments can be solidified into the chip, so that the chip can execute when running Figure 1Steps of the color correction method of the illustrated embodiment. How to design and program the processor 401 is a well-known technique to those skilled in the art and will not be elaborated here.

[0138] Based on the same inventive concept, an embodiment of the present application also provides a storage medium storing computer instructions that, when run on a computer, cause the computer to execute the color correction method discussed above.

[0139] In some possible implementation manners, each aspect of the color correction method provided in the present application may also be implemented in the form of a program product, which includes program code that, when the program product runs on a device, is used to cause the control device to execute the steps in the color correction method according to various exemplary embodiments of the present application described above in this specification.

[0140] Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0142] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more flows and / or blocks Figure 1 one or more blocks.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the steps specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps for implementing the functions specified in one block or a plurality of blocks.

[0144] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to cover these changes and modifications.

Claims

1. A color correction method, characterized in that, The method includes: In a set scenario, extract the original images collected by the image sensor at various color temperatures, compare the original images with a standard image color card respectively, and estimate the color temperature value corresponding to the original images; Establish a mapping relationship between the color temperature value and the first original color correction data to obtain a first original color correction data set; Establish a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain a second original color correction data set; Classify the color correction data in the first original color correction data set and the second original color correction data set according to different color temperature values and different dynamic ranges to obtain the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively; Obtain the current image currently collected by the image sensor, and calculate the color temperature value of the current image based on a preset color temperature estimation algorithm; Based on the color temperature value, select the first original color correction data set and the second original color correction data set corresponding to the color temperature value from a preset original color correction data set, wherein the second original color correction data included in the second original color correction data set represents the degree of adjustment of the brightness corresponding to the current dynamic range of the image sensor; In the second original color correction data set, search for and filter out the second original color correction data value that meets the color temperature value and the dynamic range, and extract the second target color correction data value corresponding to the color temperature value and the dynamic range in the image sensor; Calculate the color correction coefficient of the image based on the second original color correction data value and the second target color correction data value; Correct the first original color correction data included in the first original color correction data set based on the color correction coefficient.

2. The method according to claim 1, characterized in that, Obtain the current image currently collected by the image sensor, and calculate the color temperature value of the current image based on a preset color temperature estimation algorithm, including: Calculate the first white balance gain value of the current image according to a preset white balance calculation formula; Based on the first white balance gain value of the current image and the second white balance gain values corresponding to the original images at preset color temperatures in the set scenario, calculate the distance deviation between the first white balance gain value and the second white balance gain values; Determine the color temperature value of the current image according to the distance deviation.

3. The method according to claim 1, characterized in that, In the second original color correction data set, search for and filter out the second original color correction data value that meets the color temperature value and the dynamic range, and extract the second target color correction data value corresponding to the color temperature value and the dynamic range in the image sensor, including: Extract the respective color channel values in the image sensor; Based on the respective color channel values, filter the respective color channel values according to a preset brightness threshold range to obtain respective color channel filter values; According to the respective color channel screening values, search for the corresponding second original color correction data values and second target color correction data values in the second original color correction data set and the second target color correction data set respectively.

4. The method according to claim 1, wherein Based on the color correction coefficient, correct the first original color correction data included in the first original color correction data set, including: Perform a multiplication operation on the color correction coefficient and the first original color correction data included in the first original color correction data set to obtain the corrected first original color correction data; Perform normalization processing on the corrected first original color correction data to obtain the first target color correction data.

5. A color correction system, characterized in that, Including: A data acquisition module, configured to extract the original images collected by an image sensor at various color temperatures in a set scene, compare the original images with a standard image color card respectively, and estimate the color temperature values corresponding to the original images; Establish a mapping relationship between the color temperature values and the first original color correction data to obtain the first original color correction data set; Establish a mapping relationship between the dynamic range of the image sensor and the second original color correction data to obtain the second original color correction data set; Classify the color correction data in the first original color correction data set and the second original color correction data set according to different color temperature values and different dynamic ranges to obtain the first original color correction data and the second original color correction data corresponding to each color temperature and each dynamic range respectively; A data acquisition module, configured to acquire the current image currently collected by the image sensor, and calculate the color temperature value of the current image based on a preset color temperature estimation algorithm; A data search module, configured to select the first original color correction data set and the second original color correction data set corresponding to the color temperature value from a preset original color correction data set based on the color temperature value, wherein the second original color correction data included in the second original color correction data set represents the degree of adjustment of the brightness corresponding to the current dynamic range of the image sensor; In the second original color correction data set, search for and screen out the second original color correction data values that meet the color temperature value and the dynamic range, and extract the second target color correction data values corresponding to the color temperature value and the dynamic range in the image sensor; A color correction module, configured to calculate the color correction coefficient of the image based on the second original color correction data value and the second target color correction data value; Based on the color correction coefficient, correct the first original color correction data included in the first original color correction data set.

6. The system according to claim 5, wherein The data search module is specifically configured to: Extract the respective color channel values in the image sensor; Based on the respective color channel values, screen the respective color channel values according to a preset brightness threshold range to obtain the respective color channel screening values; According to the respective color channel screening values, search for the corresponding second original color correction data values and second target color correction data values in the second original color correction data set and the second target color correction data set respectively.

7. An electronic device, characterized in that, Including: A memory for storing a computer program; A processor for implementing the method steps described in any one of claims 1-4 when executing the computer program stored on the memory.

8. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any one of claims 1-4 are implemented.

Citation Information

Patent Citations

  • Color correction matrix determination method and device, color correction method and device and storage medium

    CN114827565A