CN117974811A - Color correction matrix determining method, device, electronic equipment and storage medium - Google Patents
Color correction matrix determining method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117974811A CN117974811A CN202211303265.XA CN202211303265A CN117974811A CN 117974811 A CN117974811 A CN 117974811A CN 202211303265 A CN202211303265 A CN 202211303265A CN 117974811 A CN117974811 A CN 117974811A
- Authority
- CN
- China
- Prior art keywords
- color
- correction matrix
- color correction
- saturation
- video frame
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012937 correction Methods 0.000 title claims abstract description 362
- 239000011159 matrix material Substances 0.000 title claims abstract description 259
- 238000000034 method Methods 0.000 title claims abstract description 55
- 238000011156 evaluation Methods 0.000 claims abstract description 53
- 230000004075 alteration Effects 0.000 claims description 7
- 238000012216 screening Methods 0.000 claims description 6
- 239000006185 dispersion Substances 0.000 claims description 5
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000004590 computer program Methods 0.000 claims description 2
- 230000000694 effects Effects 0.000 description 15
- 230000008569 process Effects 0.000 description 15
- 238000004364 calculation method Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000003595 spectral effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Facsimile Image Signal Circuits (AREA)
- Color Image Communication Systems (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a method and a device for determining a color correction matrix, electronic equipment and a storage medium. The method comprises the following steps: acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix; dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices; acquiring video frame images matched with each candidate color correction matrix, and determining at least one color restoration evaluation value of each video frame image according to a standard color card; the color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference; and determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image. By using the technical scheme of the invention, the automatic correction of the color correction matrix can be realized, and the color consistency of the same shooting device under different color temperatures and among different shooting devices is improved.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and apparatus for determining a color correction matrix, an electronic device, and a storage medium.
Background
The original imaging of the shooting device and the actual image perceived by human eyes often have larger color in and out, and the reasons for the color cast of the image include the color temperature of a light source, the light transmission characteristic of a lens, the photosensitive characteristic of an image sensor and the like. An automatic white balance algorithm (Automatic white balance, AWB) can be used to correct color shift problems with color temperature, simulating the constancy of the human eye to the perception of gray. After the image is subjected to AWB correction, a serious color cast phenomenon still exists, and the main reason for the color cast is that the spectral response and the brightness response of the image sensor and human eyes have obvious differences. Therefore, after AWB recovers the gray object color, a color Correction matrix (Color Correction Matrix, CCM) and Gamma Correction (Gamma Correction) are required to correct the color cast problem of the color object.
The existing CCM correction process usually adopts an offline correction mode, and corrects the initial CCM according to the Raw data, but the offline correction effect still has deviation from the actual effect.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for determining a color correction matrix, so as to realize automatic correction of the color correction matrix and improve color consistency of the same shooting device under different color temperatures and among different shooting devices.
In a first aspect, an embodiment of the present invention provides a method for determining a color correction matrix, where the method includes:
Acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix;
Dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices;
Acquiring video frame images matched with each candidate color correction matrix, and determining at least one color restoration evaluation value of each video frame image according to a standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
In a second aspect, an embodiment of the present invention further provides a device for determining a color correction matrix, where the device includes:
The saturation correction module is used for acquiring an initial color correction matrix and correcting the saturation of the initial color correction matrix;
The color correction matrix discrete module is used for performing the dispersion on the color correction matrix subjected to the saturation correction to obtain at least two candidate color correction matrices;
The color restoration evaluation value determining module is used for acquiring video frame images matched with each candidate color correction matrix and determining at least one color restoration evaluation value of each video frame image according to the standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And the target color correction matrix determining module is used for determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements a method for determining a color correction matrix according to any one of the embodiments of the present invention when the processor executes the program.
In a fourth aspect, embodiments of the present invention also provide a storage medium storing computer-executable instructions that, when executed by a computer processor, are configured to perform a method of determining a color correction matrix according to any of the embodiments of the present invention.
According to the technical scheme, after saturation correction is carried out on the initial color correction matrix, the initial color correction matrix is discretized to obtain a plurality of candidate color correction matrices, video frame images matched with the candidate color correction matrices are acquired, and a target color correction matrix is determined according to color restoration evaluation values of the video frame images. The problem that the off-line correction mode in the prior art still has deviation between the off-line correction effect and the real effect is solved, the automatic correction of the color correction matrix is realized, and the color consistency of the same shooting device under different color temperatures and among different shooting devices is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for determining a color correction matrix according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for determining a color correction matrix according to a second embodiment of the present invention;
Fig. 3 is a schematic structural diagram of a device for determining a color correction matrix according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a method for determining a color correction matrix according to an embodiment of the present invention, where the method may be applied to determining an optimal color correction matrix to solve a color cast problem of an image of a photographing device, and the method may be performed by a determining device of a color correction matrix, where the determining device of a color correction matrix may be implemented in a form of hardware and/or software, and the determining device of a color correction matrix may be configured in an electronic device and used with the photographing device.
As shown in fig. 1, the method includes:
S110, acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix.
Wherein the color correction matrix is a3×3 matrix comprising nine data: rr, gr, br, rg, gg, bg, rb, gb, bb, where r represents red, g represents green, and b represents blue. The initial color correction matrix is not the optimal color correction matrix, and is required to be continuously adjusted according to the initial color correction matrix, so that the optimal color correction matrix with the overall deviation meeting the requirement is obtained. The process of adjusting the color correction matrix is a process of adjusting the proportional relationship of the red, green and blue components in RGB. The saturation correction of the color correction matrix is a process of adjusting the values of rr, gg, and bb.
In an alternative embodiment, obtaining the initial color correction matrix and performing saturation correction on the initial color correction matrix may include: acquiring shooting device metadata, and determining an initial color correction matrix according to the shooting device metadata; transmitting the initial color correction matrix to a shooting device, and acquiring a video frame image shot by the shooting device; and correcting the saturation of the initial color correction matrix according to the saturation of the video frame image and the standard saturation of the standard color card.
The initial color correction matrix in this embodiment is obtained by calculating the captured Raw data using a conventional offline method. The color correction matrix obtained by calculation according to the captured Raw data is in the prior art, and this embodiment is not described here again. Since the color correction matrix obtained by the off-line calculation still has deviation in the image effect, the color correction matrix obtained by the off-line calculation needs to be further corrected.
The video frame image is an image obtained by decoding and converting a video stream obtained by shooting the shooting device after the initial color correction matrix is issued to the shooting device, and the video frame image may be in BMP (Bitmap) format or JPEG (Joint Photographic Experts Group ) format.
In this embodiment, because the requirements of the photographing device on color saturation and color style under different usage scenarios are different, a plurality of different standard color cards can be preset, and standard values of each standard color card under at least one index can be generated respectively. Standard saturation is the saturation of each color block in the standard color chart.
Further, the saturation correction of the initial color correction matrix may be performed according to the saturation of the video frame image and the standard saturation of the standard color chart, which is the adjustment process of the initial color correction matrix when determining to adjust the saturation of each color block in the video frame image to the standard saturation of the standard color chart. Specifically, CCM new=CCM×yiq2rgb×Ms×rgb2yiq,CCMnew represents the saturation corrected color correction matrix, CCM represents the initial color correction matrix,Rgb2yiq is the inverse of yiq g b,Wherein, by adjusting the value of s in the Ms matrix, saturation correction can be realized. For example, if the saturation of the initial color correction matrix needs to be increased by 110% compared to the standard saturation of the standard color chart, the value of s is 1.1.
In another optional embodiment, acquiring the initial color correction matrix and performing saturation correction on the initial color correction matrix may further include: taking the unit color correction matrix as an initial color correction matrix; and carrying out saturation correction on the initial color correction matrix according to the standard saturation of the standard color card. The color correction matrix after the saturation correction is discretized, which comprises the following steps: and performing tone adjustment on the color correction matrix after the saturation correction, and performing dispersion on the color correction matrix after the tone adjustment.
The unit color correction matrix, that is, rr=gg=bb=1, is subjected to saturation correction according to the standard saturation of the standard color chart. The manner of the saturation correction is described above, and this embodiment is not described here again.
When the unit color correction matrix is used as the initial color correction matrix, after the saturation correction is performed, the color correction matrix with the saturation closest to the standard color chart needs to be subjected to tone adjustment, and the color correction matrix with the tone closest to the standard color chart is selected. At this time, the color correction matrix after the saturation correction and the tone adjustment is discretized.
It should be noted that, the initial color correction matrix is obtained by calculation according to the captured Raw data, or the unit color correction matrix is used as the scheme that the initial color correction matrix is parallel, and may be selected according to the actual requirement of saturation correction.
S120, dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices.
The candidate color correction matrix is obtained by discretizing the color correction matrix, and the number of the candidate color correction matrices can be a plurality of.
The discrete specific process is as follows: because the color correction matrix includes nine data in total, a certain deviation value can be increased or decreased on the basis of one or a plurality of data of the color correction matrix, and a new color correction matrix can be obtained as a candidate color correction matrix. The adjustment of the data coordinates and the number of the offset values, the size of the offset values, and the increase or decrease of the offset values may be performed according to the data accuracy of the color correction matrix and the correction result of the color correction matrix, which is not limited in this embodiment.
S130, obtaining video frame images matched with the candidate color correction matrixes, and determining at least one color restoration evaluation value of each video frame image according to a standard color card.
The color reproduction evaluation value comprises an average value of color differences of all color blocks, at least one saturation deviation of the color blocks, at least one Lab deviation of the color blocks and at least one color difference of the color blocks.
And acquiring video frame images matched with the candidate color correction matrixes, namely sequentially issuing the candidate color correction matrixes to a shooting device, acquiring video streams obtained by shooting the candidate color correction matrixes after the candidate color correction matrixes take effect, and decoding and converting the video streams to obtain video frame images.
The average value of the chromatic aberration of each color block refers to the average value of the chromatic aberration of each color block in the video frame image and each color block in the standard color card, the chromatic aberration can be represented by the numerical value of the CIEDE2000, and the calculation mode of the chromatic aberration is not limited in this embodiment. The color block saturation deviation refers to the difference between the saturation of a target color block in the video frame image and the saturation of the target color block in the standard color card. The color block Lab deviation refers to the difference between the target color block in the video frame image and the Lab of the target color block in the standard color card. Lab values can be obtained by converting RGB values of color blocks, and mainly comprise L, a, b and E values, wherein L represents brightness of colors, a represents red-green value, b represents yellow-blue value, E represents total color difference value, and Lab difference values of two color blocks can be used for representing color difference between the two color blocks. The color block color difference refers to the color difference between a target color block in the video frame image and the target color block in the standard color card.
In general, the smaller the average value of the color difference of each color patch, the smaller the overall deviation of the image effect. However, when the average value of the color difference of each color block is the minimum value, the image effect may still deviate from the human eye effect, and the saturation deviation, lab deviation or color difference of some color blocks may exceed the limit. Therefore, in the embodiment of the invention, the color correction matrix with the optimal image effect is selected by comprehensively considering the average value of the color differences of each color block, the saturation deviation of at least one color block, the Lab deviation of at least one color block and the color difference of at least one color block.
S140, determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
Specifically, the present embodiment can determine the color reproduction evaluation index referred to for finding the optimal color correction matrix. For example, the color reproduction evaluation index may be set as an average value of color patch differences, a saturation deviation of a color patch, an a color patch Lab deviation, a B color patch Lab deviation, and a B color patch difference.
Correspondingly, determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image, wherein the target color correction matrix can be obtained by screening video frame images with saturation deviation of an A color block, lab deviation of a B color block and color difference of the B color block within a limited range from each video frame image, and selecting a video frame image with the minimum average value of color differences of each color block from the screened video frame images, and taking the color correction matrix corresponding to the video frame image as the target color correction matrix. And transmitting the target color correction matrix to a shooting device for carrying out subsequent image color correction so as to realize the optimal image effect.
In the embodiment of the invention, the color restoration evaluation value is calculated by continuously collecting the video frame images, and the optimal color correction matrix is finally selected, so that the color correction matrix is automatically searched under different color temperatures, and the labor cost is saved. Meanwhile, the color correction matrix is selected according to the color reproduction evaluation value of each video frame image, and the color correction matrix obtained by screening according to the fixed rule screening mode is better in consistency, so that the color consistency of the same shooting device under different color temperatures and among different shooting devices can be improved.
According to the technical scheme, after saturation correction is carried out on the initial color correction matrix, the initial color correction matrix is discretized to obtain a plurality of candidate color correction matrices, video frame images matched with the candidate color correction matrices are acquired, and a target color correction matrix is determined according to color restoration evaluation values of the video frame images. The problem that the off-line correction mode in the prior art still has deviation between the off-line correction effect and the real effect is solved, the automatic correction of the color correction matrix is realized, and the color consistency of the same shooting device under different color temperatures and among different shooting devices is improved.
Example two
Fig. 2 is a flowchart of a method for determining a color correction matrix according to a second embodiment of the present invention, where the process of determining a target color correction matrix according to a saturation correction process of an initial color correction matrix, a discrete process of a color correction matrix, and a color restoration evaluation value of each video frame image are further embodied on the basis of the foregoing embodiments.
As shown in fig. 2, the method includes:
S210, acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix.
The process of obtaining the initial color correction matrix and the process of correcting the saturation are described in the above embodiments, and the present embodiment is not described herein.
S220, increasing or decreasing the deviation value of at least one data in the color correction matrix after the saturation correction to obtain at least two candidate color correction matrices.
The color correction matrix is discretized by adding or subtracting the offset value to one or more data in the color correction matrix to obtain a new color correction matrix as a candidate color correction matrix.
S230, obtaining video frame images matched with the candidate color correction matrixes, and determining at least one color restoration evaluation value of each video frame image according to the standard color card.
In the embodiment of the invention, for a certain candidate color correction matrix, the matched video frame image is compared with a standard color card, and at least one color restoration evaluation value is determined to find an optimal color correction matrix.
Correspondingly, the acquisition of the video frame image matched with each candidate color correction matrix can be realized through the following steps A1-A2:
A1, adjusting at least one video stream parameter.
A2, sending each candidate color correction matrix to a shooting device after adjusting video stream parameters, and obtaining a video frame image shot by the shooting device.
Wherein the video stream parameters include resolution, code rate, and key frame interval.
In the embodiment of the invention, the video stream parameters of the shooting device can be adjusted in advance. Specifically, by reducing resolution, reducing decoding pressure of the video stream, reducing time required for decoding, converting the video stream, and calculating color reproduction evaluation values of video frame images. Illustratively, the resolution may be reduced to 1080P or even lower. By increasing the code rate and reducing the key frame interval, the effective speed of the color correction matrix can be increased, the video frame images can be converged as soon as possible, and the unstable calculation result of the color restoration evaluation value caused by the coding fluctuation is reduced.
S240, screening at least one video frame image meeting the limiting condition according to at least one color restoration evaluation value of each video frame image.
Wherein, the satisfaction of the constraint condition means satisfaction of at least one of the following: at least one color block saturation deviation is within a preset saturation deviation interval, at least one color block Lab deviation is within a preset Lab deviation interval, and at least one color block color difference is within a preset color block color difference interval.
In the embodiment of the invention, the influence of the deviation of the individual color blocks on the overall deviation of the image is reduced by increasing the limitations of the saturation deviation of at least one color block, the Lab deviation of at least one color block and the chromatic aberration of at least one color block.
In the present embodiment, the deviation of which color patches are added is not limited to the color reproduction evaluation index.
S250, determining a target video frame image with the average value of the chromatic aberration of each color block meeting the average value condition in the video frame images meeting the limiting condition.
In video frame images in which the deviations of the individual color patches are within a limited range, a minimum value of the color patch color difference average value is determined. The average value satisfying condition may be that the average value of the color patch color differences is the minimum value of the average values of the color patch color differences, or may be that the average value of the color patch color differences is less than or equal to a preset threshold value, which is not limited in this embodiment.
S260, determining a target color correction matrix according to the color correction matrix matched with the target video frame image.
In this embodiment, a loop iteration mode is taken as an example to find a target color correction matrix, and description is made of a target color correction matrix determining process. The loop iteration mode can improve the data precision of the color correction matrix, reduce traversal invalid data and improve the determination speed of the target color correction matrix.
Alternatively, determining the target color correction matrix based on the color correction matrix matching the target video frame image may be achieved by the following steps B1-B4:
B1, using a color correction matrix matched with the target video frame image as an intermediate color correction matrix.
And B2, discretizing the intermediate color correction matrix to obtain at least two candidate color correction matrices.
And B3, repeatedly executing the operation of acquiring the video frame images matched with the candidate color correction matrixes until the cyclical exit condition is met.
The cycle exit condition is that the currently determined intermediate color correction matrix is the same as the intermediate color correction matrix determined in the previous round, or the cycle times are greater than or equal to a preset numerical value.
And B4, taking the currently determined intermediate color correction matrix as a target color correction matrix.
In the embodiment of the invention, the color correction matrix matched with the target video frame image is used as the optimal color correction matrix in the cycle of the round. And (3) based on the color correction matrix, carrying out discretization again to obtain a candidate color correction matrix, repeatedly executing the processes of collecting video frame images, calculating color restoration evaluation values of the video frame images and determining target video frame images according to the color restoration evaluation values until the color correction matrix determined in the current cycle is the same as the color correction matrix determined in the previous cycle, exiting the cycle, and taking the color correction matrix determined in the current cycle as the target color correction matrix. Or when the cycle times reach a preset value, the cycle is exited, and the color correction matrix determined in the current cycle is used as a target color correction matrix, so that the time consumption of the cycle is avoided being too long.
Example III
Fig. 3 is a schematic structural diagram of a device for determining a color correction matrix according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a saturation correction module 310, a color correction matrix dispersion module 320, a color reproduction evaluation value determination module 330, and a target color correction matrix determination module 340, wherein:
the saturation correction module 310 is configured to obtain an initial color correction matrix, and perform saturation correction on the initial color correction matrix;
A color correction matrix discretizing module 320, configured to discretize the color correction matrix after saturation correction to obtain at least two candidate color correction matrices;
The color restoration evaluation value determining module 330 is configured to obtain video frame images matched with each candidate color correction matrix, and determine at least one color restoration evaluation value of each video frame image according to a standard color chart;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
The target color correction matrix determining module 340 is configured to determine a target color correction matrix according to at least one color reproduction evaluation value of each video frame image.
According to the technical scheme, after saturation correction is carried out on the initial color correction matrix, the initial color correction matrix is discretized to obtain a plurality of candidate color correction matrices, video frame images matched with the candidate color correction matrices are acquired, and a target color correction matrix is determined according to color restoration evaluation values of the video frame images. The problem that the off-line correction mode in the prior art still has deviation between the off-line correction effect and the real effect is solved, the automatic correction of the color correction matrix is realized, and the color consistency of the same shooting device under different color temperatures and among different shooting devices is improved.
Based on the above embodiment, the saturation correction module 310 includes:
a first initial color correction matrix determining unit, configured to obtain camera metadata, and determine an initial color correction matrix according to the camera metadata;
The initial color correction matrix sending unit is used for sending the initial color correction matrix to the shooting device and obtaining a video frame image shot by the shooting device;
The first saturation correction unit is used for carrying out saturation correction on the initial color correction matrix according to the saturation of the video frame image and the standard saturation of the standard color card.
Based on the above embodiment, the saturation correction module 310 includes:
A second initial color correction matrix determining unit configured to take the unit color correction matrix as an initial color correction matrix;
and the second saturation correction unit is used for carrying out saturation correction on the initial color correction matrix according to the standard saturation of the standard color card.
A color correction matrix discrete module 320 comprising:
And the tone adjustment unit is used for carrying out tone adjustment on the color correction matrix after the saturation correction and dispersing the color correction matrix after the tone adjustment.
Based on the above embodiment, the color correction matrix discrete module 320 includes:
And the color correction matrix discrete unit is used for increasing or reducing the deviation value of at least one data in the color correction matrix subjected to the saturation correction to obtain at least two candidate color correction matrices.
Based on the above embodiment, the target color correction matrix determining module 340 includes:
A limiting condition screening unit, configured to screen at least one video frame image that meets a limiting condition according to at least one color reproduction evaluation value of each video frame image;
A target video frame image determining unit, configured to determine, from among video frame images satisfying the constraint condition, a target video frame image whose color difference average value of each color block satisfies the average value condition;
a target color correction matrix determining unit for determining a target color correction matrix according to a color correction matrix matched with the target video frame image;
Wherein, the satisfaction of the constraint condition means satisfaction of at least one of the following: at least one color block saturation deviation is within a preset saturation deviation interval, at least one color block Lab deviation is within a preset Lab deviation interval, and at least one color block color difference is within a preset color block color difference interval.
On the basis of the above embodiment, the target color correction matrix determining unit is specifically configured to:
The color correction matrix matched with the target video frame image is used as an intermediate color correction matrix;
dispersing the intermediate color correction matrix to obtain at least two candidate color correction matrices;
Repeatedly executing the operation of obtaining the video frame images matched with the candidate color correction matrixes until the cyclical exit condition is met;
taking the currently determined intermediate color correction matrix as a target color correction matrix;
The cycle exit condition is that the currently determined intermediate color correction matrix is the same as the intermediate color correction matrix determined in the previous round, or the cycle times are greater than or equal to a preset numerical value.
On the basis of the above embodiment, the color reproduction evaluation value determination module 330 includes:
The video stream parameter adjusting unit is used for adjusting at least one video stream parameter;
The video frame image acquisition unit is used for transmitting each candidate color correction matrix to the shooting device after adjusting the video stream parameters to acquire a video frame image shot by the shooting device;
wherein the video stream parameters include resolution, code rate, and key frame interval.
The device for determining the color correction matrix provided by the embodiment of the invention can execute the method for determining the color correction matrix provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention, and as shown in fig. 4, the computer device includes a processor 70, a memory 71, an input device 72 and an output device 73; the number of processors 70 in the computer device may be one or more, one processor 70 being taken as an example in fig. 4; the processor 70, memory 71, input means 72 and output means 73 in the computer device may be connected by a bus or other means, in fig. 4 by way of example.
The memory 71 is a computer-readable storage medium, and may be used to store a software program, a computer-executable program, and modules corresponding to the method for determining a color correction matrix in the embodiment of the present invention (for example, the saturation correction module 310, the color correction matrix discrete module 320, the color reproduction evaluation value determination module 330, and the target color correction matrix determination module 340 in the apparatus for determining a color correction matrix). The processor 70 executes various functional applications of the computer device and data processing by executing software programs, instructions and modules stored in the memory 71, i.e., implements the above-described color correction matrix determination method. The method comprises the following steps:
Acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix;
Dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices;
Acquiring video frame images matched with each candidate color correction matrix, and determining at least one color restoration evaluation value of each video frame image according to a standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
The memory 71 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the terminal, etc. In addition, memory 71 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 71 may further include memory remotely located relative to processor 70, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 72 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the computer device. The output means 73 may comprise a display device such as a display screen.
Example five
A fifth embodiment of the present invention also provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a method of determining a color correction matrix, the method comprising:
Acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix;
Dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices;
Acquiring video frame images matched with each candidate color correction matrix, and determining at least one color restoration evaluation value of each video frame image according to a standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the method for determining a color correction matrix provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk, or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above-mentioned determination device for a color correction matrix, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.
Claims (10)
1. A method of determining a color correction matrix, comprising:
Acquiring an initial color correction matrix, and performing saturation correction on the initial color correction matrix;
Dispersing the color correction matrix subjected to saturation correction to obtain at least two candidate color correction matrices;
Acquiring video frame images matched with each candidate color correction matrix, and determining at least one color restoration evaluation value of each video frame image according to a standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
2. The method of claim 1, wherein obtaining an initial color correction matrix and performing saturation correction on the initial color correction matrix comprises:
Acquiring shooting device metadata, and determining an initial color correction matrix according to the shooting device metadata;
transmitting the initial color correction matrix to a shooting device, and acquiring a video frame image shot by the shooting device;
and correcting the saturation of the initial color correction matrix according to the saturation of the video frame image and the standard saturation of the standard color card.
3. The method of claim 1, wherein obtaining an initial color correction matrix and performing saturation correction on the initial color correction matrix comprises:
taking the unit color correction matrix as an initial color correction matrix;
according to the standard saturation of the standard color card, carrying out saturation correction on the initial color correction matrix;
the color correction matrix after the saturation correction is discretized, which comprises the following steps:
and performing tone adjustment on the color correction matrix after the saturation correction, and performing dispersion on the color correction matrix after the tone adjustment.
4. The method of claim 1, wherein discretizing the saturation corrected color correction matrix to obtain at least two candidate color correction matrices comprises:
and increasing or decreasing the deviation value of at least one data in the color correction matrix after the saturation correction to obtain at least two candidate color correction matrices.
5. The method of claim 1, wherein determining the target color correction matrix based on at least one color reproduction evaluation value for each video frame image comprises:
Screening at least one video frame image meeting the limiting condition according to at least one color reduction evaluation value of each video frame image;
determining a target video frame image of which the average value of the chromatic aberration of each color block meets an average value condition in the video frame images meeting the limiting condition;
determining a target color correction matrix according to the color correction matrix matched with the target video frame image;
Wherein, the satisfaction of the constraint condition means satisfaction of at least one of the following: at least one color block saturation deviation is within a preset saturation deviation interval, at least one color block Lab deviation is within a preset Lab deviation interval, and at least one color block color difference is within a preset color block color difference interval.
6. The method of claim 5, wherein determining the target color correction matrix based on the color correction matrix matching the target video frame image comprises:
The color correction matrix matched with the target video frame image is used as an intermediate color correction matrix;
dispersing the intermediate color correction matrix to obtain at least two candidate color correction matrices;
Repeatedly executing the operation of obtaining the video frame images matched with the candidate color correction matrixes until the cyclical exit condition is met;
taking the currently determined intermediate color correction matrix as a target color correction matrix;
The cycle exit condition is that the currently determined intermediate color correction matrix is the same as the intermediate color correction matrix determined in the previous round, or the cycle times are greater than or equal to a preset numerical value.
7. The method of claim 1, wherein obtaining video frame images that match each candidate color correction matrix comprises:
adjusting at least one video stream parameter;
transmitting each candidate color correction matrix to a shooting device after adjusting video stream parameters, and acquiring a video frame image shot by the shooting device;
wherein the video stream parameters include resolution, code rate, and key frame interval.
8. A color correction matrix determining apparatus, comprising:
The saturation correction module is used for acquiring an initial color correction matrix and correcting the saturation of the initial color correction matrix;
The color correction matrix discrete module is used for performing the dispersion on the color correction matrix subjected to the saturation correction to obtain at least two candidate color correction matrices;
The color restoration evaluation value determining module is used for acquiring video frame images matched with each candidate color correction matrix and determining at least one color restoration evaluation value of each video frame image according to the standard color card;
The color reproduction evaluation value comprises a color difference average value of each color block, at least one color block saturation deviation, at least one color block Lab deviation and at least one color block color difference;
And the target color correction matrix determining module is used for determining a target color correction matrix according to at least one color restoration evaluation value of each video frame image.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of determining a color correction matrix according to any of claims 1-7 when executing the program.
10. A storage medium storing computer executable instructions which, when executed by a computer processor, are adapted to carry out the method of determining a color correction matrix according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211303265.XA CN117974811A (en) | 2022-10-24 | 2022-10-24 | Color correction matrix determining method, device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211303265.XA CN117974811A (en) | 2022-10-24 | 2022-10-24 | Color correction matrix determining method, device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117974811A true CN117974811A (en) | 2024-05-03 |
Family
ID=90844658
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211303265.XA Pending CN117974811A (en) | 2022-10-24 | 2022-10-24 | Color correction matrix determining method, device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117974811A (en) |
-
2022
- 2022-10-24 CN CN202211303265.XA patent/CN117974811A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110288614B (en) | Image processing method, device, equipment and storage medium | |
CN110033510B (en) | Method and device for establishing color mapping relation for correcting rendered image color | |
CN112073703B (en) | Method and device for adjusting color correction matrix, terminal equipment and medium | |
TW201106685A (en) | Foreground image separation method | |
US20230230215A1 (en) | Image processing method and apparatus, device, and medium | |
CN110248170B (en) | Image color adjusting method and device | |
WO2020010638A1 (en) | Method and device for detecting defective pixel in image | |
CN111861922A (en) | Method and device for adjusting color correction matrix and storage medium | |
CN112788251B (en) | Image brightness processing method and device, and image processing method and device | |
CN110855958A (en) | Image adjusting method and device, electronic equipment and storage medium | |
CN108174173B (en) | Photographing method and apparatus, computer-readable storage medium, and computer device | |
CN111369486A (en) | Image fusion processing method and device | |
CN102088539A (en) | Method and system for evaluating pre-shot picture quality | |
CN112492191B (en) | Image acquisition method, device, equipment and medium | |
CN108810509A (en) | A kind of image color correction method and device | |
CN117974811A (en) | Color correction matrix determining method, device, electronic equipment and storage medium | |
CN113379650B (en) | Face image exposure method and device, electronic equipment and storage medium | |
CN113099191B (en) | Image processing method and device | |
CN112435173A (en) | Image processing and live broadcasting method, device, equipment and storage medium | |
CN115474316A (en) | Method and device for controlling atmosphere lamp, electronic equipment and storage medium | |
JP2009070099A (en) | Image-processing device, image-processing method, program and recording medium | |
CN114255193A (en) | Board card image enhancement method, device, equipment and readable storage medium | |
CN113596422A (en) | Method for adjusting color correction matrix CCM and monitoring equipment | |
CN113395407A (en) | Image processing apparatus, image processing method, and computer readable medium | |
CN114375569A (en) | Method and related device for processing image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |