CN115426485A - Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium - Google Patents
Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium Download PDFInfo
- Publication number
- CN115426485A CN115426485A CN202210911085.3A CN202210911085A CN115426485A CN 115426485 A CN115426485 A CN 115426485A CN 202210911085 A CN202210911085 A CN 202210911085A CN 115426485 A CN115426485 A CN 115426485A
- Authority
- CN
- China
- Prior art keywords
- data
- color correction
- real
- correction matrix
- time
- 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 207
- 239000011159 matrix material Substances 0.000 title claims abstract description 186
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000013507 mapping Methods 0.000 claims description 33
- 229940050561 matrix product Drugs 0.000 claims description 23
- 238000004364 calculation method Methods 0.000 claims description 18
- 238000010606 normalization Methods 0.000 claims description 6
- 230000007613 environmental effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000004044 response Effects 0.000 description 6
- 238000001228 spectrum Methods 0.000 description 6
- 201000000760 cerebral cavernous malformation Diseases 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
Landscapes
- Processing Of Color Television Signals (AREA)
Abstract
The application discloses a color correction matrix adjusting method, an image pickup apparatus, an electronic apparatus, and a computer-readable storage medium. The color correction matrix adjustment method comprises the following steps: acquiring calibration data of the camera equipment; acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data. By means of the method, the generated new color correction matrix can be dynamically adjusted in real time based on the real-time scene where the camera device is located.
Description
Technical Field
The present application relates to the field of video surveillance technology, and in particular, to a color correction matrix adjustment method, an image capture device, an electronic device, and a computer-readable storage medium.
Background
An existing Color Correction Matrix (CCM) is generally used in a camera device by calibrating a set of target CCMs respectively at high, medium and low Color temperatures in advance.
In actual use, the CCM action is calibrated in advance, and the purpose of unifying the debugged image pickup device and the target color style is achieved. In order to keep color reproducibility consistent with the laboratory calibration stage in any scene, it is preferable that all possible gamma curves are used for calibration in the laboratory calibration stage, all CCMs obtained by calibration are stored in the image capturing device, and when the CCMs are actually used, the corresponding CCMs are selected and used according to the currently used gamma curves.
However, in actual use, the gamma curves are not limited to a plurality of curves pre-stored in the image pickup device, but are generated by the image pickup device through real-time dynamic adjustment according to the current scene, so that the gamma curves to be used cannot be estimated in advance, and the previous calibration cannot be performed to obtain the corresponding CCM.
Disclosure of Invention
The application provides a method and a device for adjusting a color correction matrix, electronic equipment and a computer readable storage medium, which are used for solving the problem that the color correction matrix cannot be dynamically generated in real time.
In order to solve the technical problem, the application adopts a technical scheme that: there is provided a color correction matrix adjustment method, the method comprising:
acquiring calibration data of the camera equipment; acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
The calibration data comprises calibration color correction matrix data, calibration gamma curve data and a color mapping table, and the color correction matrix data is associated with the gamma curve data through the color mapping table.
Wherein, based on the calibration data and the real-time gamma curve data, generating the real-time color correction matrix data comprises:
calculating a correction coefficient based on the color mapping table, the calibration color correction matrix data, the calibration gamma curve data and the real-time gamma curve data; and calculating real-time color correction matrix data based on the correction coefficient and the calibration color correction matrix data.
Calculating a correction coefficient based on the color mapping table, the calibrated color correction matrix data, the calibrated gamma curve data and the real-time gamma curve data, comprising:
acquiring a matrix product of the calibrated color correction matrix data and a color mapping table; acquiring gamma data based on the matrix product and the calibrated gamma curve data; acquiring color correction matrix data based on the real-time gamma curve data and the gamma data; and acquiring a correction coefficient based on the color correction matrix data and the matrix product.
Based on the matrix product and the calibration gamma curve data, the gamma data is obtained, which comprises the following steps:
and inputting the matrix product into calibration gamma curve data to perform table lookup so as to obtain gamma data.
Wherein, based on real-time gamma curve data and gamma data, acquire color correction matrix data, include:
acquiring an inverse array of the real-time gamma curve data based on the real-time gamma curve data; and inputting the gamma data into an inverse array for table lookup to obtain color correction matrix data.
Wherein calculating real-time color correction matrix data based on the correction coefficients and the calibration color correction matrix data comprises:
calculating uncorrected matrix data of the real-time color correction matrix data based on the correction coefficient and the calibration color correction matrix data; and carrying out normalization operation on the uncorrected matrix data to obtain real-time color correction matrix data.
The method for acquiring the real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located comprises the following steps:
adjusting the dynamic range of the camera equipment in real time based on the environment; acquiring first image data and second image data before and after the dynamic range of the camera equipment is adjusted; and obtaining real-time gamma curve data through curve fitting based on the first image data and the second image data.
Wherein, the color correction matrix adjusting method further comprises:
acquiring a current image; generating current color correction matrix data based on environmental information of a current image; color correction is performed on the current image based on the current color correction matrix data.
In order to solve the above technical problem, another technical solution adopted by the present application is: provided is an image pickup apparatus including a data acquisition module, a calculation module, and a storage module.
The data acquisition module is used for acquiring calibration data of the camera equipment and acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; the calculation module is used for generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data; the storage module is used for storing calibration data.
In order to solve the technical problem, the application adopts a technical scheme that: the electronic equipment comprises a processor and a memory connected with the processor, wherein program data are stored in the memory, and the processor executes the program data stored in the memory to realize the following steps: acquiring calibration data of the camera equipment; acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
In order to solve the above technical problem, another technical solution adopted by the present application is: there is provided a computer readable storage medium having stored therein program instructions that are executed to implement: acquiring calibration data of the camera equipment; acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
The beneficial effect of this application is: be different from prior art's condition, this application is through the calibration data who acquires camera equipment, obtain real-time gamma curve data based on the environment at camera equipment place again, thereby based on calibration data and real-time gamma curve data, generate real-time color correction matrix data, the current situation that traditional color correction matrix adjustment and gamma curve data adjustment are disjointed has been improved, this application can make color correction matrix data can carry out dynamic linkage adjustment with gamma curve data, make camera equipment's color correction's efficiency higher, image output's colour style is better.
Drawings
FIG. 1 is a schematic diagram of the response of a sensor to RGB spectra;
FIG. 2 is a diagram showing the response of the human eye to RGB spectra;
FIG. 3 is a formula for color matrix correction;
FIG. 4 is a flowchart illustrating a first embodiment of a color correction matrix adjustment method according to the present application;
FIG. 5 is a schematic flow chart of a first embodiment of step S103 in FIG. 4;
FIG. 6 is a flowchart illustrating an embodiment of step S201 in FIG. 5;
FIG. 7 is a flowchart illustrating an embodiment of step S303 in FIG. 6;
FIG. 8 is a schematic flow chart of a second embodiment of step S103 in FIG. 4;
FIG. 9 is a flowchart illustrating an embodiment of step S102 in FIG. 4;
FIG. 10 is a schematic control flow chart of an embodiment of the color correction matrix adjustment method according to the present application;
FIG. 11 is a flowchart illustrating a second embodiment of a color correction matrix adjustment method according to the present application;
fig. 12 is a schematic structural diagram of an embodiment of an image pickup apparatus according to the present application;
FIG. 13 is a schematic structural diagram of an embodiment of an electronic device of the present application;
FIG. 14 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the development of security technology, the improvement of image quality is more and more emphasized in the present situation, colors are used as the most important components of image quality, and the appearance presented by the style characteristics of the colors is often the first index of video evaluation of users. Currently, the most common way to do color processing is a color correction matrix. The color correction matrix is a color correction mode which is used for correcting the difference of the sensor and the human eye in response to the spectrum and enabling the image picture of the video to be closer to the physical world seen by the human eye. Referring to fig. 1 and fig. 2, as shown in fig. 1, fig. 1 is a schematic diagram of a response of a sensor to an RGB spectrum, and fig. 2 is a schematic diagram of a response of a human eye to an RGB spectrum, it can be seen that RGB response curves of the sensor and the RGB spectrum are not consistent, and after an image is subjected to white balance processing, a color shift is certainly present, and therefore, a color matrix needs to be corrected. Referring to fig. 3, fig. 3 shows a formula of color matrix correction. The color correction matrix is a 3*3 matrix, and the matrix is multiplied by the statistical value of the RGB channel of the original image to obtain the RGB channel value of the target image.
The existing color correction matrix is generally used in the camera equipment by calibrating a group of target color correction matrices at a high color temperature, a medium color temperature and a low color temperature respectively in advance, estimating the color temperature value of a current monitoring picture by the equipment through an algorithm, and then interpolating and searching the corresponding color correction matrix for use in the camera equipment.
In actual use, the action of the color correction CCM is calibrated in advance, so as to realize the unification of the debugged image pickup apparatus and the target color style. In the debugging process, the color style difference between the debugged camera equipment and the target camera equipment is usually subjectively judged by human eyes, each element in the 3*3 matrix of the color correction matrix is finely adjusted according to the debugging experience of actual debugging personnel, the color style difference is compared at the camera equipment end after adjustment, and the intermediate process consumes time and labor and is very inefficient. Meanwhile, in the practical use of the camera device, the dynamic range module can be adjusted in real time according to the current scene, and different gamma curves can be used at this time.
The dynamic range refers to the richness of the dark part details and the bright part details recorded by the digital camera at the same time, and the higher the dynamic range is, the more abundant the picture details can be recorded. In the image pickup apparatus, there occurs a deviation in brightness of an actually output image due to a graphic card or a display, and a gamma curve is used to correct the brightness deviation of the image.
After a dynamic range module of the image pickup device changes, the color reducibility of an image is affected, theoretically, in order to keep the color reducibility consistent with that in a laboratory calibration stage in any scene, preferably, in the laboratory calibration stage, all possible gamma curves are used for calibration, all calibrated color correction matrix values are stored in the image pickup device, and when the image pickup device is actually used, the corresponding color correction matrix value is selected and used according to the currently used gamma curve. However, in actual use, the gamma curve is not fixed, nor limited several, but is generated by the camera device according to the current scene through real-time dynamic adjustment. It is therefore not possible to estimate in advance the gamma curve that will be used, and it is not possible to calibrate the color correction matrix beforehand.
To solve the above problems, the present application first provides a method for adjusting a color correction matrix, please refer to fig. 4, as shown in fig. 4, fig. 4 is a flowchart illustrating a first embodiment of the method for adjusting a color correction matrix according to the present application. The method specifically comprises the following steps S101 to S103:
step S101: calibration data of the image pickup apparatus is acquired.
The method comprises the steps that camera equipment obtains calibration data of the camera equipment, wherein the calibration data of the camera equipment comprises a color mapping table, calibration color correction matrix data and calibration gamma curve data, and the color mapping table is a 3*n table and belongs to a 3D display lookup table; the calibration color correction matrix data is a color correction matrix in a laboratory calibration stage, which is a 3*3 matrix shown in fig. 3; the calibration gamma curve data is a gamma curve corresponding to the calibration color correction matrix data, so that the image output by the camera equipment has better output quality after passing through the calibration color correction matrix data and the calibration gamma curve data. The camera shooting equipment stores the self calibration data including the color mapping table in the self equipment, and provides a calculation basis for subsequently adjusting the real-time color correction matrix data.
Step S102: and acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located.
In the practical use of the camera equipment, the gamma curve data can be adjusted in real time according to the environment where the gamma curve is located, the gamma curve can be transformed at this time, real-time gamma curve data corresponding to the environment are generated, and at the moment, the camera equipment can acquire the self real-time gamma curve data.
Step S103: and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
The camera shooting equipment is based on self calibration color correction matrix data and calibration gamma curve data, then a color mapping table is introduced, the color correction matrix data and the gamma curve data are combined together through arithmetic operation, and the real-time color correction matrix data of the camera shooting equipment are generated through calculation by acquiring the real-time gamma curve data, so that the camera shooting equipment can synchronously adjust the color correction matrix data and generate the real-time color correction matrix data when dynamically adjusting the gamma curve data in the actual operation of the equipment.
Be different from prior art, this application is through the calibration data who obtains camera equipment, and real-time gamma curve data is obtained based on the environment at camera equipment place again to based on calibration data and real-time gamma curve data, generate real-time color correction matrix data, improved the current situation that traditional color correction matrix adjustment is disjointed with gamma curve data adjustment, this application can make color correction matrix data can carry out dynamic linkage adjustment with gamma curve data, make camera equipment's color correction's efficiency higher, image output's colour style is unified.
Optionally, please refer to fig. 5 for a method for generating real-time color correction matrix data, as shown in fig. 5, fig. 5 is a flowchart illustrating a first embodiment of step S103 in fig. 4. The calibration data comprises calibration color correction matrix data, calibration gamma curve data and color mapping. The color correction matrix data and the gamma curve data are associated by a color mapping table, and the embodiment can realize step S103 by the method shown in fig. 4, and the specific implementation steps include step S201 to step S202:
step S201: and calculating a correction coefficient based on the color mapping table, the calibration color correction matrix data, the calibration gamma curve data and the real-time gamma curve data.
The color mapping table is a 3*n table, belongs to a 3D display lookup table, and divides three channels of RGB into a plurality of parts to form a three-dimensional table. The color mapping table calibrated in the present application may be a linear table, which may be embodied as a 3 × 4096 table in this embodiment, and in other embodiments, the present application may freely select other display lookup tables, which is not limited herein.
The camera device firstly acquires the calibration color correction matrix data and the calibration gamma curve data of the camera device, and stores the color mapping table lut _ original, the calibration color correction matrix data ccm _ original and the calibration gamma curve data gamma _ original into the camera device. The image capturing apparatus obtains real-time gamma curve data of itself again, and associates the color correction matrix data with the gamma curve data by introducing a color mapping table lut _ original, so as to calculate a correction coefficient of the color correction data, in this embodiment, the color mapping table lut _ original is one matrix data of 3 × 4096.
Optionally, fig. 6 is a schematic flowchart of an embodiment of step S201 in fig. 5. In this embodiment, step S201 can be implemented by the method shown in fig. 6, and the specific implementation steps include step S301 to step S304:
step S301: and acquiring the matrix product of the calibration color correction matrix data and the color mapping table.
The image pickup apparatus acquires a matrix product ccmmMat _ original of the calibrated color correction matrix data ccm _ original and the color mapping table lut _ original. Wherein the matrix product ccmmmat _ original = ccm _ original lut _ original.
Step S302: and acquiring gamma data based on the matrix product and the calibration gamma curve data.
The image pickup apparatus can acquire gamma data gamma mat _ original based on the matrix product ccmmmat _ original and the calibration gamma curve data gamma _ original.
Specifically, the present embodiment may implement step S302 by the following method, which has the following method:
and inputting the matrix product into the calibration gamma curve data for table lookup to obtain the gamma data.
The image capturing apparatus may perform a table lookup in the calibration gamma curve data gamma _ original with the matrix product ccmmmat _ original as an input to obtain gamma data gamma mamat _ original.
In other embodiments, the image capturing apparatus may also acquire the gamma data gamma mat _ original in other manners, which is not limited herein.
Step S303: and acquiring color correction matrix data based on the real-time gamma curve data and the gamma data.
The image pickup apparatus can acquire color correction matrix data ccmmmat _ curr by a correlation calculation method based on the real-time gamma curve data gamma _ curr and the gamma data gamma mat _ original.
Optionally, fig. 7 is a schematic flowchart of a specific embodiment of step S303 in fig. 6. In this embodiment, step S303 can be implemented by the method shown in fig. 7, and the specific implementation steps include step S401 to step S402:
step S401: an inverse array of the real-time gamma curve data is obtained based on the real-time gamma curve data.
The image pickup equipment acquires real-time gamma curve data gamma _ curr, and the inverse number group invgamma _ curr of the real-time gamma curve data is acquired by inverting the real-time gamma curve data gamma _ curr.
Step S402: and inputting the gamma data into an inverse array for table lookup to obtain color correction matrix data.
The image capturing apparatus then performs table lookup in the inverse array invgamma _ curr with the gamma data gamma mat _ original as input to obtain color correction matrix data ccmmmat _ curr.
Step S304: based on the color correction matrix data and the matrix product, a correction coefficient is obtained.
The image pickup apparatus acquires a correction coefficient coef based on color correction matrix data ccmmMat _ curr and a matrix product ccmMat _ original.
Wherein, the correction coefficient coef = ccmmmat _ original \ ccmmmat _ curr, "\\" is a matrix calculation mode, the matrix product ccmmmat _ original and the color correction matrix data ccmmmat _ curr are both arrays of 3 × 4096, and the calculation result is an array of 3*3. Where "\\" is used as an application of inverse division, equivalent to multiplication of the inverse of cmMat _ original by ccmMat _ curr.
Step S202: and calculating real-time color correction matrix data based on the correction coefficient and the calibration color correction matrix data.
After the camera device calculates the correction coefficient coef, the real-time color correction matrix data CCM can be calculated and obtained by multiplying the correction coefficient coef by the calibrated color correction matrix data CCM _ original. Wherein CCM = coef CCM _ original.
Different from the prior art, the color correction matrix adjusting method is combined with the use of a color mapping table lut _ original, so that the color correction matrix data and the gamma curve data can be dynamically adjusted in a linkage manner, the image output efficiency of the camera equipment is higher, and the color unification style of the image is better;
in fact, the dynamic adjustment of the final real-time color correction matrix data is realized by taking the color mapping table lut _ original, the calibration color correction matrix data ccm _ original and the calibration gamma curve data gamma _ original as the basis and combining the real-time gamma wireless data of the camera equipment in actual use, and the quantization operation of the color correction matrix data adjustment can be realized; in addition, aiming at the problems that the color correction matrix data and the gamma curve data are not in physical equivalent, the color mapping table lut _ original is used as a bridge of the two physical quantities, and mixed calculation of the color correction matrix data and the gamma curve data is achieved.
In the calculation process, the method also provides the method for calculating the gamma data gamma Mat _ original and the color correction matrix data ccmMat _ curr by using a table look-up mode, so that the calculation efficiency can be effectively improved, and the dynamic adjustment and mixed calculation of the color correction matrix data and the gamma curve data are realized.
Optionally, please refer to fig. 8 for a method for generating real-time color correction matrix data, as shown in fig. 8, fig. 8 is a flowchart illustrating a second embodiment of step S103 in fig. 4. The calibration data includes a color mapping table lut _ original, calibration color correction matrix data ccm _ original, and calibration gamma curve data gamma _ original. In this embodiment, step S103 can be implemented by the method shown in fig. 8, and the specific implementation steps include step S501 to step S503:
step S501: and calculating a correction coefficient based on the color mapping table, the calibrated color correction matrix data, the calibrated gamma curve data and the real-time gamma curve data.
Step S501 is identical to step S201, and is not described herein again.
Step S502: calculating uncorrected matrix data of the real-time color correction matrix data based on the correction coefficient and the calibrated color correction matrix data.
The camera device calculates the uncorrected matrix data of the real-time color correction matrix data CCM based on the correction coefficient coef and the calibrated color correction matrix data CCM _ original, and the correction coefficient coef obtained through calculation is only a correction coefficient which represents the difference change between the color correction matrix data ccmmmat _ curr and the matrix product ccmmmat _ original, and at the moment, the correction coefficient coef cannot represent the effective color correction matrix value which needs to be finally superposed to the camera device, so that the final effective color correction matrix value needs to be finally corrected and calculated with the original color correction matrix value.
Step S503: and carrying out normalization operation on the uncorrected matrix data to obtain real-time color correction matrix data.
And the camera equipment performs normalization operation on the uncorrected matrix data to acquire final real-time color correction matrix data. The specific mode is as follows: calculating the result of the real-time color correction matrix data CCM, and assuming that the result of the color correction matrix data CCM is [ c00 c01 c02; c10 c11 c12; c20 c21 c22], then to ensure the normality of the matrix, c02=1-c00-c01 may be constrained; c12=1-c10-c11; c22=1-c20-c21. In other embodiments, there are many specific constraint manners, and the constraint manner is not limited to this embodiment.
According to the method and the device, normalization operation is carried out on the finally calculated real-time color correction matrix data CCM, so that the final real-time color correction matrix data can be ensured to be effective in the camera equipment, and the stability of the color correction matrix adjusting method is improved.
Optionally, please refer to fig. 9 for a method of acquiring real-time gamma curve data, as shown in fig. 9, fig. 9 is a schematic flowchart of an embodiment of step S102 in fig. 4. In this embodiment, step S102 may be implemented by the method shown in fig. 9, and the specific implementation steps include step S601 to step S603:
step S601: the dynamic range of the real-time camera device is adjusted based on the environment.
The image pickup apparatus adjusts its own dynamic range in real time based on the environment. The dynamic range is adjusted in real time based on the current environment, and the gamma curve data used by the camera device is different due to the difference of the dynamic range. When the image pickup apparatus adjusts the dynamic range, there are various ways of adjusting the dynamic range, and it is common to adjust the dynamic range by adjusting gamma curve data.
Step S602: the method comprises the steps of acquiring first image data and second image data before and after the dynamic range of the camera shooting equipment is adjusted.
However, the image capturing apparatus does not adjust the gamma curve data in the adjustment manner used when adjusting the dynamic range, and at this time, the image capturing apparatus needs to acquire the first image data and the second image data before and after the adjustment of the dynamic range of the image capturing apparatus. For example, first image luminance data a of the image pickup apparatus before the adjustment and second image luminance data B after the adjustment of the image pickup apparatus are acquired.
Step S603: and obtaining real-time gamma curve data through curve fitting based on the first image data and the second image data.
The image pickup device can acquire the real-time gamma curve data gamma _ curr through the second image brightness data B and the first image brightness data A in a curve fitting mode.
According to the method and the device, the real-time gamma curve data are obtained by fitting through the first image data and the second image data before and after the dynamic module is adjusted, and when the dynamic range of the camera shooting equipment is adjusted in any mode, the kinetic energy is obtained to obtain equivalent real-time gamma curve data, so that the efficiency of the color correction matrix adjusting method is improved.
In an application scenario, please refer to fig. 10, where fig. 10 is a control flow diagram of an embodiment of the color correction matrix adjustment method according to the present application. The control flow of a specific scheme of the color correction matrix adjustment method of the present embodiment specifically includes steps S701 to S709:
step S701: the image pickup apparatus stores therein a color mapping table lut _ original, calibration color correction matrix data ccm _ original, and calibration gamma curve data gamma _ original.
Step S702: calculate matrix product ccmmmat _ original = ccm _ original lut _ original.
Step S703: and performing table lookup in the gamma curve calibration data gamma _ original by using the matrix product ccmmMat _ original as an input to obtain gamma data gamma _ Mat _ original.
Step S704: and the dynamic range of the camera equipment is automatically adjusted according to the real-time scene, and the gamma _ curr of the real-time gamma curve data is obtained through calculation.
Step S705: and calculating an inverse array invgamma _ curr of the real-time gamma curve data gamma _ curr.
Step S706: the gamma data gamma mat _ original is used as an input to perform table lookup in the inverse array invgamma _ curr to obtain the color correction matrix data ccmmmat _ curr.
Step S707: the correction coefficient coef = ccmmmat _ original \ ccmmmat _ curr is calculated.
Step S708: the final CCM = coef CCM _ original is calculated.
Step S709: and carrying out normalization operation on the obtained preliminary CCM value to obtain a final CCM value.
Optionally, the present application further provides a method for adjusting a color correction matrix, please refer to fig. 11, as shown in fig. 11, fig. 11 is a flowchart of a second embodiment of the method for adjusting a color correction matrix according to the present application. The color correction matrix adjustment method further includes steps S801 to S803:
step S801: a current image is acquired.
The image pickup apparatus acquires a current image.
Step S802: current color correction matrix data is generated based on environmental information of a current image.
The image pickup device acquires real-time gamma curve data gamma _ curr based on current environment information, and generates current color correction matrix data through the stored color mapping table lut _ original, the calibrated color correction matrix data ccm _ original and the calibrated gamma curve data gamma _ original by the calculation method.
Step S803: color correction is performed on the current image based on the current color correction matrix data.
The image pickup apparatus performs color correction on the current image based on the current color correction matrix data, so that the color correction efficiency of the image pickup apparatus can be made higher, and the color style of the image output is uniform.
Different from the prior art, the image color style of the equipment to be debugged needs to be debugged to be consistent with the style of the target equipment based on the fact that the camera equipment is in an actual working condition, however, in the method in the prior art, the color correction matrix data is debugged by means of subjective evaluation of manpower, time and labor are consumed, and after gamma curve data dynamically change due to scene change, the corresponding color correction matrix data cannot be timely and correspondingly adjusted, so that deviation of the color style is caused. The method comprises the steps of obtaining calibration data of the camera equipment, obtaining real-time gamma curve data based on the environment where the camera equipment is located, generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data, improving the current situation that the traditional color correction matrix adjustment is disconnected with the gamma curve data adjustment, and providing the premise that the current real scene color is judged without the assistance of an intelligent detection algorithm, fully utilizing the influence of the real-time gamma curve data on the color in a color space, extracting the regular characteristic of quantitative expression in the color correction matrix data, and skillfully combining the color correction matrix data and the gamma curve data by means of a color mapping table, so that the camera equipment can automatically and dynamically link the adjustment of the color correction matrix data in the change process of the gamma curve data without human intervention, and can convert in real time in the camera equipment.
Optionally, the present application further provides an image capturing apparatus, please refer to fig. 12, and fig. 12 is a schematic structural diagram of an embodiment of the image capturing apparatus of the present application. The image capturing apparatus 100 of the present embodiment includes a data acquisition module 101, a calculation module 102, and a storage module 103.
The data acquisition module 101 is connected to the calculation module 102 and the storage module, respectively.
The data acquisition module 101 is used for acquiring calibration data of the image capturing apparatus 100 and acquiring real-time gamma curve data of the image capturing apparatus 100 based on the environment in which the image capturing apparatus 100 is located. The calibration data is color mapping table, calibration color correction matrix data and calibration gamma curve data.
The calculation module 102 is configured to generate real-time color correction matrix data based on the calibration data and the real-time gamma curve data. The storage module 103 is used for storing calibration data.
Optionally, the present application further provides an electronic device, please refer to fig. 13, where fig. 13 is a schematic structural diagram of an embodiment of the electronic device of the present application, and the electronic device 200 includes a processor 201 and a memory 202 connected to the processor 201.
The processor 201 may also be referred to as a CPU (Central Processing Unit). The processor 201 may be an integrated circuit chip having signal processing capabilities. The processor 201 may also 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 device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 202 is used for storing program data required for the processor 201 to operate.
The processor 201 is also configured to execute the program data stored in the memory 202 to implement the color correction matrix adjustment method described above.
Optionally, the present application further proposes a computer-readable storage medium. Referring to fig. 14, fig. 14 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to the present application.
The computer-readable storage medium 300 of the embodiment of the present application stores therein program instructions 310, and the program instructions 310 are executed to implement the color correction matrix adjustment method described above.
The program instructions 310 may form a program file stored in the storage medium in the form of a software product, so that an electronic device (which may be a personal computer, a server, or a network device) or a processor (processor) executes all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices, such as a computer, a server, a mobile phone, and a tablet.
The computer-readable storage medium 300 may be, but is not limited to, a usb disk, an SD card, a PD optical drive, a removable hard disk, a high-capacity floppy drive, a flash memory, a multimedia memory card, a server, etc.
In one embodiment, a computer program product or computer program is provided that includes computer instructions stored in a computer-readable storage medium. The computer instructions are read by a processor of the electronic device from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the steps in the above method embodiments.
In addition, if the above functions are implemented in the form of software functions and sold or used as a standalone product, the functions may be stored in a storage medium readable by a mobile terminal, that is, the present application also provides a storage device storing program data, which can be executed to implement the method of the above embodiments, the storage device may be, for example, a usb disk, an optical disk, a server, etc. That is, the present application may be embodied as a software product, which includes several instructions for causing an intelligent terminal to perform all or part of the steps of the methods described in the embodiments.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing mechanisms, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps in the process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device (e.g., a personal computer, server, network device, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions). For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings, or which are directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present application.
Claims (11)
1. A method for adjusting a color correction matrix, comprising:
acquiring calibration data of the camera equipment;
acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located;
and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
2. The method of adjusting a color correction matrix according to claim 1, wherein the calibration data comprises calibration color correction matrix data, calibration gamma curve data, and a color mapping table, wherein the color correction matrix data and the gamma curve data are associated by the color mapping table;
generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data, comprising:
calculating a correction coefficient based on the color mapping table, the calibration color correction matrix data, the calibration gamma curve data and the real-time gamma curve data;
and calculating the real-time color correction matrix data based on the correction coefficient and the calibration color correction matrix data.
3. The method for adjusting a color correction matrix according to claim 2, wherein the calculating a correction coefficient based on the color mapping table, the calibrated color correction matrix data, the calibrated gamma curve data and the real-time gamma curve data comprises:
obtaining a matrix product of the calibrated color correction matrix data and the color mapping table;
acquiring gamma data based on the matrix product and the calibrated gamma curve data;
acquiring color correction matrix data based on the real-time gamma curve data and the gamma data;
and acquiring the correction coefficient based on the color correction matrix data and the matrix product.
4. The method of claim 3, wherein the obtaining gamma data based on the matrix product and the calibrated gamma curve data comprises: and inputting the matrix product into the calibration gamma curve data for table lookup to obtain the gamma data.
5. The method of claim 3, wherein the obtaining color correction matrix data based on the real-time gamma curve data and the gamma data comprises:
acquiring an inverse array of the real-time gamma curve data based on the real-time gamma curve data;
and inputting the gamma data into the inverse array for table lookup to obtain the color correction matrix data.
6. The method for adjusting color correction matrix according to claim 2, wherein said calculating the real-time color correction matrix data based on the correction coefficients and the calibration color correction matrix data comprises:
calculating uncorrected matrix data of the real-time color correction matrix data based on the correction coefficient and the calibrated color correction matrix data;
and carrying out normalization operation on the uncorrected matrix data to obtain the real-time color correction matrix data.
7. The color correction matrix adjustment method according to claim 1, wherein the acquiring real-time gamma curve data of the image pickup apparatus based on an environment in which the image pickup apparatus is located comprises:
adjusting the dynamic range of the camera device in real time based on the environment;
acquiring first image data and second image data before and after the dynamic range of the camera equipment is adjusted;
and obtaining the real-time gamma curve data through curve fitting based on the first image data and the second image data.
8. The color correction matrix adjustment method according to any one of claims 1 to 7, characterized in that the color correction matrix adjustment method further comprises:
acquiring a current image;
generating current color correction matrix data based on environmental information of a current image;
color correcting the current image based on current color correction matrix data.
9. An image pickup apparatus characterized by comprising:
the data acquisition module is used for acquiring calibration data of the camera equipment and acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located;
the calculation module is used for generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data;
and the storage module is used for storing the calibration data.
10. An electronic device, comprising a processor and a memory coupled to the processor, wherein the memory stores program data therein, and the processor executes the program data stored in the memory to perform operations to:
acquiring calibration data of the camera equipment;
acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located;
and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
11. A computer-readable storage medium having stored therein program instructions that are executed to implement:
acquiring calibration data of the camera equipment;
acquiring real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located;
and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210911085.3A CN115426485A (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210911085.3A CN115426485A (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115426485A true CN115426485A (en) | 2022-12-02 |
Family
ID=84196513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210911085.3A Pending CN115426485A (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115426485A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060054954A (en) * | 2004-11-17 | 2006-05-23 | 주식회사 디지털색채연구소 | Image sensor |
KR20080092624A (en) * | 2007-04-12 | 2008-10-16 | 삼성전자주식회사 | Apparatus and method for generating wide color gamut signal in image capturing device |
US20120188390A1 (en) * | 2011-01-26 | 2012-07-26 | Samsung Electronics Co., Ltd. | Methods And Apparatuses For Out-Of-Gamut Pixel Color Correction |
US20130033585A1 (en) * | 2011-08-04 | 2013-02-07 | Aptina Imaging Corporation | Systems and methods for color compensation in multi-view video |
CN103079076A (en) * | 2013-01-22 | 2013-05-01 | 无锡鸿图微电子技术有限公司 | Method and device for generating color calibration matrix of self-adaption gamma calibration curve |
US20190188883A1 (en) * | 2017-12-19 | 2019-06-20 | Olympus Corporation | Image color conversion apparatus, non-transitory computer-readable medium storing computer program, and image color conversion method |
CN111861922A (en) * | 2020-07-21 | 2020-10-30 | 浙江大华技术股份有限公司 | Method and device for adjusting color correction matrix and storage medium |
CN111866483A (en) * | 2020-07-06 | 2020-10-30 | Oppo广东移动通信有限公司 | Color restoration method and device, computer readable medium and electronic device |
CN113596422A (en) * | 2021-07-13 | 2021-11-02 | 浙江大华技术股份有限公司 | Method for adjusting color correction matrix CCM and monitoring equipment |
CN113676712A (en) * | 2021-06-25 | 2021-11-19 | 浙江大华技术股份有限公司 | Color correction method and related device thereof |
-
2022
- 2022-07-29 CN CN202210911085.3A patent/CN115426485A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060054954A (en) * | 2004-11-17 | 2006-05-23 | 주식회사 디지털색채연구소 | Image sensor |
KR20080092624A (en) * | 2007-04-12 | 2008-10-16 | 삼성전자주식회사 | Apparatus and method for generating wide color gamut signal in image capturing device |
US20120188390A1 (en) * | 2011-01-26 | 2012-07-26 | Samsung Electronics Co., Ltd. | Methods And Apparatuses For Out-Of-Gamut Pixel Color Correction |
US20130033585A1 (en) * | 2011-08-04 | 2013-02-07 | Aptina Imaging Corporation | Systems and methods for color compensation in multi-view video |
CN103079076A (en) * | 2013-01-22 | 2013-05-01 | 无锡鸿图微电子技术有限公司 | Method and device for generating color calibration matrix of self-adaption gamma calibration curve |
US20190188883A1 (en) * | 2017-12-19 | 2019-06-20 | Olympus Corporation | Image color conversion apparatus, non-transitory computer-readable medium storing computer program, and image color conversion method |
CN111866483A (en) * | 2020-07-06 | 2020-10-30 | Oppo广东移动通信有限公司 | Color restoration method and device, computer readable medium and electronic device |
CN111861922A (en) * | 2020-07-21 | 2020-10-30 | 浙江大华技术股份有限公司 | Method and device for adjusting color correction matrix and storage medium |
CN113676712A (en) * | 2021-06-25 | 2021-11-19 | 浙江大华技术股份有限公司 | Color correction method and related device thereof |
CN113596422A (en) * | 2021-07-13 | 2021-11-02 | 浙江大华技术股份有限公司 | Method for adjusting color correction matrix CCM and monitoring equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11375128B2 (en) | Method for obtaining exposure compensation values of high dynamic range image, terminal device and non-transitory computer-readable storage medium | |
US10694079B2 (en) | Imaging apparatus that outputs raw image data and associated metadata and image processing apparatus that uses same for further processing | |
US20160352996A1 (en) | Terminal, image processing method, and image acquisition method | |
KR102369148B1 (en) | Image capture method and system | |
US8885935B2 (en) | Image processing apparatus and image processing method | |
KR20080015101A (en) | Color transformation luminance correction method and device | |
JP4905552B2 (en) | Image quality adjustment capability measurement method, apparatus and program, and image quality adjustment method, apparatus and program | |
CN113507598B (en) | Video picture display method, device, terminal and storage medium | |
US20140147090A1 (en) | Image capturing apparatus, image processing apparatus, and control method therefor | |
CN112911366B (en) | Saturation adjustment method and device and display equipment | |
Choudhury et al. | Combining quality metrics for improved hdr image quality assessment | |
CN115426485A (en) | Color correction matrix adjustment method, image pickup apparatus, electronic apparatus, and storage medium | |
US11889131B2 (en) | Video processing device, video processing method, monitor apparatus, computer device, and medium | |
EP3416364A1 (en) | Color characterization of a display system having a dynamic display control unit | |
CN118660233A (en) | Image processing method, apparatus, electronic device, readable storage medium, and program product | |
CN113012623A (en) | Display screen brightness adjusting method and device | |
CN115866414A (en) | Color correction method and system and electronic equipment | |
CN118379949A (en) | Image display method, device, electronic equipment and storage medium | |
CN117499559A (en) | Virtual shooting system, device configuration method, device, equipment and storage medium | |
CN116193271A (en) | Gamma curve debugging method, gamma curve debugging device and computer storage medium | |
CN114363507A (en) | Image processing method and device | |
CN118747989A (en) | Compression method and device of brightness compensation data and electronic equipment | |
CN115798374A (en) | System and method for carrying out on-site real-time color matching based on BoxIO | |
CN116704934A (en) | Image display method, device, electronic equipment and readable storage medium | |
CN115689905A (en) | Image processing method, device, terminal equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |