A color correction matrix adjustment method, device, terminal and storage medium

By fitting the equivalent gamma correction curve and the preset gamma correction curve, the wide dynamic gamma correction curve and the color correction matrix are determined, which solves the problem of the color difference between the image and the human eye in the wide dynamic mode and achieves an image closer to the human eye. Vision image processing.

CN114885143BActive Publication Date: 2024-09-27ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210303562.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-24
Publication Date
2024-09-27
Estimated Expiration
2042-03-24

AI Technical Summary

Technical Problem

There is a color difference between the image collected by the existing technology in the wide dynamic range mode and the image obtained by the human eye.

Method used

By using the original RGB data information and preprocessed RGB data information of the target image to fit the equivalent gamma correction curve, combined with the preset gamma correction curve in the wide dynamic mode, the wide dynamic gamma correction curve is determined, and the curve is used to The original RGB data information is converted to obtain wide dynamic RGB data information and linear RGB data information. Based on this information, the wide dynamic color correction matrix is ​​determined, and then processed to reduce color differences.

Benefits of technology

In wide dynamic mode, the wide dynamic color correction matrix is ​​used to process the original RGB data information, which significantly reduces the color difference with the image obtained by the human eye.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114885143B
    Figure CN114885143B
Patent Text Reader

Abstract

The present invention provides a method, device, terminal and storage medium for adjusting a color correction matrix. The method for adjusting the color correction matrix comprises: using original RGB data information and pre-processed RGB data information of a target image to fit an equivalent gamma correction curve used for color correction processing of the original RGB data information to obtain the pre-processed RGB data information; determining a wide dynamic gamma correction curve in a wide dynamic mode according to the equivalent gamma correction curve and a preset wide dynamic gamma correction curve in a wide dynamic mode; converting the original RGB data information by using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and converting the original RGB data information by using the obtained preset linear gamma correction curve to obtain corresponding linear RGB data information; determining a wide dynamic color correction matrix based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix to reduce the color difference of the image obtained by the human eye.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video surveillance technology, and in particular to a method, device, terminal and computer-readable storage medium for adjusting a color correction matrix. Background Art

[0002] With the development of video surveillance technology, more and more attention is paid to improving image quality. Color is the most important component of image quality. The visual experience presented by its style characteristics usually becomes an important indicator for users to evaluate the quality of video images. At present, the most commonly used method for video color processing is the Color Correction Matrix (CCM). CCM is a color correction method used to correct the difference between the spectral response of the sensor and the human eye, which can make the video image closer to the physical world seen by the human eye.

[0003] The existing CCM is generally calibrated in advance at three color temperatures: high, medium, and low. A set of target CCMs are used in real time in the device. The device estimates the color temperature value of the current monitoring screen through an algorithm, and then interpolates to find the corresponding CCM for use in the device. In actual use, the action of quantifying and calibrating the CCM in advance is to achieve the unification of the color style of the debugged device and the target device. During the debugging process, CCM calibration is often performed in a linear mode, and the calibration results are directly reused in the wide dynamic mode. However, when the CCM calibrated in the linear mode is used to process image data in the traditional wide dynamic mode, there is still a color difference between the image obtained and the image obtained by the human eye. Summary of the invention

[0004] The main technical problem solved by the present invention is to provide a method, device, terminal and computer-readable storage medium for adjusting a color correction matrix, so as to solve the problem in the prior art that there is a color difference between an image captured in a wide dynamic range mode and an image obtained by the human eye.

[0005] In order to solve the above technical problems, the first technical solution adopted by the present invention is: to provide a method for adjusting a color correction matrix, the method for adjusting the color correction matrix comprising: using the original RGB data information and the pre-processed RGB data information of the target image to fit an equivalent gamma correction curve used for color correction processing of the original RGB data information to obtain the pre-processed RGB data information; determining the wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset wide dynamic gamma correction curve in the wide dynamic mode; converting the original RGB data information using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and converting the original RGB data information using the obtained preset linear gamma correction curve to obtain corresponding linear RGB data information; determining the wide dynamic color correction matrix based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix.

[0006] The method uses the original RGB data information and the pre-processed RGB data information of the target image to fit an equivalent gamma correction curve used to perform color correction on the original RGB data information to obtain the pre-processed RGB data information, including: obtaining the original RGB data information and the pre-processed RGB data information of the target image; wherein the original RGB data information is subjected to color correction to obtain the pre-processed RGB data information; performing color space conversion on the original RGB data information and the pre-processed RGB data information respectively to obtain a first color space corresponding to the original RGB data information and a second color space corresponding to the pre-processed RGB data information; performing brightness separation on the first color space and the second color space respectively to obtain first brightness information corresponding to the first color space and second brightness information corresponding to the second color space; and fitting an equivalent gamma correction curve based on the first brightness information and the second brightness information.

[0007] The color space conversion is performed on the original RGB data information and the pre-processed RGB data information respectively, including: performing LAB color space conversion on the original RGB data information and the pre-processed RGB data information respectively.

[0008] The equivalent gamma correction curve is fitted based on the first brightness information and the second brightness information, including: using the least square method to determine the coefficient array of the fitting curve based on the first brightness information and the second brightness information; and determining the equivalent gamma correction curve based on the coefficient array.

[0009] Wherein, determining the wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset wide dynamic gamma correction curve in the wide dynamic mode includes: determining the wide dynamic gamma correction curve in the wide dynamic mode based on the following formula;

[0010] comp_gamma(i)=wdr_isp_gamma(equ_gamma(i))

[0011] In the formula: comp_gamma is the wide dynamic gamma correction curve in wide dynamic mode; wdr_isp_gamma is the preset wide dynamic gamma correction curve in wide dynamic mode; equ_gamma is the equivalent gamma correction curve.

[0012] Wherein, based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix, determining the wide dynamic color correction matrix includes: determining the wide dynamic color correction matrix based on the following formula;

[0013]

[0014] In the formula: CCM is the wide dynamic color correction matrix; CCM1 is the linear color correction matrix; sourceRGB is the linear RGB data information; targetRGB is the wide dynamic RGB data information; []' represents the transposition in the matrix operation.

[0015] Wherein, based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix, a wide dynamic color correction matrix is ​​determined, and then the method further includes: normalizing the wide dynamic color correction matrix.

[0016] In order to solve the above technical problems, the second technical solution adopted by the present invention is: to provide an adjustment device for a color correction matrix, and the adjustment device for the color correction matrix includes: a fitting module, which is used to use the original RGB data information and the pre-processed RGB data information of the target image to fit an equivalent gamma correction curve used for color correction processing of the original RGB data information to obtain the pre-processed RGB data information; a compensation module, which is used to determine the wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset wide dynamic gamma correction curve in the wide dynamic mode; a conversion module, which is used to convert the original RGB data information using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and to convert the original RGB data information using the obtained preset linear gamma correction curve to obtain corresponding linear RGB data information; an adjustment module, which is used to determine the wide dynamic color correction matrix based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix.

[0017] In order to solve the above technical problems, the third technical solution adopted by the present invention is: to provide a terminal, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor is used to execute program data to implement the steps in the above-mentioned color correction matrix adjustment device method.

[0018] In order to solve the above technical problems, the fourth technical solution adopted by the present invention is: providing a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned color correction matrix adjustment device method are implemented.

[0019] The beneficial effects of the present invention are as follows: different from the prior art, a method, device, terminal and computer-readable storage medium for adjusting a color correction matrix are provided. The method for adjusting the color correction matrix is ​​based on the original RGB data information of the target image and the preprocessed RGB data information after preprocessing the original RGB data information to fit the equivalent gamma correction curve used in the preprocessing process, and then the wide dynamic gamma correction curve in the wide dynamic mode is calculated according to the equivalent gamma correction curve and the preset correction curve in the wide dynamic mode. The wide dynamic RGB data information obtained by processing the original RGB data information according to the gamma correction curve in the wide dynamic mode, the linear RGB data information obtained by processing the original RGB data information according to the preset linear gamma correction curve in the linear mode, and the correspondence between the color correction matrix in the linear mode and the wide dynamic color correction matrix in the wide dynamic mode are determined, so as to realize that the wide dynamic color correction matrix is ​​used to process the acquired original RGB data information in the wide dynamic mode, so as to reduce the color difference of the image obtained by the human eye. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0021] Figure 1 is an RGB spectral response curve of a sensor in the prior art;

[0022] Figure 2 is an RGB spectral response curve of the human eye in the prior art;

[0023] Figure 3 It is a flowchart of a method for adjusting a color correction matrix provided by the present invention;

[0024] Figure 4 yes Figure 3 A flowchart of a specific embodiment of step S1 in the color correction matrix adjustment method provided;

[0025] Figure 5 yes Figure 4A flowchart of a specific embodiment of step S14 in the color correction matrix adjustment method provided;

[0026] Figure 6 It is a node block diagram of the existing mainstream ISP processing flow nodes;

[0027] Figure 7 It is a structural block diagram of the adjustment device of the color correction matrix provided by the present invention;

[0028] Figure 8 is a schematic block diagram of an implementation manner of a terminal provided by the present invention;

[0029] Fig. 9 It is a schematic block diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0030] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0031] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0032] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0033] In order to enable those skilled in the art to better understand the technical solution of the present invention, a method for adjusting a color correction matrix provided by the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0034] There are currently three commonly used working modes for cameras, including: linear mode, digital wide dynamic mode and true wide dynamic mode.

[0035] Linear mode is when the sensor in the camera operates at normal exposure.

[0036] The digital wide dynamic mode means that the camera works in the linear mode, but in order to improve the dynamic range, the relevant algorithm module in the ISP (Internet Service Provider) module that can improve the dynamic range is superimposed.

[0037] The real wide dynamic mode means that the sensor in the camera outputs two or more frames of data at the same time. Taking the common two-frame data as an example, generally, a frame with an exposure time of more than 1ms is a long frame; a frame with an exposure time of less than 1ms is a short frame. Long frames can show the details of the dark part of the scene, and short frames can show the details of the bright part of the scene. In the real wide dynamic mode, the long and short frames will be merged and output in the end.

[0038] In this application, the digital wide dynamic mode and the real wide dynamic mode are collectively referred to as the wide dynamic mode.

[0039] At present, the most commonly used method for video color processing is CCM, which is a color correction method used to correct the difference between the sensor and the human eye in spectral response, and can make the video image closer to the physical world seen by the human eye. Figure 1 is an RGB spectral response curve of a sensor in the prior art, such as Figure 2 It is an RGB spectral response curve of the human eye in the prior art. Among them, the RGB spectral response curves of the sensor and the human eye are inconsistent, and the video image will have color deviation after white balance processing, so it is necessary to correct the color matrix, that is, CCM correction. The correction formula of the color matrix is ​​shown in Formula 1, where CCM is a 3×3 matrix, and CCM is multiplied by the RGB channel statistics of the image before color adjustment to obtain the R′G′B′ channel value of the image after color adjustment.

[0040]

[0041] In the process of quantitatively calibrating CCM, the elements that need to be used are the gamma curve. The gamma curve used in the offline mode is not the same as the gamma curve in the real wide dynamic mode, and the gamma curve is one of the factors that directly affect the calibration result of CCM. In the prior art, the gamma curve in the linear mode is generally used in the wide dynamic mode. In the traditional wide dynamic mode, there is a phenomenon that there is a color difference between the image obtained by processing the image data using the CCM calibrated in the linear mode and the image obtained by the human eye. The adjustment method based on the color correction matrix provided in the present application can calibrate the CCM in the wide dynamic range mode, thereby reducing the color difference between the images obtained by the sensor and the human eye.

[0042] See also Figure 3 , Figure 3 1 is a flow chart of a method for adjusting a color correction matrix provided by the present invention. In this embodiment, a method for adjusting a color correction matrix is ​​provided, and the method is applicable to acquiring an image in a wide dynamic mode. The wide dynamic mode includes a digital wide dynamic and a real wide dynamic. The method for adjusting the color correction matrix includes the following steps.

[0043] S1: using the original RGB data information and the pre-processed RGB data information of the target image, fitting an equivalent gamma correction curve used to obtain the pre-processed RGB data information by color correction processing of the original RGB data information.

[0044] See also Figure 4 , Figure 4 yes Figure 3 A flowchart of a specific embodiment of step S1 in a method for adjusting a color correction matrix is ​​provided.

[0045] Specifically, based on the original RGB data information and the pre-processed RGB data information of the target image, the specific steps of determining the equivalent gamma correction curve used in the pre-processing process are as follows.

[0046] S11: Obtaining original RGB data information and pre-processed RGB data information of the target image.

[0047] Specifically, the target area is imaged by an image acquisition device to obtain the original RGB data information of the target image. The RGB data information includes a numerical table of three RGB channels. The image acquisition device processes the original RGB data information based on a load preprocessing module to reduce the difference between the color of the image acquired by the image acquisition device and the real color of the target. Specifically, the original RGB data information is color corrected to obtain the preprocessed RGB data information.

[0048] In a specific embodiment, the image acquisition device includes a dynamic range module, which is used to achieve dynamic range stretching, brighten low darks and darken high brights in the current image. The original RGB data information is the RGB data information obtained without the dynamic range module; the pre-processed RGB data information is the RGB data information obtained after the dynamic range module.

[0049] S12: performing color space conversion on the original RGB data information and the pre-processed RGB data information respectively to obtain a first color space corresponding to the original RGB data information and a second color space corresponding to the pre-processed RGB data information.

[0050] Specifically, since the image acquisition device creates the color of the target area based on the RGB color mode, but human vision is actually more sensitive to brightness than color. Therefore, in order to reduce the color difference between the image acquired by the image acquisition device and the image seen by the human eye, the original RGB data information and the pre-processed RGB data information need to be converted into color space respectively. The RGB data information can be converted into LAB color space, HSB color space, YUV color space or CMYK color space, etc.

[0051] In one embodiment, in order to make the image captured by the image acquisition device closer to the color of the image seen by the human eye, the original RGB data information and the pre-processed RGB data information are respectively converted into LAB color space, thereby obtaining a first color space corresponding to the original RGB data information and a second color space corresponding to the pre-processed RGB data information.

[0052] In a specific embodiment, the color space of the RGB three-channel is first converted into the XYZ space, and then the value of the XYZ space is converted into the LAB space.

[0053] Specifically, based on Formula 2, the color space of the RGB three channels is converted into data information of the XYZ space.

[0054] X=var_R*0.4124+var_G*0.3576+var_B*0.1805

[0055] Y=var_R*0.2126+var_G*0.7152+var_B*0.0722

[0056] Z=var_R*0.0193+var_G*0.1192+var_B*0.9505 (Formula 2)

[0057] Then, the data information of the XYZ space is converted into the data information of the LAB color space based on Formula 3. n , Y n , Z n Set them to 95.047, 100, and 108.883 respectively, or you can set them according to actual conditions.

[0058]

[0059]

[0060]

[0061] S13: Perform brightness separation on the first color space and the second color space respectively to obtain first brightness information corresponding to the first color space and second brightness information corresponding to the second color space.

[0062] Specifically, the first color space corresponding to the original RGB data information in the above step S12 includes a brightness component (L component), a red to green color component (a component) and a red to blue color component (b component). Since the human eye is sensitive to the brightness information in the target image, in order to reduce the color difference between the image captured by the image acquisition device and the image observed by the human eye, the brightness component in the first color space corresponding to the original RGB data information is extracted as the first brightness information, and the brightness component in the second color space corresponding to the pre-processed RGB data information is extracted as the second brightness information. The first brightness information and the second brightness information are both one-dimensional data. The first brightness information is the unprocessed brightness information, and the second brightness information is the brightness information processed by the dynamic range module.

[0063] S14: Based on the first brightness information and the second brightness information, an equivalent gamma correction curve is obtained by fitting.

[0064] See also Figure 5 , Figure 5 yes Figure 4 A flowchart of a specific embodiment of step S14 in a method for adjusting a color correction matrix is ​​provided.

[0065] Specifically, the specific steps of fitting the equivalent gamma correction curve used in the preprocessing process based on the brightness information to which the human eye is relatively sensitive are as follows.

[0066] S141: Determine a coefficient array of a fitting curve based on the first brightness information and the second brightness information using a least square method.

[0067] Specifically, the least squares method is used for fitting to make the first brightness information closer to the second brightness information. In one embodiment, multiple brightness information corresponding to the same pixel are selected from the first brightness information and the second brightness information, and the plotfit function is called on matlab for fitting to obtain the fitting operator γ. Among them, the fitting operator γ is a one-dimensional array, which represents each coefficient in the n-order equation. For example, if the fitting uses a 4-order equation, γ is an array of 5 data, γ = [a, b, c, d, e]. If the fitting uses a 5-order equation, γ is an array of 6 data, γ = [a, b, c, d, e, f].

[0068] S142: Determine an equivalent gamma correction curve based on the coefficient array.

[0069] Specifically, the obtained γ=[a, b, c, d, e] is substituted into the 4th order equation to obtain the equivalent gamma curve y=a*x^4+b*x^3+c*x^2+d*x+e, where the value range of x and y is [0, 255].

[0070] In this embodiment, an equivalent gamma correction curve is proposed to replace the expression of the dynamic range of the picture achieved by adjusting the dynamic range in the wide dynamic mode between different platforms.

[0071] S2: determining a wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and a preset wide dynamic gamma correction curve in the wide dynamic mode.

[0072] See also Figure 6 , Figure 6 This is a node block diagram of the existing mainstream ISP processing flow nodes. In the existing mainstream ISP processing flow, there are three process nodes, including dynamic range module, CCM and ISP Gamma (ISP gamma correction curve). When the image acquisition device works in pure linear mode, the parameters of the dynamic range module are generally turned off, leaving only the CCM and ISP Gamma modules. When the image acquisition device works in wide dynamic mode, the parameters of the dynamic range module will be enabled, followed by the CCM and ISP Gamma modules. In other words, in wide dynamic mode, in addition to using the gamma curve, in order to achieve the improvement of the dynamic range under true wide dynamic, the ISP's own dynamic range adjustment module will also be used to adjust the dynamic range to achieve the effect of suppressing the highlights of the picture and brightening the low darks.

[0073] Specifically, a wide dynamic gamma correction curve in the wide dynamic mode is determined based on Formula 4;

[0074] comp_gamma(i)=wdr_isp_gamma(equ_gamma(i)) (Formula 4)

[0075] In Formula 4, comp_gamma is the wide dynamic gamma correction curve in the wide dynamic mode; wdr_isp_gamma is the preset wide dynamic gamma correction curve in the wide dynamic mode; equ_gamma is the equivalent gamma correction curve.

[0076] Among them, gamma is a two-dimensional array, which represents a mapping relationship between data input and output, and i represents input.

[0077] S3: converting the original RGB data information using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and converting the original RGB data information using the obtained preset linear gamma correction curve to obtain corresponding linear RGB data information.

[0078] Specifically, the wide dynamic gamma correction curve and the preset linear gamma correction curve actually correspond to their own two-dimensional lookup tables, the horizontal coordinate is the input value, and the vertical coordinate is the output value. The original RGB data information is used as the input value, and the wide dynamic RGB data information corresponding to the original RGB data information is searched and output in the two-dimensional lookup table corresponding to the wide dynamic gamma correction curve. The original RGB data information is used as the input, and the linear RGB data information corresponding to the original RGB data information is searched and output in the two-dimensional lookup table corresponding to the preset linear gamma correction curve.

[0079] In a specific embodiment, the wide dynamic range RGB data information and the linear RGB data information are both a matrix composed of multiple three-dimensional arrays, and the dimensions of the matrices of the two are the same. There are as many groups of data as there are blocks of the scene corresponding to the image acquisition device.

[0080] S4: Determine a wide dynamic range color correction matrix based on the wide dynamic range RGB data information, the linear RGB data information and the linear color correction matrix.

[0081] Specifically, the wide dynamic color correction matrix is ​​determined based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix through Formula 5;

[0082]

[0083] In Formula 5, CCM is a wide dynamic color correction matrix; CCM1 is a linear color correction matrix; sourceRGB is linear RGB data information; targetRGB is wide dynamic RGB data information; []' represents transposition in matrix operations.

[0084] In one embodiment, the wide dynamic color correction matrix is ​​normalized to obtain a final wide dynamic color correction matrix. Specifically, the calculated wide dynamic color correction matrix is ​​a 3*3 matrix result, for example, In order to ensure the normalization of the matrix, c can be constrained 02 =1-c 00 -c 01 , c 12 =1-c 10 -c 11 , c 22 =1-c 20 -c 21 The normalization process of the wide dynamic color correction matrix can also be achieved by other methods.

[0085] The color correction matrix adjustment method provided in the present embodiment is based on the original RGB data information of the target image and the preprocessed RGB data information after preprocessing the original RGB data information to fit the equivalent gamma correction curve used in the preprocessing process, and then the wide dynamic gamma correction curve in the wide dynamic mode is calculated according to the equivalent gamma correction curve and the preset correction curve in the wide dynamic mode. The wide dynamic RGB data information obtained by processing the original RGB data information according to the gamma correction curve in the wide dynamic mode, the linear RGB data information obtained by processing the original RGB data information according to the preset linear gamma correction curve in the linear mode, and the correspondence between the color correction matrix in the linear mode and the wide dynamic color correction matrix in the wide dynamic mode are determined, so as to realize that the acquired original RGB data information is processed by using the wide dynamic color correction matrix in the wide dynamic mode, so as to reduce the color difference of the image obtained by the human eye.

[0086] See also Figure 7 , Figure 7 This embodiment provides a color correction matrix adjustment device 60, which includes a fitting module 61, a compensation module 62, a conversion module 63 and an adjustment module 64.

[0087] The fitting module 61 is used to fit the original RGB data information and the pre-processed RGB data information of the target image to obtain an equivalent gamma correction curve used for color correction processing of the original RGB data information to obtain the pre-processed RGB data information;

[0088] The compensation module 62 is used to determine a wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset wide dynamic gamma correction curve in the wide dynamic mode;

[0089] The conversion module 63 is used to convert the original RGB data information using the wide dynamic gamma correction curve to obtain the corresponding wide dynamic RGB data information, and to convert the original RGB data information using the acquired preset linear gamma correction curve to obtain the corresponding linear RGB data information;

[0090] The adjustment module 64 is used to determine a wide dynamic range color correction matrix based on the wide dynamic range RGB data information, the linear RGB data information and the linear color correction matrix.

[0091] In the color correction matrix adjustment device provided by the present embodiment, the fitting module fits the equivalent gamma correction curve used in the preprocessing process based on the original RGB data information of the target image and the preprocessed RGB data information after preprocessing the original RGB data information, the compensation module calculates the wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset correction curve in the wide dynamic mode, and the adjustment module determines the wide dynamic color correction matrix in the wide dynamic mode according to the wide dynamic RGB data information obtained by processing the original RGB data information with the gamma correction curve in the wide dynamic mode, the linear RGB data information obtained by processing the original RGB data information with the preset linear gamma correction curve in the linear mode, and the correspondence between the color correction matrix in the linear mode and the wide dynamic color correction matrix in the wide dynamic mode, so as to realize that the acquired original RGB data information is processed by using the wide dynamic color correction matrix in the wide dynamic mode, thereby reducing the color difference of the image obtained by the human eye.

[0092] See also Figure 8 , Figure 8 1 is a schematic block diagram of an embodiment of a terminal provided by the present invention. The terminal 70 in this embodiment includes: a processor 71, a memory 72, and a computer program stored in the memory 72 and executable on the processor 71. When the computer program is executed by the processor 71, the method for adjusting the color correction matrix described above is implemented. To avoid repetition, it is not described one by one here.

[0093] See also Fig. 9 , Fig. 9 It is a schematic block diagram of an embodiment of a computer-readable storage medium provided by the present invention.

[0094] In an embodiment of the present application, a computer-readable storage medium 90 is further provided. The computer-readable storage medium 90 stores a computer program 901. The computer program 901 includes program instructions. The processor executes the program instructions to implement the color correction matrix adjustment method provided in the embodiment of the present application.

[0095] The computer-readable storage medium 90 may be an internal storage unit of the computer device of the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium 90 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device.

[0096] The above are only implementation modes of the present invention, and are not intended to limit the patent protection scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for adjusting a color correction matrix, characterized in that: The adjustment method comprises: Using the original RGB data information and the pre-processed RGB data information of the target image, fitting an equivalent gamma correction curve used to obtain the pre-processed RGB data information by performing color correction processing on the original RGB data information; Determining a wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and a preset wide dynamic gamma correction curve in the wide dynamic mode; The original RGB data information is converted using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and the original RGB data information is converted using the obtained preset linear gamma correction curve to obtain corresponding linear RGB data information; Determine a wide dynamic color correction matrix based on the wide dynamic RGB data information, the linear RGB data information and the linear color correction matrix; The method of fitting an equivalent gamma correction curve used for obtaining the pre-processed RGB data information by performing color correction processing on the original RGB data information using the original RGB data information and the pre-processed RGB data information of the target image comprises: Acquire original RGB data information and pre-processed RGB data information of a target image; wherein the original RGB data information is subjected to color correction to obtain the pre-processed RGB data information; Performing color space conversion on the original RGB data information and the pre-processed RGB data information respectively to obtain a first color space corresponding to the original RGB data information and a second color space corresponding to the pre-processed RGB data information; Performing brightness separation on the first color space and the second color space respectively to obtain first brightness information corresponding to the first color space and second brightness information corresponding to the second color space; The equivalent gamma correction curve is obtained by fitting based on the first brightness information and the second brightness information.

2. The adjustment method according to claim 1, characterized in that: The color space conversion of the original RGB data information and the pre-processed RGB data information respectively includes: The original RGB data information and the pre-processed RGB data information are respectively converted into LAB color space.

3. The adjustment method according to claim 1, characterized in that: The fitting to obtain the equivalent gamma correction curve based on the first brightness information and the second brightness information includes: Determine a coefficient array of a fitting curve based on the first brightness information and the second brightness information using a least square method; The equivalent gamma correction curve is determined based on the coefficient array.

4. The adjustment method according to claim 1, characterized in that: The step of determining the wide dynamic gamma correction curve in the wide dynamic mode according to the equivalent gamma correction curve and the preset wide dynamic gamma correction curve in the wide dynamic mode includes: Determine the wide dynamic gamma correction curve in the wide dynamic mode based on the following formula; comp_gamma(i)=wdr_isp_gamma(equ_gamma(i)) In the formula: comp_gamma is the wide dynamic gamma correction curve in wide dynamic mode; wdr_isp_gamma is the preset wide dynamic gamma correction curve in wide dynamic mode; equ_gamma is the equivalent gamma correction curve.

5. The adjustment method according to claim 1, characterized in that: The determining of a wide dynamic range color correction matrix based on the wide dynamic range RGB data information, the linear RGB data information and the linear color correction matrix comprises: Determine the wide dynamic color correction matrix based on the following formula; In the formula: CCM is the wide dynamic color correction matrix; CCM1 is the linear color correction matrix; sourceRGB is the linear RGB data information; targetRGB is the wide dynamic RGB data information; []' represents the transposition in the matrix operation.

6. The adjustment method according to claim 1, characterized in that: The step of determining a wide dynamic range color correction matrix based on the wide dynamic range RGB data information, the linear RGB data information and the linear color correction matrix further comprises: The wide dynamic range color correction matrix is ​​normalized.

7. A color correction matrix adjustment device, characterized in that: The adjusting device comprises: A fitting module, used to fit the original RGB data information and the pre-processed RGB data information of the target image to obtain an equivalent gamma correction curve used for color correction processing of the original RGB data information to obtain the pre-processed RGB data information; A compensation module, configured to determine a wide dynamic gamma correction curve in a wide dynamic mode according to the equivalent gamma correction curve and a preset wide dynamic gamma correction curve in a wide dynamic mode; A conversion module, used to convert the original RGB data information using the wide dynamic gamma correction curve to obtain corresponding wide dynamic RGB data information, and to convert the original RGB data information using the acquired preset linear gamma correction curve to obtain corresponding linear RGB data information; An adjustment module, configured to determine a wide dynamic range color correction matrix based on the wide dynamic range RGB data information, the linear RGB data information and the linear color correction matrix; The fitting module is further used to obtain original RGB data information and pre-processed RGB data information of the target image; wherein the original RGB data information is subjected to color correction to obtain the pre-processed RGB data information; the original RGB data information and the pre-processed RGB data information are respectively converted into color spaces to obtain a first color space corresponding to the original RGB data information and a second color space corresponding to the pre-processed RGB data information; the first color space and the second color space are respectively separated in brightness to obtain first brightness information corresponding to the first color space and second brightness information corresponding to the second color space; based on the first brightness information and the second brightness information, the equivalent gamma correction curve is fitted.

8. A terminal, characterized in that: The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor is used to execute program data to implement the steps in the method for adjusting the color correction matrix according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method for adjusting the color correction matrix according to any one of claims 1 to 6 are implemented.