CN115426485A - Color correction matrix adjustment method, camera equipment, electronic equipment and storage medium - Google Patents
Color correction matrix adjustment method, camera equipment, electronic equipment 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
- correction matrix
- real
- 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.)
- Granted
Links
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 method for adjusting a color correction matrix, an imaging device, an electronic device, and a computer-readable storage medium. The method for adjusting the color correction matrix includes: acquiring calibration data of the imaging equipment; acquiring real-time gamma curve data of the imaging equipment based on the environment where the imaging equipment is located; and generating real-time color correction matrix data based on the calibration data and the real-time gamma curve data. Through the above method, the present application can dynamically adjust the generated new color correction matrix in real time based on the real-time scene where the camera device is located.
Description
技术领域technical field
本申请涉及视频监控技术领域,具体涉及一种色彩矫正矩阵调整方法、摄像设备、电子设备及计算机可读存储介质。The present application relates to the technical field of video monitoring, in particular to a method for adjusting a color correction matrix, an imaging device, an electronic device, and a computer-readable storage medium.
背景技术Background technique
现有的色彩矫正矩阵(Color Correction Matrix,CCM),一般都是事先在高、中、低三个色温下,各自标定一组目标CCM在摄像设备中实时使用。In the existing color correction matrix (Color Correction Matrix, CCM), generally a group of target CCMs are calibrated in advance under three color temperatures of high, medium and low, and used in real time in the camera equipment.
在实际使用中,事先标定CCM的动作,是为了实现被调试摄像设备与目标颜色风格统一。理论上为了保持色彩还原性在任何场景下都能够和实验室标定阶段保持一致,最好是需要在实验室标定阶段,使用所有可能用到的伽马曲线都进行标定,将所有标定得到的CCM都保存于摄像设备中,在实际使用的时候再根据当前所使用的伽马曲线选择使用对应的CCM。In actual use, the action of the CCM is calibrated in advance to achieve the uniform color style of the debugged camera equipment and the target. Theoretically, in order to keep the color reproduction consistent with the laboratory calibration stage in any scene, it is best to use all possible gamma curves for calibration in the laboratory calibration stage, and the CCM obtained from all calibrations They are all stored in the camera device, and the corresponding CCM is selected and used according to the gamma curve currently used during actual use.
但是,在实际使用中,伽马曲线并不是有限若干条预存于摄像设备中,而是摄像设备根据当前的场景,实时动态调整生成的,因此不可能预先估计到会使用的伽马曲线,也就无法进行事前的标定,获取对应的CCM。However, in actual use, a limited number of gamma curves are not pre-stored in the camera device, but are dynamically adjusted and generated by the camera device in real time according to the current scene. Therefore, it is impossible to estimate the gamma curve that will be used in advance, nor It is impossible to perform pre-calibration and obtain the corresponding CCM.
发明内容Contents of the invention
本申请提出了一种色彩矫正矩阵调整方法、装置、电子设备及计算机可读存储介质,以解决上述色彩矫正矩阵不能实时动态生成的问题。The present application proposes a color correction matrix adjustment method, device, electronic equipment, and computer-readable storage medium to solve the above-mentioned problem that the color correction matrix cannot be dynamically generated in real time.
为解决上述技术问题,本申请采用的一个技术方案是:提供一种色彩矫正矩阵调整方法,该方法包括:In order to solve the above technical problems, a technical solution adopted by the present application is to provide a color correction matrix adjustment method, which includes:
获取摄像设备的标定数据;基于摄像设备所在的环境获取摄像设备的实时伽马曲线数据;基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据。Obtain the calibration data of the imaging equipment; acquire the real-time gamma curve data of the imaging equipment based on the environment where the imaging equipment is located; and generate real-time color correction matrix data based on the calibration data and the real-time gamma curve data.
其中,标定数据包括标定色彩矫正矩阵数据、标定伽马曲线数据及颜色映射表,色彩矫正矩阵数据与伽马曲线数据通过颜色映射表关联。Wherein, the calibration data includes calibration color correction matrix data, calibration gamma curve data and a color mapping table, and the color correction matrix data and gamma curve data are associated through the color mapping table.
其中,基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据包括:Among them, based on calibration data and real-time gamma curve data, generating real-time color correction matrix data includes:
基于颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据及实时伽马曲线数据计算矫正系数;基于矫正系数与标定色彩矫正矩阵数据计算实时色彩矫正矩阵数据。The correction coefficient is calculated based on the color mapping table, the calibrated color correction matrix data, the calibrated gamma curve data and the real-time gamma curve data; the real-time color correction matrix data is calculated based on the correction coefficient and the calibrated color correction matrix data.
基于颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据及实时伽马曲线数据计算矫正系数,包括:Calculate the correction coefficient based on the color mapping table, calibrated color correction matrix data, calibrated gamma curve data and real-time gamma curve data, including:
获取标定色彩矫正矩阵数据与颜色映射表的矩阵乘积;基于矩阵乘积及标定伽马曲线数据,获取伽马数据;基于实时伽马曲线数据及伽马数据,获取色彩矫正矩阵数据;基于色彩矫正矩阵数据及矩阵乘积,获取矫正系数。Obtain the matrix product of calibrated color correction matrix data and color mapping table; obtain gamma data based on matrix product and calibrated gamma curve data; obtain color correction matrix data based on real-time gamma curve data and gamma data; based on color correction matrix Multiply the data and the matrix to obtain the correction coefficient.
其中,基于矩阵乘积及标定伽马曲线数据,获取伽马数据,包括:Among them, the gamma data is obtained based on the matrix product and the calibration gamma curve data, including:
将矩阵乘积输入至标定伽马曲线数据进行查表,以获取伽马数据。Input the matrix product into the calibrated gamma curve data for table lookup to obtain gamma data.
其中,基于实时伽马曲线数据及伽马数据,获取色彩矫正矩阵数据,包括:Among them, based on the real-time gamma curve data and gamma data, the color correction matrix data is obtained, including:
基于实时伽马曲线数据获取实时伽马曲线数据的逆数组;将伽马数据输入至逆数组中进行查表,以获取色彩矫正矩阵数据。Obtain an inverse array of the real-time gamma curve data based on the real-time gamma curve data; input the gamma data into the inverse array to perform table lookup to obtain color correction matrix data.
其中,基于矫正系数与标定色彩矫正矩阵数据计算实时色彩矫正矩阵数据,包括:Among them, the real-time color correction matrix data is calculated based on the correction coefficient and the calibration color correction matrix data, including:
基于矫正系数与标定色彩矫正矩阵数据计算实时色彩矫正矩阵数据的未修正矩阵数据;对未修正矩阵数据进行归一化操作,以获取实时色彩矫正矩阵数据。Calculate the uncorrected matrix data of the real-time color correction matrix data based on the correction coefficient and the calibrated color correction matrix data; perform a normalization operation on the uncorrected matrix data to obtain the real-time color correction matrix data.
其中,基于摄像设备所在的环境获取摄像设备的实时伽马曲线数据,包括:Wherein, the real-time gamma curve data of the camera device is obtained based on the environment where the camera device is located, including:
基于环境实时调整摄像设备的动态范围;获取摄像设备动态范围调整前后的第一图像数据及第二图像数据;基于第一图像数据及第二图像数据,通过曲线拟合以获取实时伽马曲线数据。Adjust the dynamic range of the camera device in real time based on the environment; obtain the first image data and the second image data before and after the dynamic range adjustment of the camera device; based on the first image data and the second image data, obtain real-time gamma curve data through curve fitting .
其中,色彩矫正矩阵调整方法进一步包括:Wherein, the color correction matrix adjustment method further includes:
获取当前图像;基于当前图像的环境信息生成当前色彩矫正矩阵数据;基于当前色彩矫正矩阵数据对当前图像进行色彩矫正。Acquiring the current image; generating current color correction matrix data based on the environment information of the current image; performing color correction on the current image based on the current color correction matrix data.
为解决上述技术问题,本申请采用的另一个技术方案是:提供一种摄像设备,该摄像设备包括数据获取模块、计算模块及存储模块。In order to solve the above technical problems, another technical solution adopted by the present application is to provide an imaging device, which includes a data acquisition module, a calculation module and a storage module.
数据获取模块用于获取摄像设备的标定数据,及基于摄像设备所在的环境获取摄像设备的实时伽马曲线数据;计算模块用于基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据;存储模块用于存储标定数据。The data acquisition module is used to obtain the calibration data of the camera equipment, and obtain the real-time gamma curve data of the camera equipment based on the environment where the camera equipment is located; the calculation module is used to generate real-time color correction matrix data based on the calibration data and the real-time gamma curve data; The storage module is used to store calibration data.
为解决上述技术问题,本申请采用的一个技术方案是:提供一种电子设备,该电子设备包括处理器及与处理器连接的存储器,存储器中存储有程序数据,处理器执行存储器存储的程序数据,以执行实现:获取摄像设备的标定数据;基于摄像设备所在的环境获取摄像设备的实时伽马曲线数据;基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据。In order to solve the above technical problems, a technical solution adopted by the present application is to provide an electronic device, the electronic device includes a processor and a memory connected to the processor, the memory stores program data, and the processor executes the program data stored in the memory , to implement: obtain the calibration data of the camera device; obtain the real-time gamma curve data of the camera device based on the environment where the camera device is located; generate 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 problems, another technical solution adopted by this application is to provide a computer-readable storage medium, which stores program instructions inside, and the program instructions are executed to realize: obtaining the calibration data of the imaging equipment; Acquire real-time gamma curve data of camera equipment in an environment; generate real-time color correction matrix data based on calibration data and real-time gamma curve data.
本申请的有益效果是:区别于现有技术的情况,本申请通过获取摄像设备的标定数据,再基于摄像设备所在的环境获取实时的伽马曲线数据,从而基于标定数据和实时的伽马曲线数据,生成实时的色彩矫正矩阵数据,改进了传统的色彩矫正矩阵调整与伽马曲线数据调整脱节的现状,本申请能够使色彩矫正矩阵数据能够与伽马曲线数据进行动态的联动调整,使摄像设备的色彩矫正的效率更高,图像输出的颜色风格更好。The beneficial effect of the present application is: different from the situation of the prior art, the present application obtains the calibration data of the camera equipment, and then obtains the real-time gamma curve data based on the environment where the camera equipment is located, so that based on the calibration data and the real-time gamma curve data to generate real-time color correction matrix data, which improves the current situation that the traditional color correction matrix adjustment and gamma curve data adjustment are out of touch. The color correction efficiency of the device is higher, and the color style of the image output is better.
附图说明Description of drawings
图1是传感器对RGB光谱的响应示意图;Figure 1 is a schematic diagram of the sensor's response to the RGB spectrum;
图2是人眼对RGB光谱的响应示意图;Figure 2 is a schematic diagram of the response of the human eye to the RGB spectrum;
图3是色彩矩阵矫正的公式;Fig. 3 is the formula of color matrix correction;
图4是本申请色彩矫正矩阵调整方法第一实施例的流程示意图;FIG. 4 is a schematic flowchart of the first embodiment of the color correction matrix adjustment method of the present application;
图5是图4中步骤S103的第一实施例的流程示意图;FIG. 5 is a schematic flow chart of a first embodiment of step S103 in FIG. 4;
图6是图5中步骤S201的一具体实施例的流程示意图;FIG. 6 is a schematic flow chart of a specific embodiment of step S201 in FIG. 5;
图7是图6中步骤S303的一具体实施例的流程示意图;FIG. 7 is a schematic flow chart of a specific embodiment of step S303 in FIG. 6;
图8是图4中步骤S103的第二实施例的流程示意图;FIG. 8 is a schematic flowchart of a second embodiment of step S103 in FIG. 4;
图9是图4中步骤S102的一具体实施例的流程示意图;FIG. 9 is a schematic flow chart of a specific embodiment of step S102 in FIG. 4;
图10是本申请色彩矫正矩阵调整方法一具体方案的控制流程示意图;Fig. 10 is a schematic diagram of the control flow of a specific solution of the color correction matrix adjustment method of the present application;
图11是本申请色彩矫正矩阵调整方法第二实施例的流程示意图;FIG. 11 is a schematic flowchart of the second embodiment of the color correction matrix adjustment method of the present application;
图12是本申请摄像设备一实施例的结构示意图;Fig. 12 is a schematic structural diagram of an embodiment of the imaging device of the present application;
图13是本申请电子设备一实施例的结构示意图;FIG. 13 is a schematic structural diagram of an embodiment of the electronic device of the present application;
图14是本申请计算机可读存储介质一实施例的结构示意图。Fig. 14 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
随着安防技术的发展,现状越来越重视图像质量的提升,颜色作为图像质量最重要的组成部分,其风格特征呈现出的观感往往会成为用户评价视频的第一指标。目前在做颜色处理上,最常用的方式是色彩矫正矩阵。色彩矫正矩阵是为纠正传感器与人眼对光谱响应差异,为了让视频的图像画面更贴近人眼所见物理世界而出现的一种色彩校正方式。请参阅图1及图2,如图1所示,图1是传感器对RGB光谱的响应示意图,图2是人眼对RGB光谱的响应示意图,可以看到,两者的RGB响应曲线是不一致的,并且图像经过白平衡处理之后,肯定会存在色偏,因此需要进行色彩矩阵的矫正。请参阅图3,图3是色彩矩阵矫正的公式。色彩矫正矩阵是一个3*3的矩阵,矩阵与原图像的RGB通道的统计值相乘,得到目标图像的RGB的通道值。With the development of security technology, the status quo pays more and more attention to the improvement of image quality. As the most important part of image quality, color is the first indicator for users to evaluate the video. At present, the most commonly used method for color processing is the color correction matrix. The color correction matrix is a color correction method to correct the difference in spectral response between the sensor and the human eye, and to make the video image closer to the physical world seen by the human eye. Please refer to Figure 1 and Figure 2, as shown in Figure 1, Figure 1 is a schematic diagram of the response of the sensor to the RGB spectrum, and Figure 2 is a schematic diagram of the response of the human eye to the RGB spectrum, it can be seen that the RGB response curves of the two are inconsistent , and after the image is processed by white balance, there will definitely be a color cast, so it is necessary to correct the color matrix. Please refer to Figure 3, Figure 3 is the formula for color matrix correction. The color correction matrix is a 3*3 matrix, which is multiplied by the statistical value of the RGB channel of the original image to obtain the RGB channel value of the target image.
现有的色彩矫正矩阵,一般都是事先在高、中、低三个色温下,各自标定一组目标色彩矫正矩阵在摄像设备中实时使用,设备经过算法估计当前监控画面的色温值,然后去插值查找到对应的色彩矫正矩阵在摄像设备中使用。Existing color correction matrices generally calibrate a set of target color correction matrices at high, medium and low color temperatures in advance and use them in real time in camera equipment. The equipment estimates the color temperature value of the current monitoring screen through an algorithm, and then goes to The interpolation finds the corresponding color correction matrix for use in the camera device.
在实际使用中,事先标定色彩矫正CCM的动作,是为了实现被调试摄像设备与目标颜色风格统一。在调试过程中,往往是依靠人眼去主观评判被调试摄像设备和目标摄像设备的颜色风格差异,根据实际调试人员的调试经验对色彩矫正矩阵的3*3矩阵中每一个元素进行微调,调整之后再生效到摄像设备端进行颜色风格差异的对比,中间过程耗时耗力,非常的低效。同时,在摄像设备的实际使用中,动态范围模块是会根据当前的场景实时调整的,这个时候就会使用不同的伽马曲线。In actual use, the action of color correction CCM is calibrated in advance to realize the unification of the camera equipment being debugged and the target color style. During the debugging process, the human eyes are often used to subjectively judge the color style difference between the debugged camera device and the target camera device, and fine-tune each element in the 3*3 matrix of the color correction matrix according to the debugging experience of the actual debugger. After that, it will be validated to the camera equipment side for comparison of color style differences. The intermediate process is time-consuming and labor-intensive, which is very inefficient. At the same time, in the actual use of camera equipment, the dynamic range module will be adjusted in real time according to the current scene, and different gamma curves will be used at this time.
动态范围是指数码相机同时记录的暗部细节和亮部细节的丰富程度,动态范围越高就越能记录丰富的画面细节。在摄像设备中,由于显卡或者显示器的原因会出现实际输出的图像在亮度上有偏差,而伽马曲线就是用来矫正图像的亮度偏差。Dynamic range refers to the richness of dark and bright details recorded by a digital camera at the same time. The higher the dynamic range, the richer the picture details can be recorded. In camera equipment, due to graphics cards or monitors, there may be deviations in the brightness of the actual output image, and the gamma curve is used to correct the brightness deviation of the image.
在摄像设备的动态范围模块发生变化之后,会影响到图像色彩还原性,理论上为了保持色彩还原性在任何场景下都能够和实验室标定阶段保持一致,最好是需要在实验室标定阶段,将使用所有可能用到的伽马曲线都进行标定,将所有标定得到的色彩矫正矩阵值都保存于摄像设备中,在实际使用的时候再根据当前所使用的伽马曲线选择使用对应的色彩矫正矩阵值。但是,在实际使用中,伽马曲线并不是固定的,也不是有限的若干条,而是摄像设备根据当前的场景,实时动态调整生成的。因此不可能预先估计到会使用的伽马曲线,也就无法进行事前标定色彩矫正矩阵。After the dynamic range module of the camera equipment changes, it will affect the color reproduction of the image. In theory, in order to maintain the color reproduction, it can be consistent with the laboratory calibration stage in any scene. It is best to need to be in the laboratory calibration stage. All possible gamma curves will be used for calibration, and all the calibrated color correction matrix values will be saved in the camera device, and the corresponding color correction will be selected according to the currently used gamma curve in actual use matrix values. However, in actual use, the gamma curve is not fixed, nor is it a limited number of lines, but is dynamically adjusted and generated by the camera equipment in real time according to the current scene. Therefore, it is impossible to estimate the gamma curve that will be used in advance, and it is impossible to calibrate the color correction matrix in advance.
为了解决上述问题,本申请首先提出一种色彩矫正矩阵调整方法,请参阅图4,如图4所示,图4是本申请色彩矫正矩阵调整方法第一实施例的流程示意图。该方法具体包括步骤S101至步骤S103:In order to solve the above problems, the present application first proposes a color correction matrix adjustment method, please refer to FIG. 4 , as shown in FIG. 4 , and FIG. 4 is a schematic flowchart of the first embodiment of the color correction matrix adjustment method of the present application. The method specifically includes steps S101 to S103:
步骤S101:获取摄像设备的标定数据。Step S101: Obtain calibration data of an imaging device.
摄像设备获取自身的标定数据,自身的标定数据包括颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据,颜色映射表为一个3*n的表,属于一种3D显示查找表;标定色彩矫正矩阵数据为实验室标定阶段的色彩矫正矩阵,是如图3所示的3*3的矩阵;标定伽马曲线数据是与标定色彩矫正矩阵数据对应的伽马曲线,使摄像设备输出的图像经过标定色彩矫正矩阵数据及标定伽马曲线数据后输出质量较好。摄像设备将自身的标定数据,自身的标定数据包括颜色映射表存储于自身设备中,为后续调整实时色彩矫正矩阵数据提供计算依据。The camera equipment obtains its own calibration data, which includes color mapping table, calibration color correction matrix data, and calibration gamma curve data. The color mapping table is a 3*n table, which belongs to a 3D display lookup table; calibration color The correction matrix data is the color correction matrix in the laboratory calibration stage, which is a 3*3 matrix as shown in Figure 3; the calibration gamma curve data is the gamma curve corresponding to the calibration color correction matrix data, so that the image output by the camera equipment After calibrating the color correction matrix data and calibrating the gamma curve data, the output quality is better. The camera device stores its own calibration data, including the color mapping table, in its own device to provide calculation basis for subsequent adjustment of real-time color correction matrix data.
步骤S102:基于摄像设备所在的环境获取摄像设备的实时伽马曲线数据。Step S102: Obtain real-time gamma curve data of the imaging device based on the environment where the imaging device is located.
在摄像设备实际使用中,伽马曲线数据是会根据所在的环境进行实时调整的,这个时候伽马曲线就会产生变换,生成与环境对应的实时伽马曲线数据,此时,摄像设备就可以获取自身实时的伽马曲线数据。In the actual use of camera equipment, the gamma curve data will be adjusted in real time according to the environment. At this time, the gamma curve will be transformed to generate real-time gamma curve data corresponding to the environment. At this time, the camera equipment can Obtain its own real-time gamma curve data.
步骤S103:基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据。Step S103: Generate real-time color correction matrix data based on the calibration data and real-time gamma curve data.
摄像设备基于自身的标定色彩矫正矩阵数据、标定伽马曲线数据,再引入颜色映射表,将色彩矫正矩阵数据与伽马曲线数据通过算术运算结合到一起,通过获取实时伽马曲线数据计算生成摄像设备的实时色彩矫正矩阵数据,可以实现了摄像设备在设备实际运行中,动态调整伽马曲线数据的同时,同步调整色彩矫正矩阵数据,生成实时色彩矫正矩阵数。The camera equipment is based on its own calibration color correction matrix data and calibration gamma curve data, and then introduces the color mapping table, combines the color correction matrix data and gamma curve data through arithmetic operations, and calculates and generates video by obtaining real-time gamma curve data. The real-time color correction matrix data of the device can realize the dynamic adjustment of the gamma curve data and the synchronous adjustment of the color correction matrix data during the actual operation of the camera device to generate real-time color correction matrix data.
区别于现有技术,本申请通过获取摄像设备的标定数据,再基于摄像设备所在的环境获取实时的伽马曲线数据,从而基于标定数据和实时的伽马曲线数据,生成实时的色彩矫正矩阵数据,改进了传统的色彩矫正矩阵调整与伽马曲线数据调整脱节的现状,本申请能够使色彩矫正矩阵数据能够与伽马曲线数据进行动态的联动调整,使摄像设备的色彩矫正的效率更高,图像输出的颜色风格统一。Different from the prior art, the present application obtains the calibration data of the imaging equipment, and then acquires the real-time gamma curve data based on the environment where the imaging equipment is located, thereby 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 out of touch with the gamma curve data adjustment. This application can enable the dynamic linkage adjustment of the color correction matrix data and the gamma curve data, so that the efficiency of the color correction of the camera equipment is higher. The color style of the image output is unified.
可选地,生成实时色彩矫正矩阵数据的方法请参阅图5,如图5所示,图5是图4中步骤S103的第一实施例的流程示意图。其中,标定数据包括标定色彩矫正矩阵数据、标定伽马曲线数据及颜色映射。色彩矫正矩阵数据与伽马曲线数据通过颜色映射表关联,本实施例可通过如图4所示的方法实现步骤S103,具体实施步骤包括步骤S201至步骤S202:Optionally, please refer to FIG. 5 for the method of generating real-time color correction matrix data. As shown in FIG. 5 , FIG. 5 is a schematic flowchart of a first embodiment of step S103 in FIG. 4 . Wherein, the calibration data includes calibration color correction matrix data, calibration gamma curve data and color mapping. The color correction matrix data and the gamma curve data are associated through a color mapping table. In this embodiment, step S103 can be realized through the method shown in FIG. 4 , and the specific implementation steps include steps S201 to S202:
步骤S201:基于颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据及实时伽马曲线数据计算矫正系数。Step S201: Calculating correction coefficients based on the color mapping table, calibration color correction matrix data, calibration gamma curve data and real-time gamma curve data.
其中,颜色映射表一张3*n的表,属于一种3D显示查找表,它是将RGB三个通道都划分为若干份,形成一个三维表。在本申请中标定的颜色映射表可以一张线性表,在本实施例中可以具体为是一张3*4096的表,在其他实施例中,本申请可以自由选择其他的显示查找表,在此不作限定。Among them, the color mapping table is a 3*n table, belonging to a 3D display lookup table, which divides the three channels of RGB into several parts to form a three-dimensional table. The color mapping table calibrated in this application can be a linear table. In this embodiment, it can be specifically a 3*4096 table. In other embodiments, this application can freely choose other display lookup tables. This is not limited.
摄像设备首先获取自身的标定色彩矫正矩阵数据、标定伽马曲线数据,将颜色映射表lut_original、标定色彩矫正矩阵数据ccm_original及标定伽马曲线数据gamma_original存储至自身设备中。摄像设备再获取自身的实时伽马曲线数据,通过引入颜色映射表lut_original关联色彩矫正矩阵数据与伽马曲线数据,从而计算得到色彩矫正数据的矫正系数,在本实施中,颜色映射表lut_original为3*4096的一个矩阵数据。The imaging device first obtains its own calibrated color correction matrix data and calibrated gamma curve data, and stores the color mapping table lut_original, calibrated color correction matrix data ccm_original, and calibrated gamma curve data gamma_original in its own device. The imaging device then obtains its own real-time gamma curve data, and calculates the correction coefficient of the color correction data by introducing the color mapping table lut_original to associate the color correction matrix data with the gamma curve data. In this implementation, the color mapping table lut_original is 3 * A matrix data of 4096.
可选地,图6是图5中步骤S201的一具体实施例的流程示意图。本实施例可通过如图6所示的方法实现步骤S201,具体实施步骤包括步骤S301至步骤S304:Optionally, FIG. 6 is a schematic flowchart of a specific embodiment of step S201 in FIG. 5 . In this embodiment, step S201 can be realized through the method shown in FIG. 6, and the specific implementation steps include step S301 to step S304:
步骤S301:获取标定色彩矫正矩阵数据与颜色映射表的矩阵乘积。Step S301: Obtain the matrix product of the calibration color correction matrix data and the color mapping table.
摄像设备获取标定色彩矫正矩阵数据ccm_original与颜色映射表lut_original的矩阵乘积ccmMat_original。其中,矩阵乘积ccmMat_original=ccm_original*lut_original。The imaging device obtains the matrix product ccmMat_original of the calibration color correction matrix data ccm_original and the color mapping table lut_original. Wherein, the matrix product ccmMat_original=ccm_original*lut_original.
步骤S302:基于矩阵乘积及标定伽马曲线数据,获取伽马数据。Step S302: Obtain gamma data based on matrix product and calibration gamma curve data.
摄像设备基于矩阵乘积ccmMat_original及标定伽马曲线数据gamma_original可以获取伽马数据gammaMat_orginal。The imaging device can obtain gamma data gammaMat_orginal based on the matrix product ccmMat_original and the calibration gamma curve data gamma_original.
具体地,本实施例可通过如下方法实现步骤S302,具有方法如下:Specifically, this embodiment can realize step S302 through the following method, and the method is as follows:
将矩阵乘积输入至标定伽马曲线数据进行查表,以获取伽马数据。Input the matrix product into the calibrated gamma curve data for table lookup to obtain gamma data.
摄像设备可以用矩阵乘积ccmMat_original作为输入在标定伽马曲线数据gamma_original中进行查表,以获取伽马数据gammaMat_orginal。The imaging device can use the matrix product ccmMat_original as an input to perform a table lookup in the calibration gamma curve data gamma_original, so as to obtain the gamma data gammaMat_orginal.
在其他实施例中,摄像设备也可通过其他方式获取伽马数据gammaMat_orginal,在此不作限定。In other embodiments, the imaging device may also obtain the gamma data gammaMat_orginal in other ways, which is not limited herein.
步骤S303:基于实时伽马曲线数据及伽马数据,获取色彩矫正矩阵数据。Step S303: Obtain color correction matrix data based on the real-time gamma curve data and the gamma data.
摄像设备基于实时伽马曲线数据gamma_curr及伽马数据gammaMat_orginal,可以通过相关计算方法获取色彩矫正矩阵数据ccmMat_curr。Based on the real-time gamma curve data gamma_curr and the gamma data gammaMat_orginal, the imaging device can obtain the color correction matrix data ccmMat_curr through a correlation calculation method.
可选地,图7是图6中步骤S303的一具体实施例的流程示意图。本实施例可通过如图7所示的方法实现步骤S303,具体实施步骤包括步骤S401至步骤S402:Optionally, FIG. 7 is a schematic flowchart of a specific embodiment of step S303 in FIG. 6 . In this embodiment, step S303 can be realized through the method shown in FIG. 7, and the specific implementation steps include step S401 to step S402:
步骤S401:基于实时伽马曲线数据获取实时伽马曲线数据的逆数组。Step S401: Obtain an inverse array of the real-time gamma curve data based on the real-time gamma curve data.
摄像设备获取实时伽马曲线数据gamma_curr,通过对实时伽马曲线数据gamma_curr求逆,获取实时伽马曲线数据的逆数组invgamma_curr。The imaging device acquires real-time gamma curve data gamma_curr, and obtains an inverse array invgamma_curr of real-time gamma curve data by inverting the real-time gamma curve data gamma_curr.
步骤S402:将伽马数据输入至逆数组中进行查表,以获取色彩矫正矩阵数据。Step S402: Input the gamma data into the inverse array for table lookup to obtain color correction matrix data.
摄像设备再将伽马数据gammaMat_orginal作为输入在逆数组invgamma_curr中进行查表,以获取色彩矫正矩阵数据ccmMat_curr。The imaging device then uses the gamma data gammaMat_orginal as an input to perform table lookup in the inverse array invgamma_curr to obtain the color correction matrix data ccmMat_curr.
步骤S304:基于色彩矫正矩阵数据及矩阵乘积,获取矫正系数。Step S304: Obtain correction coefficients based on the color correction matrix data and the matrix product.
摄像设备基于色彩矫正矩阵数据ccmMat_curr及矩阵乘积ccmMat_original获取矫正系数coef。The imaging device obtains the correction coefficient coef based on the color correction matrix data ccmMat_curr and the matrix product ccmMat_original.
其中,矫正系数coef=ccmMat_original\ccmMat_curr,“\”是一种矩阵计算的方式,矩阵乘积ccmMat_original与色彩矫正矩阵数据ccmMat_curr都是3*4096的数组,计算的结果得到是3*3的数组。其中所使用的“\”是反除的一种用法,等价于cmMat_original的逆乘以ccmMat_curr。Among them, the correction coefficient coef=ccmMat_original\ccmMat_curr, "\" is a matrix calculation method, the matrix product ccmMat_original and the color correction matrix data ccmMat_curr are both 3*4096 arrays, and the calculation result is a 3*3 array. The "\" used in it is a usage of inverse division, which is equivalent to multiplying the inverse of cmMat_original by ccmMat_curr.
步骤S202:基于矫正系数与标定色彩矫正矩阵数据计算实时色彩矫正矩阵数据。Step S202: Calculate real-time color correction matrix data based on the correction coefficients and the calibration color correction matrix data.
摄像设备计算得到矫正系数coef后,通过矫正系数coef与标定色彩矫正矩阵数据ccm_original相乘就可以计算获取实时的色彩矫正矩阵数据CCM。其中,CCM=coef*ccm_original。After the camera equipment 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 calibration color correction matrix data ccm_original. Wherein, CCM=coef*ccm_original.
区别于现有技术,本申请的色彩矫正矩阵调整方法结合颜色映射表lut_original的使用,使得色彩矫正矩阵数据能够与伽马曲线数据进行动态的联动调整,使摄像设备图像输出的效率更高,图像的颜色统一风格更好;Different from the prior art, the color correction matrix adjustment method of the present application is combined with the use of the color mapping table lut_original, so that the color correction matrix data and the gamma curve data can be dynamically adjusted in conjunction, so that the image output efficiency of the camera device is higher, and the image The color uniform style is better;
其实,本申请通过以颜色映射表lut_original、标定色彩矫正矩阵数据ccm_original及标定伽马曲线数据gamma_original为依据,结合摄像设备在实际使用中的实时伽马无线数据,实现最终实时色彩矫正矩阵数据的动态调整,能够实现色彩矫正矩阵数据调整的量化操作;并且本申请针对色彩矫正矩阵数据与伽马曲线数据存在物理当量上的不对等问题,提出了利用颜色映射表lut_original作为两者物理量的桥接,实现了色彩矫正矩阵数据与伽马曲线数据可以进行混合计算。In fact, this application is based on the color mapping table lut_original, the calibration color correction matrix data ccm_original and the calibration gamma curve data gamma_original, combined with the real-time gamma wireless data of the camera equipment in actual use, to realize the dynamics of the final real-time color correction matrix data Adjustment can realize the quantization operation of color correction matrix data adjustment; and this application aims at the problem of unequal physical equivalent between color correction matrix data and gamma curve data, and proposes to use the color mapping table lut_original as a bridge between the two physical quantities to The color correction matrix data and the gamma curve data can be mixed and calculated.
本申请在计算过程中,还提出了使用查表的方式计算中间量伽马数据gammaMat_orginal及色彩矫正矩阵数据ccmMat_curr,可以有效地提高计算效率,并且实现了色彩矫正矩阵数据与伽马曲线数据的动态调整及混合计算。In the calculation process of this application, it is also proposed to use the table lookup method to calculate the intermediate gamma data gammaMat_orginal and the color correction matrix data ccmMat_curr, which can effectively improve the calculation efficiency, and realize the dynamics of the color correction matrix data and the gamma curve data Adjustment and blending calculations.
可选地,生成实时色彩矫正矩阵数据的方法请参阅图8,如图8所示,图8是图4中步骤S103的第二实施例的流程示意图。其中,标定数据包括颜色映射表lut_original、标定色彩矫正矩阵数据ccm_original及标定伽马曲线数据gamma_original。本实施例可通过如图8所示的方法实现步骤S103,具体实施步骤包括步骤S501至步骤S503:Optionally, please refer to FIG. 8 for the method of generating real-time color correction matrix data. As shown in FIG. 8 , FIG. 8 is a schematic flowchart of a second embodiment of step S103 in FIG. 4 . Wherein, the calibration data includes the color mapping table lut_original, the calibration color correction matrix data ccm_original and the calibration gamma curve data gamma_original. In this embodiment, step S103 can be realized through the method shown in FIG. 8, and the specific implementation steps include step S501 to step S503:
步骤S501:基于颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据及实时伽马曲线数据计算矫正系数。Step S501: Calculating correction coefficients based on the color mapping table, calibration color correction matrix data, calibration gamma curve data and real-time gamma curve data.
步骤S501与步骤S201一致,此处不再赘述。Step S501 is the same as step S201 and will not be repeated here.
步骤S502:基于矫正系数与标定色彩矫正矩阵数据计算实时色彩矫正矩阵数据的未修正矩阵数据。Step S502: Calculate uncorrected matrix data of the real-time color correction matrix data based on the correction coefficients and the calibration color correction matrix data.
摄像设备基于矫正系数coef与标定色彩矫正矩阵数据ccm_original计算得到的是实时色彩矫正矩阵数据CCM的未修正矩阵数据,因计算得到的矫正系数coef仅仅是体现了色彩矫正矩阵数据ccmMat_curr及矩阵乘积ccmMat_original之间差异变化的一种修正系数,此时还不能代表最终需要叠加到摄像设备的生效的色彩矫正矩阵值,因此最终的生效色彩矫正矩阵值需要与原色彩矫正矩阵值进行最终的修正计算。The camera equipment calculates the uncorrected matrix data of the real-time color correction matrix data CCM based on the correction coefficient coef and the calibration color correction matrix data ccm_original, because the calculated correction coefficient coef only reflects the difference between the color correction matrix data ccmMat_curr and the matrix product ccmMat_original At this time, it cannot represent the effective color correction matrix value that needs to be superimposed on the camera device at this time, so the final effective color correction matrix value needs to be calculated with the original color correction matrix value for final correction.
步骤S503:对未修正矩阵数据进行归一化操作,以获取实时色彩矫正矩阵数据。Step S503: Perform a normalization operation on the uncorrected matrix data to obtain real-time color correction matrix data.
摄像设备对未修正矩阵数据进行归一化操作,以获取最终的实时色彩矫正矩阵数据。具体的方式为:将实时色彩矫正矩阵数据CCM的结果进行计算,假设色彩矫正矩阵数据CCM结果为[c00 c01 c02;c10 c11 c12;c20 c21 c22],那么为了保证矩阵的规范性,可以约束c02=1-c00-c01;c12=1-c10-c11;c22=1-c20-c21。在其他实施例中,具体的约束方式有很多,不仅限于本实施例这一种约束方式。The camera equipment performs a normalization operation on the uncorrected matrix data to obtain the final real-time color correction matrix data. The specific method is: calculate the result of CCM of the real-time color correction matrix data, assuming that the CCM result of the color correction matrix data is [c00 c01 c02; c10 c11 c12; c20 c21 c22], then in order to ensure the standardization of the matrix, c02 can be constrained =1-c00-c01; c12=1-c10-c11; c22=1-c20-c21. In other embodiments, there are many specific constraint manners, and are not limited to this one constraint manner in this embodiment.
本申请通过对最后计算的实时色彩矫正矩阵数据CCM进行归一化操作,可以保证最终的实时色彩矫正矩阵数据能够在摄像设备中生效,提高了色彩矫正矩阵调整方法的稳定性。In this application, by performing a normalization operation on the final calculated real-time color correction matrix data CCM, it can ensure that the final real-time color correction matrix data can take effect in the camera device, and the stability of the color correction matrix adjustment method is improved.
可选地,获取实时伽马曲线数据的方法请参阅图9,如图9所示,图9是图4中步骤S102的一具体实施例的流程示意图。本实施例可通过如图9所示的方法实现步骤S102,具体实施步骤包括步骤S601至步骤S603:Optionally, please refer to FIG. 9 for the method of acquiring real-time gamma curve data. As shown in FIG. 9 , FIG. 9 is a schematic flowchart of a specific embodiment of step S102 in FIG. 4 . In this embodiment, step S102 can be realized through the method shown in FIG. 9 , and the specific implementation steps include step S601 to step S603:
步骤S601:基于环境调整实时摄像设备的动态范围。Step S601: Adjust the dynamic range of the real-time camera device based on the environment.
摄像设备基于环境实时调整自身的动态范围。动态范围是基于当前环境进行实时调整的,因动态范围的不同,摄像设备使用的伽马曲线数据就不同。摄像设备在调整动态范围时,调整动态范围的方式有很多种,调整动态范围的方式有很多,比较常见的是通过调整伽马曲线数据调整动态范围。The camera 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. Due to the difference in the dynamic range, the gamma curve data used by the camera equipment is different. When the camera equipment adjusts the dynamic range, there are many ways to adjust the dynamic range, and there are many ways to adjust the dynamic range. It is more common to adjust the dynamic range by adjusting the gamma curve data.
步骤S602:获取摄像设备动态范围调整前后的第一图像数据及第二图像数据。Step S602: Obtain the first image data and the second image data before and after the dynamic range adjustment of the imaging device.
但摄像设备调整动态范围时采用的调整方式不是调整伽马曲线数据,此时,摄像设备需要获取摄像设备动态范围调整前后的第一图像数据及第二图像数据。例如获取该调整之前摄像设备的第一图像亮度数据A及获取该摄像设备调整之后的第二图像亮度数据B。However, the adjustment method adopted by the camera device to adjust the dynamic range is not to adjust the gamma curve data. At this time, the camera device needs to obtain the first image data and the second image data before and after the dynamic range adjustment of the camera device. For example, the first image brightness data A of the imaging device before the adjustment and the second image brightness data B of the imaging device after adjustment are acquired.
步骤S603:基于第一图像数据及第二图像数据,通过曲线拟合以获取实时伽马曲线数据。Step S603: Obtain real-time gamma curve data by curve fitting based on the first image data and the second image data.
摄像设备通过第二图像亮度数据B与第一图像亮度数据A通过曲线拟合的方式便可以获取实时伽马曲线数据gamma_curr。The imaging device can acquire real-time gamma curve data gamma_curr by means of curve fitting between the second image brightness data B and the first image brightness data A.
本申请通过获取动态模块调整前后的第一图像数据及第二图像数据,进行拟合获取实时伽马曲线数据,不管摄像设备以任何一种方式调整动态范围时,动能获取到等效的实时的伽马曲线数据,有利于提升色彩矫正矩阵调整方法的效率。This application obtains the first image data and the second image data before and after the adjustment of the dynamic module, and performs fitting to obtain real-time gamma curve data. No matter when the camera equipment adjusts the dynamic range in any way, the kinetic energy can obtain equivalent real-time The gamma curve data is beneficial to improve the efficiency of the color correction matrix adjustment method.
在一应用场景中,请参阅图10,图10是本申请色彩矫正矩阵调整方法一具体方案的控制流程示意图。本实施例的色彩矫正矩阵调整方法一具体方案的控制流程具体包括步骤S701至步骤S709:In an application scenario, please refer to FIG. 10 . FIG. 10 is a schematic control flow diagram of a specific solution of the color correction matrix adjustment method of the present application. The control flow of a specific solution of the color correction matrix adjustment method of this embodiment specifically includes steps S701 to S709:
步骤S701:摄像设备中存入颜色映射表lut_original、标定色彩矫正矩阵数据ccm_original及标定伽马曲线数据gamma_original。Step S701: Store the color mapping table lut_original, the calibration color correction matrix data ccm_original and the calibration gamma curve data gamma_original in the imaging device.
步骤S702:计算矩阵乘积ccmMat_original=ccm_original*lut_original。Step S702: Calculate the matrix product ccmMat_original=ccm_original*lut_original.
步骤S703:用矩阵乘积ccmMat_original作为输入在标定伽马曲线数据gamma_original中进行查表,以获取伽马数据gammaMat_orginal。Step S703: use the matrix product ccmMat_original as input to perform a table lookup in the calibration gamma curve data gamma_original to obtain the gamma data gammaMat_orginal.
步骤S704:摄像设备的动态范围根据实时场景自动调整,计算得到实时伽马曲线数据gamma_curr。Step S704: The dynamic range of the camera device is automatically adjusted according to the real-time scene, and real-time gamma curve data gamma_curr is obtained by calculation.
步骤S705:计算实时伽马曲线数据gamma_curr的逆数组invgamma_curr。Step S705: Calculate the inverse array invgamma_curr of the real-time gamma curve data gamma_curr.
步骤S706:将伽马数据gammaMat_orginal作为输入在逆数组invgamma_curr中进行查表,以获取色彩矫正矩阵数据ccmMat_curr。Step S706: Take the gamma data gammaMat_orginal as an input and perform table lookup in the inverse array invgamma_curr to obtain the color correction matrix data ccmMat_curr.
步骤S707:计算矫正系数coef=ccmMat_original\ccmMat_curr。Step S707: Calculate the correction coefficient coef=ccmMat_original\ccmMat_curr.
步骤S708:计算最终的CCM=coef*ccm_original。Step S708: Calculate the final CCM=coef*ccm_original.
步骤S709:对得到的初步的CCM值进行归一化操作,得到最终的CCM值。Step S709: Perform a normalization operation on the obtained preliminary CCM value to obtain a final CCM value.
可选地,本申请进一步提出一种色彩矫正矩阵调整方法,请参阅图11,如图11所示,图11是本申请色彩矫正矩阵调整方法第二实施例的流程示意图。色彩矫正矩阵调整方法进一步包括步骤S801至步骤S803:Optionally, the present application further proposes a color correction matrix adjustment method, please refer to FIG. 11 , as shown in FIG. 11 , which is a schematic flowchart of a second embodiment of the color correction matrix adjustment method of the present application. The method for adjusting the color correction matrix further includes steps S801 to S803:
步骤S801:获取当前图像。Step S801: Acquire the current image.
摄像设备获取当前图像。The camera device acquires the current image.
步骤S802:基于当前图像的环境信息生成当前色彩矫正矩阵数据。Step S802: Generate current color correction matrix data based on the environment information of the current image.
摄像设备基于当前的环境信息获取实时伽马曲线数据gamma_curr,并通过存储的颜色映射表lut_original、标定色彩矫正矩阵数据ccm_original及标定伽马曲线数据gamma_original通过上述的计算方法生成当前的色彩矫正矩阵数据。The imaging device obtains the real-time gamma curve data gamma_curr based on the current environment information, and generates the current color correction matrix data through the above calculation method through the stored color mapping table lut_original, the calibration color correction matrix data ccm_original and the calibration gamma curve data gamma_original.
步骤S803:基于当前色彩矫正矩阵数据对当前图像进行色彩矫正。Step S803: Perform color correction on the current image based on the current color correction matrix data.
摄像设备基于当前色彩矫正矩阵数据对当前图像进行色彩矫正,就可以使摄像设备的色彩矫正的效率更高,图像输出的颜色风格统一。The camera device performs color correction on the current image based on the current color correction matrix data, so that the efficiency of the color correction of the camera device is higher, and the color style of the image output is unified.
区别于现有技术,本申请基于摄像设备在实际工况中,需要将待调试设备的图像颜色风格调试成与目标设备风格一致,但是现有技术的方法是靠人工对色彩矫正矩阵数据进行主观评价的调试,耗时耗力,并且在伽马曲线数据因为场景变化而动态变化之后,对应的色彩矫正矩阵数据不能及时对应调整,导致色彩风格的偏差。本申请通过获取摄像设备的标定数据,再基于摄像设备所在的环境获取实时的伽马曲线数据,从而基于标定数据和实时的伽马曲线数据,生成实时的色彩矫正矩阵数据,改进了传统的色彩矫正矩阵调整与伽马曲线数据调整脱节的现状,并且提出了在无需智能检测算法辅助对当前实景色彩进行评判的前提下,充分利用实时伽马曲线数据在颜色空间上对色彩的影响,提取出其中量化表达的规律特性,借助颜色映射表对色彩矫正矩阵数据与伽马曲线数据进行巧妙结合,实现了摄像设备在伽马曲线数据变化过程中,自动动态联动色彩矫正矩阵数据的调整,并且本申请的方法不需要人为介入,在摄像设备中能够实时转换。Different from the existing technology, this application is based on the fact that the image color style of the device to be debugged needs to be adjusted to be consistent with the style of the target device based on the actual working conditions of the camera device. However, the method of the prior art relies on manual subjective correction of the color correction matrix data The debugging of the evaluation is time-consuming and labor-intensive, and after the gamma curve data changes dynamically due to scene changes, the corresponding color correction matrix data cannot be adjusted in time, resulting in the deviation of the color style. This application obtains the calibration data of the camera equipment, and then obtains real-time gamma curve data based on the environment where the camera equipment is located, thereby generating real-time color correction matrix data based on the calibration data and real-time gamma curve data, which improves the traditional color correction method. It corrects the current situation that the matrix adjustment is out of touch with the gamma curve data adjustment, and proposes to make full use of the influence of the real-time gamma curve data on the color space on the premise of judging the current real scene color without the aid of an intelligent detection algorithm to extract the Among them, the regular characteristics of quantitative expression, with the help of the color mapping table, the color correction matrix data and the gamma curve data are skillfully combined, and the automatic and dynamic adjustment of the color correction matrix data is realized in the process of changing the gamma curve data of the camera equipment. The method of application does not require human intervention, and can be converted in real time in the camera equipment.
可选地,本申请进一步提出一种摄像设备,请参阅图12,图12是本申请摄像设备一实施例的结构示意图。本实施例的摄像设备100包括数据获取模块101、计算模块102及存储模块103。Optionally, the present application further proposes an imaging device, please refer to FIG. 12 , which is a schematic structural diagram of an embodiment of the imaging device of the present application. The
数据获取模块101分别与计算模块102及存储模块连接。The
数据获取模块101用于获取摄像设备100的标定数据,及基于摄像设备100所在的环境获取摄像设备100的实时伽马曲线数据。其中,标定数据为颜色映射表、标定色彩矫正矩阵数据、标定伽马曲线数据。The
计算模块102用于基于标定数据及实时伽马曲线数据,生成实时色彩矫正矩阵数据。存储模块103用于存储标定数据。The
可选地,本申请进一步提出一种电子设备,请参阅图13,图13是本申请电子设备一实施例的结构示意图,该电子设备200包括处理器201及与处理器201连接的存储器202。Optionally, the present application further proposes an electronic device. Please refer to FIG. 13 . FIG. 13 is a schematic structural diagram of an embodiment of the electronic device of the present application. The
处理器201还可以称为CPU(Central Processing Unit,中央处理单元)。处理器201可能是一种集成电路芯片,具有信号的处理能力。处理器201还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The
存储器202用于存储处理器201运行所需的程序数据。The
处理器201还用于执行存储器202存储的程序数据以实现上述色彩矫正矩阵调整方法。The
可选地,本申请进一步提出一种计算机可读存储介质。请参阅图14,图14是本申请计算机可读存储介质一实施例的结构示意图。Optionally, the present application further provides a computer-readable storage medium. Please refer to FIG. 14 . FIG. 14 is a schematic structural diagram of an embodiment of a computer-readable storage medium of the present application.
本申请实施例的计算机可读存储介质300内部存储有程序指令310,程序指令310被执行以实现上述色彩矫正矩阵调整方法。The computer-
其中,程序指令310可以形成程序文件以软件产品的形式存储在上述存储介质中,以使得一台电子设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,或者是计算机、服务器、手机、平板等终端设备。Wherein, the
本实施例计算机可读存储介质300可以是但不局限于U盘、SD卡、PD光驱、移动硬盘、大容量软驱、闪存、多媒体记忆卡、服务器等。The computer-
在一个实施例中,提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。电子设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述各方法实施例中的步骤。In one embodiment there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device executes the steps in the foregoing method embodiments.
另外,上述功能如果以软件功能的形式实现并作为独立产品销售或使用时,可存储在一个移动终端可读取存储介质中,即,本申请还提供一种存储有程序数据的存储装置,所述程序数据能够被执行以实现上述实施例的方法,该存储装置可以为如U盘、光盘、服务器等。也就是说,本申请可以以软件产品的形式体现出来,其包括若干指令用以使得一台智能终端执行各个实施例所述方法的全部或部分步骤。In addition, if the above-mentioned functions are implemented in the form of software functions and sold or used as independent products, they can be stored in a storage medium that can be read by a mobile terminal, that is, the application also provides a storage device that stores program data, so The above program data can be executed to implement the methods of the above embodiments, and the storage device can be, for example, a U disk, an optical disk, a server, and the like. That is to say, the present application may be embodied in the form of a software product, which includes several instructions for enabling an intelligent terminal to execute all or part of the steps of the method described in each embodiment.
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of these features. In the description of the present application, "plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的机构、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。Any process or method descriptions described in flowcharts or otherwise herein may be understood to represent a mechanism, segment or portion of code comprising one or more executable instructions for implementing specific logical functions or steps of a process , and the scope of preferred embodiments of the present application includes additional implementations in which functions may be performed out of the order shown or discussed, including in substantially simultaneous fashion or in reverse order depending on the functions involved, which shall It should be understood by those skilled in the art to which the embodiments of the present application belong.
在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(可以是个人计算机,服务器,网络设备或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a sequenced listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium, For the use of instruction execution systems, devices or equipment (which may be personal computers, servers, network equipment or other systems that can fetch instructions from instruction execution systems, devices or devices and execute instructions), or in combination with these instruction execution systems, devices or devices And use. For the purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use in or in conjunction with an instruction execution system, device or device. More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection with one or more wires (electronic device), portable computer disk case (magnetic device), random access memory (RAM), Read Only Memory (ROM), Erasable and Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Compact Disc Read Only Memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program can be printed, since the program can be read, for example, by optically scanning the paper or other medium, followed by editing, interpretation or other suitable processing if necessary. The program is processed electronically and stored in computer memory.
以上所述仅为本申请的实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only an embodiment of the application, and does not limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related technologies fields, are all included in the scope of patent protection of this application in the same way.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210911085.3A CN115426485B (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, camera device, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210911085.3A CN115426485B (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, camera device, electronic device and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115426485A true CN115426485A (en) | 2022-12-02 |
| CN115426485B CN115426485B (en) | 2024-11-29 |
Family
ID=84196513
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210911085.3A Active CN115426485B (en) | 2022-07-29 | 2022-07-29 | Color correction matrix adjustment method, camera device, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115426485B (en) |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20060054954A (en) * | 2004-11-17 | 2006-05-23 | 주식회사 디지털색채연구소 | Method and device for white balance combined color correction of image sensor for standard image output |
| KR20080092624A (en) * | 2007-04-12 | 2008-10-16 | 삼성전자주식회사 | Method and apparatus for generating a wide color gamut signal of an image acquisition 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 reproduction method and apparatus, 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 |
| 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/CN115426485B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20060054954A (en) * | 2004-11-17 | 2006-05-23 | 주식회사 디지털색채연구소 | Method and device for white balance combined color correction of image sensor for standard image output |
| KR20080092624A (en) * | 2007-04-12 | 2008-10-16 | 삼성전자주식회사 | Method and apparatus for generating a wide color gamut signal of an image acquisition 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 reproduction method and apparatus, 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 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115426485B (en) | 2024-11-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3694203A1 (en) | Method and device for obtaining exposure compensation value of high-dynamic-range image | |
| US20190132493A1 (en) | Imaging apparatus and image processing apparatus | |
| CN113495709B (en) | Color correction method, AP chip, terminal and storage medium | |
| US8885935B2 (en) | Image processing apparatus and image processing method | |
| JP2007208629A (en) | Display calibration method, control device, and calibration program | |
| CN110392243B (en) | Method and apparatus for gamut mapping | |
| TW201537982A (en) | Image sensing device and color correction matrix correction method and method for establishing lookup table | |
| CN109448644A (en) | Method for correcting gray scale display curve of display device, electronic device and computer readable storage medium | |
| CN108447456B (en) | A kind of image shows bearing calibration and device | |
| WO2024251062A1 (en) | Gain map generation method and apparatus, electronic device and medium | |
| WO2025016114A1 (en) | Pixel compensation method, display device, and electronic device | |
| CN115170681B (en) | Gamma lookup table generation method and device, electronic equipment and storage medium | |
| WO2025148852A1 (en) | Screen brightness adjustment method and apparatus, and device | |
| TW201123886A (en) | Look up table update method. | |
| US12148335B2 (en) | Method for image rendering, terminal device and non-transitory computer-readable storage medium | |
| US20130293568A1 (en) | Image processing apparatus and image processing program product | |
| US9292912B2 (en) | Display apparatus and method for image output thereof | |
| CN115426485A (en) | Color correction matrix adjustment method, camera equipment, electronic equipment and storage medium | |
| CN114842814B (en) | Color calibration methods and devices, electronic equipment, storage media | |
| CN117201950A (en) | Hue adjustment method, hue adjustment device, and readable storage medium | |
| US10044940B1 (en) | Picture brightness adjusted motion detection | |
| CN117238260A (en) | Color accuracy correction method, device and electronic equipment | |
| JP4680639B2 (en) | Image processing apparatus and processing method thereof | |
| CN117241002A (en) | Image processing method, device, electronic equipment and readable storage medium | |
| CN115617290A (en) | Image display method, image display device, electronic device, and 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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |