Image color matrix automatic optimization processing method and device

By automating the processing of the camera's color matrix, the problem of low efficiency in manual modification in existing technologies is solved, and automatic optimization and efficient adjustment of camera image quality are achieved.

CN116156137BActive Publication Date: 2026-04-17BEIJING KANKAN INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING KANKAN INTELLIGENT TECH CO LTD
Filing Date
2022-12-23
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In the current technology, the modification of the color matrix in the process of optimizing camera image quality usually relies on manual operation, which leads to low efficiency and difficulty in popularization.

Method used

By acquiring test color chart images, the color matrix, standard color matrix, and color difference correction matrix are determined. The color matrix is ​​then automatically optimized using a series of mathematical formulas and preset models, including multi-level weight matrix processing and coordinate transformation, until the preset saturation and correction model are met.

Benefits of technology

It enables automatic optimization of camera image quality, improves work efficiency, and makes operation simpler and more adaptable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116156137B_ABST
    Figure CN116156137B_ABST
Patent Text Reader

Abstract

This invention relates to an automatic image color matrix optimization processing method and apparatus. The method includes: acquiring a test color chart image; determining a first color matrix corresponding to the test color chart image, a standard color matrix corresponding to a standard color chart image, and a color difference correction matrix; processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain a first correction matrix; determining a first saturation corresponding to the first correction matrix; processing the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix; and determining the second correction matrix as the target color matrix corresponding to the test color chart image. Therefore, this invention can automatically adjust the color matrix in terms of chroma and saturation, ensuring the image quality of the camera meets requirements, improving work efficiency, and is easy to operate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of camera technology, and in particular to an automatic image color matrix optimization processing method and apparatus. Background Technology

[0002] In today's information age, cameras play a vital role in daily life and work. In particular, automotive cameras are crucial for autonomous driving technology, and the image quality requirements for these cameras are constantly increasing. To ensure image quality, it's essential to test the cameras to guarantee they meet the necessary specifications. The color matrix significantly impacts image quality, so it's typically modified to achieve the desired results. However, currently, color matrix modifications are usually done manually by designated personnel, followed by image quality verification based on the modified matrix. This not only impacts work efficiency but also requires specialized personnel for modification, making it difficult for others to perform the necessary adjustments. Summary of the Invention

[0003] In view of this, in order to solve the above-mentioned technical problems or some of the technical problems, the present invention provides an image color matrix automatic optimization processing method and apparatus.

[0004] In a first aspect, embodiments of the present invention provide an automatic image color matrix optimization processing method, comprising:

[0005] Obtain the test color chart image;

[0006] Determine the first color matrix corresponding to the test color chart image, the standard color matrix corresponding to the standard color chart image, and the color difference correction matrix;

[0007] The first color matrix is ​​processed using the standard color matrix and the color difference correction matrix to obtain the first correction matrix;

[0008] Determine the first saturation corresponding to the first correction matrix;

[0009] The first correction matrix is ​​processed using the first saturation and the preset saturation to obtain the second correction matrix;

[0010] The second correction matrix is ​​processed using a preset set of correction models to obtain the third correction matrix;

[0011] The third correction matrix is ​​determined as the target color matrix corresponding to the test color chart image.

[0012] In an optional implementation, determining the color difference correction matrix includes:

[0013] The first color error, the second color error, and the third color error corresponding to the test color chart image are determined; wherein, the first color error is used to characterize the color error including brightness, the second color error is used to characterize the color error not including brightness, and the third color error is used to characterize the chromaticity error.

[0014] The first color error, the second color error, and the third color error are processed using the first preset weight matrix corresponding to the test color card image to obtain the first error matrix;

[0015] The first error matrix is ​​processed using the second preset weight matrix to obtain the second error matrix;

[0016] Based on the second error matrix, determine the color difference correction matrix.

[0017] In an optional implementation, processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain the first correction matrix includes:

[0018] The standard color matrix, the color difference correction matrix, and the first color matrix are input into the first correction formula to obtain the first correction matrix; wherein, the first correction formula includes:

[0019] A1=(I T C 2 I) -1 I T C 2 O

[0020] In the above formula, A1 represents the first correction matrix, I represents the first color matrix, C represents the color difference correction matrix, and O represents the standard color matrix.

[0021] In one optional implementation, the test color chart image includes a set of test color blocks, and the preset correction model in the preset correction model set corresponds one-to-one with the test color blocks in the set of test color blocks;

[0022] The process of processing the second correction matrix using a preset set of correction models to obtain the third correction matrix includes:

[0023] For any test color patch in the test color patch set, the first coordinates corresponding to the test color patch are determined according to the second correction matrix, and the third error matrix corresponding to the test color patch is determined according to the first coordinates and the preset correction model corresponding to the test color patch, so as to obtain the third error matrix set corresponding to the test color patch set;

[0024] The second correction matrix is ​​processed according to the third error matrix set to obtain the third correction matrix.

[0025] In an optional implementation, the step of processing the second correction matrix according to the third error matrix set to obtain the third correction matrix includes:

[0026] Determine the sum of the values ​​corresponding to the set of third error matrices to obtain the target third error matrix;

[0027] When the target third error matrix is ​​not zero, the second correction matrix and the target third error matrix are input into the second correction formula to obtain the third correction matrix; wherein, the second correction formula includes:

[0028] A3 = A2 + offset

[0029] In the above formula, A3 represents the third correction matrix, A2 represents the second correction matrix, and offset represents the target third error matrix.

[0030] In an optional implementation, the preset correction model corresponding to one of the test color patches is determined in the following manner:

[0031] Determine the standard color block corresponding to the test color block, and the second coordinate corresponding to the standard color block;

[0032] Based on the second coordinate, determine the third coordinate that satisfies the preset saturation.

[0033] Based on the third coordinate, the pre-set color tolerance, and the elliptic quadratic curve expression, the preset correction model corresponding to the test color block is determined.

[0034] In an optional implementation, determining the third error matrix corresponding to the test color patch based on the first coordinates and the preset correction model corresponding to the test color patch includes:

[0035] Determine the initial error matrix corresponding to the test color patch; wherein, the initial error matrix includes the target error adjustment value to be determined;

[0036] Determine the target positional relationship between the first coordinate and the preset correction model corresponding to the test color block;

[0037] Based on the target position relationship, determine the target error adjustment value;

[0038] The initial error matrix is ​​processed using the target error adjustment value to obtain the third error matrix corresponding to the test color block.

[0039] In an optional implementation, the first error matrix is ​​determined as follows:

[0040] The first preset weight matrix, the first color error, the second color error, and the third color error are input into the first error calculation formula to obtain the first error matrix; wherein, the first error calculation formula includes:

[0041] Error1 = w1 * [ΔEΔCΔH]

[0042] In the above formula, Error1 represents the first error matrix, w1 represents the first preset weight matrix, ΔE represents the first color error, ΔC represents the second color error, and ΔH represents the third color error.

[0043] The second error matrix is ​​determined as follows:

[0044] The second preset weight matrix and the first error matrix are input into the second error calculation formula to obtain the second error matrix; wherein, the second error calculation formula includes:

[0045] Error2 = Error1 * w2

[0046] In the above formula, Error2 represents the second error matrix, and w2 represents the second preset weight matrix;

[0047] The color difference correction matrix is ​​determined in the following manner:

[0048] The second error matrix is ​​input into the third error calculation formula to obtain the color difference correction matrix; wherein, the third error calculation formula includes:

[0049]

[0050] In the above formula, C represents the color difference correction matrix, and ε represents the constant matrix.

[0051] In an optional implementation, processing the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix includes:

[0052] Determine the target difference between the first saturation and the preset saturation;

[0053] When the target difference is greater than or equal to a preset threshold, the first saturation, the preset saturation, and the first correction matrix are input into a third correction formula to obtain a second correction matrix; wherein, the third correction formula includes:

[0054]

[0055] In the above formula, A2 represents the second correction matrix, A1 represents the first correction matrix, Starget represents the preset saturation, and S A1Let E represent the first degree of saturation, and let E represent the constant matrix.

[0056] In a second aspect, embodiments of the present invention provide an image color matrix automatic optimization processing apparatus, comprising:

[0057] The acquisition module is used to acquire the test color chart image;

[0058] The determination module is used to determine the first color matrix corresponding to the test color card image, the standard color matrix corresponding to the standard color card image, and the color difference correction matrix;

[0059] The processing module is used to process the first color matrix using the standard color matrix and the color difference correction matrix to obtain the first correction matrix;

[0060] The determining module is further configured to determine the first saturation corresponding to the first correction matrix;

[0061] The processing module is further configured to process the first correction matrix using the first saturation and the preset saturation to obtain a second correction matrix;

[0062] The processing module is further configured to process the second correction matrix using a preset set of correction models to obtain a third correction matrix;

[0063] The determining module is further configured to determine the third correction matrix as the target color matrix corresponding to the test color card image.

[0064] This invention provides an automatic image color matrix optimization method, comprising: acquiring a test color chart image; determining a first color matrix corresponding to the test color chart image, a standard color matrix corresponding to a standard color chart image, and a color difference correction matrix; processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain a first correction matrix; determining a first saturation corresponding to the first correction matrix; processing the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix; processing the second correction matrix using a preset correction model set to obtain a third correction matrix; and determining the third correction matrix as the target color matrix corresponding to the test color chart image. Through the above method, this invention can automatically adjust the color matrix in the chroma and saturation directions, ensuring that the image quality of the camera meets requirements, improving work efficiency, and being easy to operate. Attached Figure Description

[0065] Figure 1 A flowchart illustrating an automatic image color matrix optimization processing method provided in an embodiment of the present invention;

[0066] Figure 2A schematic diagram of an image color matrix automatic optimization processing device provided in an embodiment of the present invention;

[0067] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention;

[0068] In the attached diagrams above:

[0069] 10. Acquisition Module; 20. Determination Module; 30. Processing Module;

[0070] 400. Electronic device; 401. Processor; 402. Memory; 4021. Operating system; 4022. Application program; 403. User interface; 404. Network interface; 405. Bus system. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0072] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0073] refer to Figure 1 , Figure 1 This is a flowchart illustrating an automatic image color matrix optimization processing method provided in an embodiment of the present invention. The automatic image color matrix optimization processing method provided in this embodiment of the present invention includes the following steps:

[0074] S101: Obtain the test color chart image.

[0075] In this embodiment, a camera is used to photograph the standard color chart image to obtain the corresponding test color chart image. Since the standard color chart image includes 24 color blocks, the test color chart image also includes 24 test color blocks.

[0076] S102: Determine the first color matrix corresponding to the test color card image, the standard color matrix corresponding to the standard color card image, and the color difference correction matrix.

[0077] In this embodiment, the first color matrix is ​​an RGB color matrix, and similarly, the standard color matrix is ​​also an RGB color matrix. The color correction matrix is ​​used to correct the first color matrix in conjunction with the standard color matrix to obtain a color matrix with minimal color difference. Specifically, the color difference correction matrix is ​​determined as follows:

[0078] Determine the first color error, second color error, and third color error corresponding to the test color chart image; wherein, the first color error is used to characterize the color error including brightness, the second color error is used to characterize the color error excluding brightness, and the third color error is used to characterize the chromaticity error.

[0079] The first color error, the second color error, and the third color error are processed using the first preset weight matrix corresponding to the test color card image to obtain the first error matrix;

[0080] The first error matrix is ​​processed using the second preset weight matrix to obtain the second error matrix;

[0081] The color difference correction matrix is ​​determined based on the second error matrix.

[0082] In this embodiment, the first color error ΔE is the average color error of all test color cards in the test color card image, the second color error ΔC is the average color error of all test color cards in the test color card image, and the third color error ΔH is also the average color error of all test color cards in the test color card image. The first color error ΔE, the second color error ΔC, and the third color error ΔH can all be determined using existing technologies, and will not be elaborated upon in this embodiment. After obtaining the first color error, the second color error, and the third color error, they are combined into a matrix. The matrix is ​​then processed using a first preset weight matrix corresponding to the test color card image to obtain the first error matrix. The first preset weight matrix is ​​a 1x24 weight matrix used to characterize the weight of each test color card in the test color card image. The first preset weight matrix can be set according to actual needs; in this embodiment, no specific limitation is made on the first preset weight matrix. After obtaining the first error matrix, it is further processed according to the second preset weight matrix to obtain the second error matrix. A color difference correction matrix is ​​then obtained from the second error matrix. The first color matrix is ​​processed by comparing the color difference correction matrix with the standard color matrix corresponding to the standard color chart image to obtain the color matrix with the smallest color difference. The second preset weight matrix is ​​a 3x1 error weight matrix. This two-level weighting improves the accuracy of the obtained results.

[0083] Specifically, the first error matrix can be determined as follows:

[0084] The first preset weight matrix, the first color error, the second color error, and the third color error are input into the first error calculation formula to obtain the first error matrix; wherein, the first error calculation formula includes:

[0085] Error1 = w1 * [ΔEΔCΔH]

[0086] In the above formula, Error1 represents the first error matrix, w1 represents the first preset weight matrix, ΔE represents the first color error, ΔC represents the second color error, and ΔH represents the third color error.

[0087] More specifically, the formula for calculating the first error can be further expressed as:

[0088]

[0089] In the above formula, N represents the number of test color cards in the test color card image, N = 24.

[0090] The second error matrix is ​​determined as follows:

[0091] The second preset weight matrix and the first error matrix are input into the second error calculation formula to obtain the second error matrix; wherein, the second error calculation formula includes:

[0092] Error2 = Error1 * w2

[0093] In the above formula, Error2 represents the second error matrix, and w2 represents the second preset weight matrix.

[0094] More specifically, the formula for calculating the second error can be further expressed as:

[0095] Error2 = w1 * [ΔEΔCΔH] * w2

[0096]

[0097] The color difference correction matrix is ​​determined as follows:

[0098] The second error matrix is ​​input into the third error calculation formula to obtain the color difference correction matrix; wherein, the third error calculation formula includes:

[0099]

[0100] In the above formula, C represents the color difference correction matrix, and ε represents the constant matrix.

[0101] In this embodiment, the purpose of setting ε is to prevent division by zero.

[0102] S103: Process the first color matrix using the standard color matrix and the color difference correction matrix to obtain the first correction matrix.

[0103] In this embodiment, the first color matrix corresponding to the test color chart image is processed using a standard color matrix and a color difference correction matrix to obtain the first correction matrix with the smallest color difference. Specifically, the first correction matrix can be determined in the following way:

[0104] The standard color matrix, color difference correction matrix, and first color matrix are input into the first correction formula to obtain the first correction matrix; wherein, the first correction formula includes:

[0105] A1=(I T C 2 I) -1 I T C 2 O

[0106] In the above formula, A1 represents the first correction matrix, I represents the first color matrix, C represents the color difference correction matrix, and O represents the standard color matrix.

[0107] S104: Determine the first saturation corresponding to the first correction matrix.

[0108] In this embodiment, after obtaining the first correction matrix, a transformation to the ab two-dimensional color coordinate system is performed based on the first correction matrix, and the first saturation is determined based on the transformed coordinates. The first saturation can be determined using existing saturation calculation formulas; this embodiment does not specifically limit the saturation calculation formula.

[0109] S105: Process the first correction matrix using the first saturation and the preset saturation to obtain the second correction matrix.

[0110] In this embodiment, the preset saturation can be set according to actual needs, and the specific value of the preset saturation is not specifically limited in this embodiment. For example, the preset saturation can be 115%, 120%, or 130%, etc. The first correction matrix is ​​processed by the first saturation and the preset saturation so that the processed first correction matrix can meet the preset saturation requirement.

[0111] Specifically, the first correction matrix is ​​processed using a first saturation and a preset saturation to obtain a second correction matrix, including:

[0112] Determine the target difference between the first saturation level and the preset saturation level;

[0113] Determine whether the target difference is greater than or equal to a preset threshold;

[0114] When the target difference is greater than or equal to a preset threshold, the first saturation, the preset saturation, and the first correction matrix are input into a third correction formula to obtain a second correction matrix; wherein, the third correction formula includes:

[0115]

[0116] In the above formula, A2 represents the second correction matrix, A1 represents the first correction matrix, Starget represents the preset saturation, and S A1 This represents the first degree of saturation, and E represents a constant matrix.

[0117] When the target difference is less than a preset threshold, the processed first color matrix is ​​determined as the second color matrix.

[0118] In this embodiment, the preset threshold can be set according to actual needs, and the specific value of the preset threshold is not specifically limited in this embodiment. It should be noted that when the target difference is greater than or equal to the preset threshold, after obtaining the second correction matrix according to the third correction formula, it is necessary to further determine the target difference between the target saturation corresponding to the second correction matrix and the preset saturation, and determine the magnitude between the target difference and the preset threshold. When the target difference is less than the preset threshold, the second color matrix is ​​determined to be a color matrix that satisfies the saturation condition. When the target difference is greater than or equal to the preset threshold, the third correction formula is used to determine the second correction matrix again until the target difference between the target saturation corresponding to the final second correction matrix and the preset saturation is less than the preset threshold. The color matrix with a target difference less than the preset threshold is determined as the second color matrix.

[0119] S106: Process the second correction matrix using a preset set of correction models to obtain the third correction matrix.

[0120] In this embodiment, the test color chart image includes a set of test color charts, and the preset correction models in the preset correction model set correspond one-to-one with the test color patches in the test color patch set. To further ensure that the corrected color matrix meets the requirements, the second correction matrix that meets the preset saturation is further processed. Specifically, the second correction matrix is ​​processed using the preset correction model set to obtain a third correction matrix, including:

[0121] For any test color patch in the test color patch set, the first coordinate corresponding to the test color patch is determined according to the second correction matrix, and the third error matrix corresponding to the test color patch is determined according to the first coordinate and the preset correction model corresponding to the test color patch, thus obtaining the third error matrix set corresponding to the test color patch set;

[0122] The second correction matrix is ​​processed based on the third error matrix set to obtain the third correction matrix.

[0123] In this embodiment, the preset correction model is used to represent an ellipse in the ab two-dimensional color coordinate system. Each test color chart corresponds to a preset correction model. Based on the preset correction model, the degree of deviation between the test color patch and the preset correction model (i.e., the third error matrix) can be determined. The second correction matrix is ​​further processed based on the third error matrix, so that the saturation of the processed second correction matrix (i.e., the third correction matrix) is close to the preset saturation, thereby making the processed second correction matrix better meet the requirements.

[0124] Specifically, the preset correction model corresponding to a test color patch is determined in the following way:

[0125] Determine the standard color block corresponding to the test color block, and the second coordinate corresponding to the standard color block;

[0126] Based on the second coordinate, determine the third coordinate that satisfies the preset saturation level;

[0127] Based on the third coordinate, the pre-set color tolerance, and the elliptic quadratic curve expression, determine the preset correction model corresponding to the test color block.

[0128] In this embodiment, each test color patch has a corresponding standard color patch, and the second coordinate of the standard color patch is the coordinate in the ab two-dimensional color coordinate system. Since the coordinate chromaticity on the ray formed by the origin coordinate and the second coordinate in the ab two-dimensional color coordinate system is consistent, and for a test color patch, the saturation formula is that the saturation equals the ratio of the Euclidean distance from the coordinate satisfying the saturation to the origin to the Euclidean distance from the second coordinate to the origin, the third coordinate satisfying the preset saturation can be determined based on the slope of the formed ray and the saturation formula. This preset saturation is consistent with the above description, and will not be elaborated upon here. Specifically, when determining the preset correction model, multiple coordinates satisfying the preset color tolerance are determined with the third coordinate as the center. The preset correction model corresponding to the test color patch is obtained by fitting multiple coordinates according to the elliptic quadratic curve expression. The color tolerance can be set according to actual needs; in this embodiment, the specific value of the color tolerance is not specifically limited. In this embodiment, the elliptic quadratic curve expression is as follows.

[0129] F i (x,y)=c 11 x 2 +c 12 xy+c 13 y 2 +c 14 x+c 15 y+c 16

[0130] In the above formula, c11 c 12 c 13 c 14 c 15 and c 16 All represent undetermined coefficients, x represents the a-axis coordinate of the determined coordinate, y represents the b-axis coordinate of the determined coordinate, and i∈[1, 2, 3, ..., 24].

[0131] Specifically, based on the first coordinates and the preset correction model corresponding to the test color patch, the third error matrix corresponding to the test color patch is determined, including:

[0132] Determine the initial error matrix corresponding to the test color patch; wherein, the initial error matrix includes the target error adjustment value to be determined;

[0133] Determine the target positional relationship between the first coordinate and the preset correction model corresponding to the test color block;

[0134] Determine the target error adjustment value based on the target's positional relationship;

[0135] The initial error matrix is ​​processed using the target error adjustment value to obtain the third error matrix corresponding to the test color block.

[0136] In this embodiment, each test color block has a corresponding initial error matrix. When the second coordinate is within the preset correction model, the target error adjustment value in the initial error matrix is ​​0. When the first coordinate is outside the preset correction model, the vector distance d between the first coordinate and the preset correction model is determined, step = d * m, where step represents the target error adjustment value and m represents a preset coefficient. An initial error matrix can be represented as follows: i∈[1, 2, 3, ..., 24]. Once the target error adjustment value step is determined, it can be substituted into the initial error matrix to obtain the third error matrix corresponding to the test color block.

[0137] In this embodiment, the second correction matrix is ​​processed according to the third error matrix set to obtain the third correction matrix, including:

[0138] Determine the sum of the values ​​corresponding to the third error matrix set to obtain the target third error matrix;

[0139] When the target third error matrix is ​​not zero, the second correction matrix and the target third error matrix are input into the second correction formula to obtain the third correction matrix; wherein, the second correction formula includes:

[0140] A3 = A2 + offset

[0141] In the above formula, A3 represents the third correction matrix, A2 represents the second correction matrix, and offset represents the target third error matrix.

[0142] In this embodiment, i∈[1, 2, 3, ..., 24], N = 24. It should be noted that after obtaining the third correction matrix based on the target third error matrix, the processed third correction matrix needs to be further processed according to the preset correction model until the first coordinate set corresponding to the final third correction matrix is ​​completely located in its respective preset correction model (i.e., the target third error matrix is ​​a zero matrix), and then the target color matrix is ​​obtained.

[0143] S107: Determine the third correction matrix as the target color matrix corresponding to the test color chart image.

[0144] In this embodiment, the third correction matrix is ​​a color matrix that has the smallest color difference, satisfies the preset saturation, and satisfies the preset correction model set. Therefore, the third correction matrix can be used as the target color difference matrix corresponding to the test color card image. The obtained target color difference matrix is ​​applied to the camera's shooting so that the camera's image quality can meet the requirements.

[0145] This embodiment provides an automatic image color matrix optimization processing method that can automatically adjust the color matrix in terms of chroma and saturation, so that the image quality of the camera meets the requirements, improves work efficiency, and is easy to operate.

[0146] refer to Figure 2 , Figure 2 This is a schematic diagram of an image color matrix automatic optimization processing device provided in an embodiment of the present invention. The image color matrix automatic optimization processing device provided in this embodiment includes an acquisition module 10, a determination module 20, and a processing module. The acquisition module 10 is used to acquire a test color chart image; the determination module 20 is used to determine a first color matrix corresponding to the test color chart image, a standard color matrix corresponding to a standard color chart image, and a color difference correction matrix; the processing module 30 is used to process the first color matrix using the standard color matrix and the color difference correction matrix to obtain a first correction matrix; the determination module 20 is also used to determine a first saturation corresponding to the first correction matrix; the processing module 30 is also used to process the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix; the processing module 30 is also used to process the second correction matrix using a preset correction model set to obtain a third correction matrix; the determination module 20 is also used to determine the second correction matrix as the target color matrix corresponding to the test color chart image.

[0147] In this embodiment, the determining module 20 is further configured to:

[0148] The first color error, the second color error, and the third color error corresponding to the test color chart image are determined; wherein, the first color error is used to characterize the color error including brightness, the second color error is used to characterize the color error not including brightness, and the third color error is used to characterize the chromaticity error.

[0149] The first color error, the second color error, and the third color error are processed using the first preset weight matrix corresponding to the test color card image to obtain the first error matrix;

[0150] The first error matrix is ​​processed using the second preset weight matrix to obtain the second error matrix;

[0151] Based on the second error matrix, determine the color difference correction matrix.

[0152] In this embodiment, the processing module 30 is further configured to:

[0153] The standard color matrix, the color difference correction matrix, and the first color matrix are input into the first correction formula to obtain the first correction matrix; wherein, the first correction formula includes:

[0154] A1=(I T C 2 I) -1 I T C 2 O

[0155] In the above formula, A1 represents the first correction matrix, I represents the first color matrix, C represents the color difference correction matrix, and O represents the standard color matrix.

[0156] In this embodiment, the test color chart image includes a set of test color blocks, and the preset correction model in the preset correction model set corresponds one-to-one with the test color blocks in the set of test color blocks.

[0157] In this embodiment, the determining module 20 is further configured to:

[0158] For any test color patch in the test color patch set, the first coordinates corresponding to the test color patch are determined according to the second correction matrix, and the third error matrix corresponding to the test color patch is determined according to the first coordinates and the preset correction model corresponding to the test color patch, so as to obtain the third error matrix set corresponding to the test color patch set;

[0159] The second correction matrix is ​​processed according to the third error matrix set to obtain the third correction matrix.

[0160] In this embodiment, the processing module 30 is further configured to:

[0161] Determine the sum of the values ​​corresponding to the set of third error matrices to obtain the target third error matrix;

[0162] When the target third error matrix is ​​not zero, the second correction matrix and the target third error matrix are input into the second correction formula to obtain the third correction matrix; wherein, the second correction formula includes:

[0163] A3 = A2 + offset

[0164] In the above formula, A3 represents the third correction matrix, A2 represents the second correction matrix, and offset represents the target third error matrix.

[0165] In this embodiment, the determining module 20 is further configured to:

[0166] Determine the standard color block corresponding to the test color block, and the second coordinate corresponding to the standard color block;

[0167] Based on the second coordinate, determine the third coordinate that satisfies the preset saturation.

[0168] Based on the third coordinate, the pre-set color tolerance, and the elliptic quadratic curve expression, the preset correction model corresponding to the test color block is determined.

[0169] In this embodiment, the determining module 20 is further configured to:

[0170] Determine the initial error matrix corresponding to the test color patch; wherein, the initial error matrix includes the target error adjustment value to be determined;

[0171] Determine the target positional relationship between the first coordinate and the preset correction model corresponding to the test color block;

[0172] Based on the target position relationship, determine the target error adjustment value;

[0173] The initial error matrix is ​​processed using the target error adjustment value to obtain the third error matrix corresponding to the test color block.

[0174] In this embodiment, the determining module 20 is further configured to:

[0175] The first preset weight matrix, the first color error, the second color error, and the third color error are input into the first error calculation formula to obtain the first error matrix; wherein, the first error calculation formula includes:

[0176] Error1 = w1 * [ΔEΔCΔH]

[0177] In the above formula, Error1 represents the first error matrix, w1 represents the first preset weight matrix, ΔE represents the first color error, ΔC represents the second color error, and ΔH represents the third color error.

[0178] Module 20 is also used for:

[0179] The second preset weight matrix and the first error matrix are input into the second error calculation formula to obtain the second error matrix; wherein, the second error calculation formula includes:

[0180] Error2 = Error1 * w2

[0181] In the above formula, Error2 represents the second error matrix, and w2 represents the second preset weight matrix.

[0182] Module 20 is also used for:

[0183] The second error matrix is ​​input into the third error calculation formula to obtain the color difference correction matrix; wherein, the third error calculation formula includes:

[0184]

[0185] In the above formula, C represents the color difference correction matrix, and ε represents the constant matrix.

[0186] In this embodiment, the processing module 30 is further configured to:

[0187] Determine the target difference between the first saturation and the preset saturation;

[0188] When the target difference is greater than or equal to a preset threshold, the first saturation, the preset saturation, and the first correction matrix are input into a third correction formula to obtain a second correction matrix; wherein, the third correction formula includes:

[0189]

[0190] In the above formula, A2 represents the second correction matrix, A1 represents the first correction matrix, Starget represents the preset saturation, and S A1 Let E represent the first degree of saturation, and let E represent the constant matrix.

[0191] This embodiment provides an automatic image color matrix optimization processing device that can automatically adjust the color matrix in terms of chroma and saturation, so that the image quality of the camera meets the requirements, improves work efficiency, and is easy to operate.

[0192] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 3The illustrated electronic device 400 includes at least one processor 401, a memory 402, at least one network interface 404, and other user interfaces 403. The various components in the electronic device 400 are coupled together via a bus system 405. It is understood that the bus system 405 is used to implement communication between these components. In addition to a data bus, the bus system 405 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 3 The general designated all buses as Bus System 405.

[0193] The user interface 403 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).

[0194] It is understood that the memory 402 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 402 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0195] In some implementations, memory 402 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 4021 and application program 4022.

[0196] The operating system 4021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 4022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 4022.

[0197] In this embodiment of the invention, by calling the program or instructions stored in memory 402, specifically the program or instructions stored in application program 4022, processor 401 executes the method steps provided in each method embodiment, such as: acquiring a test color chart image; determining a first color matrix corresponding to the test color chart image, a standard color matrix corresponding to the standard color chart image, and a color difference correction matrix; processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain a first correction matrix; determining a first saturation corresponding to the first correction matrix; processing the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix; processing the second correction matrix using a preset correction model set to obtain a third correction matrix; and determining the third correction matrix as the target color matrix corresponding to the test color chart image.

[0198] The methods disclosed in the above embodiments of the present invention can be applied to processor 401, or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the above method.

[0199] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0200] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0201] The electronic device provided in this embodiment may be as follows: Figure 3 The electronic device shown can perform the following: Figure 1 All steps of the automatic optimization processing method for the color matrix of a Chinese image are then implemented to achieve... Figure 1 For details on the technical effects of the automatic color matrix optimization processing method shown, please refer to [link / reference needed]. Figure 1 The relevant descriptions are presented concisely and will not be elaborated upon here.

[0202] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.

[0203] One or more programs in the storage medium can be executed by one or more processors to implement the above-described automatic image color matrix optimization processing method executed on the image color matrix automatic optimization processing device side.

[0204] The processor is used to execute an image color matrix automatic optimization processing program stored in the memory to implement the following steps of the image color matrix automatic optimization processing method executed on the image color matrix automatic optimization processing device side: acquiring a test color card image; determining a first color matrix corresponding to the test color card image, a standard color matrix corresponding to the standard color card image, and a color difference correction matrix; processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain a first correction matrix; determining a first saturation corresponding to the first correction matrix; processing the first correction matrix using the first saturation and a preset saturation to obtain a second correction matrix; processing the second correction matrix using a preset correction model set to obtain a third correction matrix; and determining the third correction matrix as the target color matrix corresponding to the test color card image.

[0205] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0206] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0207] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatic optimization of image color matrix, characterized in that, include: Obtain the test color chart image; The first color matrix corresponding to the test color chart image, the standard color matrix corresponding to the standard color chart image, and the color difference correction matrix are determined, wherein the test color chart image includes a set of test color patches; The first color matrix is ​​processed using the standard color matrix and the color difference correction matrix to obtain the first correction matrix; Determine the first saturation corresponding to the first correction matrix; The first correction matrix is ​​processed using the first saturation and the preset saturation to obtain the second correction matrix; The second correction matrix is ​​processed using a set of preset correction models to obtain a third correction matrix. Each preset correction model in the set corresponds one-to-one with a test color patch in the set of test color patches. Specifically, this includes: for any test color patch in the set of test color patches, determining the first coordinates corresponding to the test color patch based on the second correction matrix; determining the third error matrix corresponding to the test color patch based on the first coordinates and the preset correction model corresponding to the test color patch, thus obtaining a set of third error matrices corresponding to the set of test color patches; processing the second correction matrix based on the set of third error matrices to obtain the third correction matrix; wherein a preset correction model corresponding to a test color patch is determined as follows: determining the standard color patch corresponding to the test color patch and the second coordinates corresponding to the standard color patch; determining the third coordinates that satisfy the preset saturation based on the second coordinates; and determining the preset correction model corresponding to the test color patch based on the third coordinates, a pre-set color tolerance, and an elliptic quadratic curve expression. The third correction matrix is ​​determined as the target color matrix corresponding to the test color chart image.

2. The method according to claim 1, characterized in that, The determination of the color difference correction matrix includes: The first color error, the second color error, and the third color error corresponding to the test color chart image are determined; wherein, the first color error is used to characterize the color error including brightness, the second color error is used to characterize the color error not including brightness, and the third color error is used to characterize the chromaticity error. The first color error, the second color error, and the third color error are processed using the first preset weight matrix corresponding to the test color card image to obtain the first error matrix; The first error matrix is ​​processed using the second preset weight matrix to obtain the second error matrix; Based on the second error matrix, determine the color difference correction matrix.

3. The method according to claim 1, characterized in that, The step of processing the first color matrix using the standard color matrix and the color difference correction matrix to obtain the first correction matrix includes: The standard color matrix, the color difference correction matrix, and the first color matrix are input into the first correction formula to obtain the first correction matrix; wherein, the first correction formula includes: In the above formula, This represents the first correction matrix. This represents the first color matrix. This represents the color difference correction matrix. This represents the standard color matrix.

4. The method according to claim 1, characterized in that, The step of processing the second correction matrix according to the third error matrix set to obtain the third correction matrix includes: Determine the sum of the values ​​corresponding to the set of third error matrices to obtain the target third error matrix; When the target third error matrix is ​​not zero, the second correction matrix and the target third error matrix are input into the second correction formula to obtain the third correction matrix; wherein, the second correction formula includes: In the above formula, This represents the third correction matrix. This represents the second correction matrix. This represents the target's third error matrix.

5. The method according to claim 1, characterized in that, The step of determining the third error matrix corresponding to the test color patch based on the first coordinates and the preset correction model corresponding to the test color patch includes: Determine the initial error matrix corresponding to the test color patch; wherein, the initial error matrix includes the target error adjustment value to be determined; Determine the target positional relationship between the first coordinate and the preset correction model corresponding to the test color block; Based on the target position relationship, determine the target error adjustment value; The initial error matrix is ​​processed using the target error adjustment value to obtain the third error matrix corresponding to the test color block.

6. The method according to claim 2, characterized in that, The first error matrix is ​​determined in the following way: The first preset weight matrix, the first color error, the second color error, and the third color error are input into the first error calculation formula to obtain the first error matrix; wherein, the first error calculation formula includes: In the above formula, Denotes the first error matrix. This represents the first preset weight matrix. Indicates the first color error. Indicates the second color error. Indicates the third color error; The second error matrix is ​​determined as follows: The second preset weight matrix and the first error matrix are input into the second error calculation formula to obtain the second error matrix; wherein, the second error calculation formula includes: In the above formula, This represents the second error matrix. This represents the second preset weight matrix; The color difference correction matrix is ​​determined in the following manner: The second error matrix is ​​input into the third error calculation formula to obtain the color difference correction matrix; wherein, the third error calculation formula includes: In the above formula, This represents the color difference correction matrix. This represents a constant matrix.

7. The method according to claim 1, characterized in that, The step of processing the first correction matrix using the first saturation and a preset saturation to obtain the second correction matrix includes: Determine the target difference between the first saturation and the preset saturation; When the target difference is greater than or equal to a preset threshold, the first saturation, the preset saturation, and the first correction matrix are input into a third correction formula to obtain a second correction matrix; wherein, the third correction formula includes: In the above formula, This represents the second correction matrix. This represents the first correction matrix. Indicates the preset saturation. Indicates the first degree of saturation. This represents a constant matrix.

8. An image color matrix automatic optimization processing device, characterized in that, include: The acquisition module is used to acquire the test color chart image; The determining module is used to determine the first color matrix corresponding to the test color card image, the standard color matrix corresponding to the standard color card image, and the color difference correction matrix, wherein the test color card image includes a set of test color patches; The processing module is used to process the first color matrix using the standard color matrix and the color difference correction matrix to obtain the first correction matrix; The determining module is further configured to determine the first saturation corresponding to the first correction matrix; The processing module is further configured to process the first correction matrix using the first saturation and the preset saturation to obtain a second correction matrix; The processing module is further configured to process the second correction matrix using a preset correction model set to obtain a third correction matrix, wherein the preset correction models in the preset correction model set correspond one-to-one with the test color patches in the test color patch set. Specifically, this includes: for any test color patch in the test color patch set, determining the first coordinates corresponding to the test color patch based on the second correction matrix; determining the third error matrix corresponding to the test color patch based on the first coordinates and the preset correction model corresponding to the test color patch, thereby obtaining a third error matrix set corresponding to the test color patch set; processing the second correction matrix based on the third error matrix set to obtain the third correction matrix; wherein a preset correction model corresponding to a test color patch is determined as follows: determining the standard color patch corresponding to the test color patch and the second coordinates corresponding to the standard color patch; determining the third coordinates that satisfy the preset saturation based on the second coordinates; and determining the preset correction model corresponding to the test color patch based on the third coordinates, a preset color tolerance, and an elliptic quadratic curve expression. The determining module is further configured to determine the third correction matrix as the target color matrix corresponding to the test color card image.

Citation Information

Patent Citations

  • Color correction matrix adjustment method and device, electronic equipment and readable storage medium

    CN115426487A