Color correction matrix determination method, color correction method, device and storage medium
Patent Information
- Application Number
- CN202110111734.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-27
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2041-01-27
AI Technical Summary
目前,在宽动态下做的色彩校正方案均是继承线性下校正的色彩校正矩阵,本申请的发明人在实际应用中发现,这样的色彩校正方案会存在偏色现象;原因是宽动态下的RAW数据是多帧合成的,而线性下的色彩校正矩阵是在某一特定曝光时间下做的校正,显然不能代表多种曝光时间进行合成的RAW数据的校正
[0037]本申请实施例结合亮度、色温两个不同维度来得到色彩校正矩阵,在确定校正使用的色彩校正矩阵时就考虑实际环境中的因素对色彩校正矩阵的影响,相比于单一维度下得到的色彩校正矩阵,可以使图像的颜色还原更加准确,应用于宽动态模式下时有更好的适应性。
Smart Images

Figure CN114827565B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of image processing, and particularly to a method for determining a color correction matrix, a color correction method, an apparatus, and a storage medium. Background Technology
[0002] There are generally two modes for obtaining raw image data (RAW data): linear and WDR (Wide Dynamic Range). Linear mode involves taking a single exposure within a certain exposure time to obtain RAW data, which is then used as input for subsequent ISP (Image Signal Processing). Wide Dynamic Range refers to the technique of capturing multiple frames of the same scene with different exposures and then combining them into a single frame. Frames with larger exposures are called long exposure frames because the longer exposure time effectively preserves dark area information; frames with smaller exposures are called short exposure frames because the shorter exposure time effectively preserves bright area information. By combining the bright area information from short frames and the dark area information from long frames into a single frame using Wide Dynamic Range technology, both bright and dark area information can be simultaneously represented. Wide Dynamic Range is further divided into digital Wide Dynamic Range and optical Wide Dynamic Range. Digital Wide Dynamic Range refers to processing the dark and bright areas of an image using image processing methods to ensure appropriate overall brightness. Since digital Wide Dynamic Range is purely algorithmic, it may introduce noise and other issues. Optical wide dynamic range (WDR) involves acquiring RAW data from multiple images at different exposure times, performing frame synthesis on a sensor or platform, and finally combining the RAW data from multiple images into a single image, which is then sent to the ISP pipeline for processing.
[0003] Color correction, often referred to as a color correction matrix, is a method of restoring image colors by obtaining a correction matrix through pre-correction. Currently, color correction schemes performed under wide dynamic range (WDR) all inherit the color correction matrix from linear correction. However, the inventors of this application have discovered in practical applications that such color correction schemes suffer from color cast. This is because WDR RAW data is synthesized from multiple frames, while the linear color correction matrix is performed at a specific exposure time, and obviously cannot represent the correction of RAW data synthesized from multiple exposure times. Summary of the Invention
[0004] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.
[0005] This application provides a method for determining a color correction matrix, including:
[0006] For multiple preset color temperatures and multiple brightness levels, obtain at least one color correction matrix under different color temperatures and different brightness levels;
[0007] Obtain the actual color temperature and actual brightness when the image to be corrected was captured, and find the color correction matrix corresponding to the actual color temperature and actual brightness based on the actual color temperature and actual brightness;
[0008] The color correction matrix corresponding to the image to be corrected is determined based on the found color correction matrix.
[0009] In some exemplary embodiments, obtaining at least one color correction matrix for different color temperatures and different brightness levels for preset multiple color temperatures and multiple brightness levels includes:
[0010] For each preset color temperature, perform the following operations: collect raw data of different brightness levels at that color temperature;
[0011] Color correction was performed on the raw data with different brightness levels to obtain the color correction matrix corresponding to each brightness level at that color temperature.
[0012] In some exemplary embodiments, the acquisition of raw data of different brightness levels at that color temperature includes:
[0013] At this color temperature, the exposure is adjusted to several preset exposure levels, and raw data of the brightness corresponding to the several different exposure levels are collected.
[0014] In some exemplary embodiments, the step of performing color correction on the collected raw data of different brightness levels to obtain the color correction matrix corresponding to each brightness level at that color temperature includes:
[0015] The raw data collected for each brightness level at this color temperature are processed as follows to obtain the color correction matrix corresponding to each brightness level at this color temperature:
[0016] Based on the color correction matrix at this brightness, the RGB three-channel values of the color patches in the original data at this brightness are corrected to obtain the output RGB matrix, and the output RGB matrix is converted to Lab space; then in Lab space, for each color patch, the distance between the coordinate value of the color patch in the original data and the coordinate value of the corresponding color patch in the preset standard color chart is calculated;
[0017] If the sum of the distances of each calculated color patch is greater than a preset threshold, the element values in the color correction matrix are adjusted and the above operation is performed again until the sum of the distances of each calculated color patch is not greater than the preset threshold. Then, the current color correction matrix is used as the color correction matrix for that brightness.
[0018] In some exemplary embodiments, after obtaining at least one color correction matrix under different color temperatures and brightness levels, the method further includes:
[0019] Save at least one color correction matrix obtained under different color temperatures and brightness levels, corresponding to the color temperature and brightness at which the color correction matrix was obtained.
[0020] The step of finding the color correction matrix corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes:
[0021] In the corresponding saved color temperature, brightness, and color correction matrix, the color correction matrix corresponding to the actual color temperature and actual brightness is searched according to the actual color temperature and actual brightness.
[0022] In some exemplary embodiments, the step of finding the color correction matrix corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes:
[0023] A color correction matrix is determined based on the two target color temperatures closest to the actual color temperature and the two target brightness levels closest to the actual brightness, including:
[0024] Among a number of preset color temperatures, the two color temperatures with the smallest absolute difference from the actual color temperature are selected as target color temperatures.
[0025] Among a number of preset brightness levels, the two brightness levels with the smallest absolute difference from the actual brightness level are selected as target brightness levels.
[0026] Determine the four color correction matrices corresponding to the two target color temperatures and the two target brightness.
[0027] In some exemplary embodiments, determining the color correction matrix corresponding to the image to be corrected based on the found color correction matrix includes:
[0028] Two pairs of color correction matrices with the same color temperature among the four color correction matrices found are interpolated according to brightness to obtain two intermediate color correction matrices. The two intermediate color correction matrices are then interpolated again according to color temperature to obtain the color correction matrix corresponding to the image to be corrected.
[0029] Alternatively, two pairs of color correction matrices with the same brightness among the four color correction matrices found can be interpolated according to color temperature to obtain two intermediate color correction matrices. The two intermediate color correction matrices can then be interpolated again according to brightness to obtain the color correction matrix corresponding to the image to be corrected.
[0030] This application also provides a color correction method, including:
[0031] The color correction matrix corresponding to the image to be corrected is determined according to the color correction matrix determination method described in any of the above embodiments;
[0032] The image to be corrected is color-corrected according to the color correction matrix corresponding to the image to be corrected.
[0033] This application also provides a color correction device, including a memory and a processor;
[0034] The memory is used to store the color correction program;
[0035] The processor is used to read and execute the color correction program, perform the color correction matrix determination method described in any of the above embodiments, or perform the color correction method described in the above embodiments.
[0036] This application embodiment also provides a storage medium for storing a color correction program; when the color correction program is read and executed, it performs the color correction matrix determination method described in any of the above embodiments, or the color correction method described in the above embodiments.
[0037] This application combines two different dimensions, brightness and color temperature, to obtain the color correction matrix. When determining the color correction matrix to be used for correction, the influence of factors in the actual environment on the color correction matrix is taken into account. Compared with the color correction matrix obtained under a single dimension, the color reproduction of the image can be more accurate, and it has better adaptability when applied to wide dynamic range mode.
[0038] After reading and understanding the accompanying diagrams and detailed descriptions, the other aspects can be understood. Attached Figure Description
[0039] Figure 1 This is a flowchart illustrating the color correction matrix determination method provided in an embodiment of this application.
[0040] Figure 2 This is a schematic flowchart of the color correction method provided in the embodiments of this application;
[0041] Figure 3 This is a schematic diagram of the color correction device provided in the embodiments of this application;
[0042] Figure 4 This is a schematic diagram illustrating the color correction process in an example of an embodiment of this application. Detailed Implementation
[0043] The embodiments of this application will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments of this application and the features therein can be arbitrarily combined with each other.
[0044] The steps illustrated in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in a different order than that presented here.
[0045] This application provides a method for determining a color correction matrix, such as... Figure 1 As shown, steps S110-S130 are included:
[0046] S110. For multiple preset color temperatures and multiple brightness levels, obtain at least one CCM (Color Correction Matrix) for each color temperature and brightness level. Assuming there are k preset color temperatures and m preset brightness levels (k and m are positive integers), k×m CCMs can be obtained in step S110.
[0047] S120. Obtain the actual color temperature and actual brightness when the image to be corrected was captured, and find the CCM corresponding to the actual color temperature and actual brightness based on the actual color temperature and actual brightness;
[0048] S130. Determine the CCM corresponding to the image to be corrected based on the found CCM.
[0049] This embodiment can be used, but is not limited to, in wide dynamic range mode, that is, the original data of the image to be corrected can be synthesized from multiple frames; when applicable to wide dynamic range mode, obtaining at least one CCM under different color temperatures and different brightness in step S110 also needs to be performed in wide dynamic range mode; if the original data of the image to be corrected is a single frame, that is, in linear mode, then step S110 is performed in linear mode.
[0050] This application combines two different dimensions, brightness and color temperature, to obtain CCM. Compared with CCM under a single dimension, it can not only obtain a more adaptable CCM in wide dynamic range scenarios and ensure the accuracy of color reproduction, but also save on the cost of later online optimization and equipment operation performance because the influence of factors in the actual environment on CCM is considered during calibration.
[0051] This embodiment is designed for use in wide dynamic range mode. It can overcome the problem that existing color correction techniques do not consider the significant impact of WDR brightness on the image and that using linear CCM correction methods can lead to color cast. It is more suitable for wide dynamic range scenes.
[0052] In this embodiment, different color temperatures can be achieved using light sources with different color temperatures; different brightness levels can be identified as different brightness levels or different exposure levels, etc.
[0053] In some exemplary embodiments, obtaining at least one CCM under different color temperatures and different brightness levels for a plurality of preset color temperatures and multiple brightness levels includes:
[0054] For each preset color temperature, perform the following operations: collect raw data of different brightness levels at that color temperature;
[0055] Color correction was performed on the raw data of different brightness levels to obtain the CCM corresponding to each brightness level at that color temperature.
[0056] In one embodiment of this example, the acquisition of raw data on different brightness levels at the color temperature may include:
[0057] At this color temperature, the exposure is adjusted to several preset exposure levels, and raw data at the brightness corresponding to each of these exposure levels is collected. In other embodiments, brightness can be adjusted to several preset brightness levels, or by gradually increasing / decreasing brightness in specific or non-specific increments, to obtain raw data at different brightness levels.
[0058] In one embodiment of this invention, the step of performing color correction on the collected raw data of different brightness levels to obtain the color correction matrix corresponding to each brightness level at that color temperature includes:
[0059] The raw data collected for each brightness level at this color temperature are processed as follows to obtain the color correction matrix corresponding to each brightness level at this color temperature:
[0060] Based on the color correction matrix at this brightness, the RGB three-channel values of the color patches (such as, but not limited to, patches 1-18 in a 24-color chart) in the original data at this brightness are corrected to obtain the output RGB matrix, and the output RGB matrix is converted to Lab space; then, in Lab space, for each color patch, the distance between the coordinate value of the color patch in the original data and the coordinate value of the corresponding color patch in the preset standard color chart is calculated;
[0061] If the sum of the distances of each calculated color patch is greater than a preset threshold, the element values in the color correction matrix are adjusted and the above operation is performed again until the sum of the distances of each calculated color patch is not greater than the preset threshold. Then, the current color correction matrix is used as the color correction matrix for that brightness.
[0062] In other implementations, other color correction processes can be used to determine the color correction matrix.
[0063] In one embodiment of this example, the original data of the image to be corrected may be acquired in wide dynamic range mode;
[0064] The collection of raw data at different brightness levels under this color temperature includes:
[0065] In wide dynamic range mode, raw data of different brightness levels at this color temperature are collected.
[0066] In this embodiment, when correction needs to be performed in wide dynamic range mode, that is, when the original data of the image to be corrected is multi-frame composite data, the original data collected under different color temperatures and brightness are also multi-frame composite data.
[0067] In other implementations, raw data of different brightness levels at different color temperatures can be acquired in linear mode to obtain CCMs of different brightness levels at different color temperatures; in this case, the raw data of the image to be corrected is also acquired in linear mode.
[0068] In some exemplary embodiments, after obtaining at least one CCM corresponding to different color temperatures and brightness levels, the method further includes:
[0069] At least one color correction matrix obtained under different color temperatures and brightness is saved in the corresponding color temperature and brightness at the time of obtaining the color correction matrix;
[0070] The step of finding the color correction matrix corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes:
[0071] In the corresponding saved color temperature, brightness, and color correction matrix, the color correction matrix corresponding to the actual color temperature and actual brightness is searched according to the actual color temperature and actual brightness.
[0072] In one embodiment of this example, the CCMs corresponding to different color temperatures and different brightnesses can be stored in a LUT, but are not limited to. When stored in a LUT, different rows and columns in the LUT correspond to different color temperatures and different brightnesses, or correspond to different brightnesses and different color temperatures.
[0073] Accordingly, the step of finding the CCM corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes:
[0074] In the LUT, the corresponding row and column, or column and row, are found according to the actual color temperature and the actual brightness, respectively; the CCM corresponding to the actual color temperature and the actual brightness is found in the cell where the found row and column, or column and row intersect.
[0075] This embodiment uses a LUT, which makes it easier for a computer to implement the color correction matrix determination method.
[0076] In other implementations, in addition to using LUTs, other data structures can be used to store color temperature, brightness, and CCM for easy lookup.
[0077] In this embodiment, the multiple color temperatures and multiple brightness levels in the LUT can be arranged sequentially according to size (or height), or they can be arranged arbitrarily.
[0078] In some exemplary embodiments, the step of finding the CCM corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes:
[0079] A color correction matrix is determined based on the two target color temperatures closest to the actual color temperature and the two target brightness levels closest to the actual brightness, including:
[0080] Among a number of preset color temperatures, the two color temperatures with the smallest absolute difference from the actual color temperature are selected as target color temperatures.
[0081] Among a number of preset brightness levels, the two brightness levels with the smallest absolute difference from the actual brightness level are selected as target brightness levels.
[0082] Determine the four CCMs corresponding to the two target color temperatures and the two target brightness.
[0083] For example, if the two target color temperatures with the smallest absolute difference from the actual color temperature are T1 and T2, and the two target brightness values with the smallest absolute difference from the actual brightness are L1 and L2, then find the four CCMs corresponding to T1 and L1, CCM2 corresponding to T1 and L2, CCM3 corresponding to T2 and L1, and CCM4 corresponding to T2 and L2.
[0084] In this embodiment, if the closest target color temperature and target brightness are to be found in the LUT, then among the multiple color temperatures included in the LUT, the two color temperatures with the smallest absolute difference from the actual color temperature are selected as the target color temperatures; and among the multiple brightnesses included in the LUT, the two brightnesses with the smallest absolute difference from the actual brightness are selected as the target brightnesses.
[0085] In this embodiment, if the CCM is to be found in the LUT, then the four CCMs at the corresponding positions can be found in the LUT based on the two target color temperatures and two target brightnesses. That is, the CCMs in the four cells where the two rows (or two columns) corresponding to the two target color temperatures and the two columns (or two rows) corresponding to the two target brightnesses intersect are taken as the found CCMs.
[0086] In this embodiment, if multiple preset color temperatures and brightness are arranged in order of size (or height), finding the target color temperature / brightness may include: finding which two preset color temperatures / brightnesses the actual color temperature / brightness is located between, and these two color temperatures / brightnesses are the target color temperature / brightness.
[0087] In other embodiments, the number of target color temperatures and brightness values to be searched can be set independently, and can be the same or different; for example, the color temperature / brightness value closest to the actual color temperature / brightness value can be searched as the target color temperature / brightness value, thereby finding a CCM in the LUT and directly using it as the CCM corresponding to the image to be corrected; or, for example, three or more color temperatures / brightness values closest to the actual color temperature / brightness value can be selected as the target color temperature / brightness value to obtain more CCM values, so as to obtain the CCM corresponding to the image to be corrected based on more CCM values.
[0088] In one embodiment of this example, determining the CCM corresponding to the image to be corrected based on the found CCM may include:
[0089] For the two pairs of CCMs with the same color temperature among the four CCMs found, interpolation is performed based on brightness to obtain two intermediate CCMs. The two intermediate CCMs are then interpolated again based on color temperature to obtain the CCM corresponding to the image to be corrected.
[0090] Alternatively, two pairs of CCMs with the same brightness among the four CCMs found can be interpolated according to color temperature to obtain two intermediate CCMs. The two intermediate CCMs can then be interpolated again according to brightness to obtain the CCM corresponding to the image to be corrected.
[0091] For example, if we find four CCMs at target color temperatures T1 and T2 and target brightness L1 and L2, we can first interpolate CCM1 at T1 and L1 and CCM2 at T1 and L2 based on brightness, and then interpolate CCM3 at T2 and L1 and CCM4 at T2 and L2 based on brightness again. Finally, we can interpolate the result of the brightness interpolation (two intermediate CCMs) based on color temperature.
[0092] Alternatively, first interpolate CCM1 at T1 and L1 and CCM3 at T2 and L1 based on color temperature, then interpolate CCM3 at T1 and L2 and CCM4 at T2 and L2 based on color temperature, and finally interpolate the result of the color temperature interpolation (two intermediate CCMs) based on brightness again.
[0093] This implementation method can improve the adaptability and accuracy of the CCM corresponding to the image to be corrected.
[0094] Other embodiments are not limited to using interpolation to obtain the CCM corresponding to the image to be corrected.
[0095] This application also provides a color correction method, such as... Figure 2 As shown, steps S110-S140 are included:
[0096] For details of steps S110-S130 and their implementation, please refer to the above.
[0097] S140. Perform color correction on the image to be corrected according to the CCM corresponding to the image to be corrected.
[0098] This application also provides an image color correction device, such as... Figure 3 As shown, it includes a memory 31 and a processor 32; the memory 31 is used to store a program for color correction; the processor 32 is used to read and execute the program for color correction, and perform the color correction matrix determination method or the color correction method described in any of the embodiments or implementations above.
[0099] This application also provides a storage medium for storing a color correction program; when the color correction program is read and executed, it performs the color correction matrix determination method or the color correction method described in any embodiment or implementation of the document.
[0100] The following example illustrates an embodiment of this application.
[0101] In this example, k different color temperatures of light sources are set inside the light box. The color temperatures of these light sources are denoted as T0, T1, ..., T. k In practical applications, the color temperature is not limited to using a lightbox environment.
[0102] The color correction process in this example is as follows: Figure 4 As shown, the process includes the following steps S410-S440:
[0103] S410. For the preset k color temperatures and m brightness levels, obtain k×m CCMs for each color temperature and different brightness levels.
[0104] Specifically, for each of the k color temperatures mentioned above, the following operations are performed: capture m sets of RAW data of brightness levels (m is a positive integer) at that color temperature, and perform CCM correction on each set to obtain m CCMs at that color temperature. A total of k×m CCMs can be obtained for the k color temperatures.
[0105] This example uses wide dynamic range mode. Therefore, in wide dynamic range mode, RAW data at different brightness levels can be captured. For each color temperature, m sets of RAW data at different brightness levels can be obtained.
[0106] Among them, by controlling the exposure, the brightness of the white block (the 19th color block) in the 24-color chart can be used as the target to capture RAW data at different brightness levels;
[0107] Assuming the captured RAW data has n bits (n is a positive integer), then the maximum brightness of white blocks in m sets of RAW data is 2. n ;
[0108] The brightness of the white blocks in the m sets of acquired RAW data are as follows:
[0109]
[0110] By adjusting the exposure, m sets of RAW data at different brightness levels can be captured at m exposure levels.
[0111] Let the maximum exposure be E. max The minimum value is E min That is, the adjustable exposure range E range =E max -E min The exposure is divided into m levels, and the exposure for each level is as follows:
[0112]
[0113] For each set of captured RAW data, CCM correction can be performed using any existing method to obtain the corresponding CCM for that set of RAW data. The CCM for a set of RAW data is the CCM corresponding to the color temperature and brightness level at the time the data was captured.
[0114] In this example, CCM correction can be performed by performing steps S51-S55 respectively, but not limited to, to obtain the CCM:
[0115] S51. In the Lab color space, calculate the L, a, and b values corresponding to each color block from the 1st to the 18th color blocks in the captured RAW data.
[0116] S52. For a given initial CCM, perform CCM correction on the three-channel R / G / B values of color patches 1 to 18 in the RAW data. Let the input RGB matrix be:
[0117]
[0118] The initial CCM is:
[0119]
[0120] The output RGB matrix satisfies:
[0121]
[0122] S53. Convert the above output RGB matrix from RGB space to Lab space.
[0123] S54. Place the coordinate values of color patches 1 to 18 in the RAW data and the coordinate values of color patches 1 to 18 in the target image of the standard color chart under the same Lab coordinate system, and calculate the distance △ between the corresponding color patches; this distance includes, but is not limited to, the Euclidean distance of the Lab coordinate system or the Euclidean distance of the ab coordinate system.
[0124] S55. Determine whether the sum of the distances between the 18 color blocks satisfies the following formula:
[0125] ∑Δ≤δ (1)
[0126] Where δ is a preset threshold.
[0127] If the condition is not met, fine-tune the elements in the CCM and then perform the above steps S51-S55 until the distances of the 18 color blocks satisfy equation (1). The resulting CCM is:
[0128]
[0129] After the above steps, a total of k×m CCMs are obtained, each corresponding to a different color temperature and a different brightness.
[0130] S420. Based on the obtained k×m CCMs, construct a LUT (Look-Up Table) for color temperature and luminance levels, as shown in Table 1, where different columns correspond to different color temperatures T0, T1, ..., T... k Different rows correspond to different brightness levels E1, E2, ..., E m CCM in the table ij This refers to brightness level E. i Color temperature T j The CCM obtained at that time is any one from 1 to m, and j is any one from 1 to k.
[0131] Table 1. Lookup table for color temperature and brightness levels
[0132]
[0133] S430. In wide dynamic range scenes, using the actual brightness (or exposure) as the target value, find the two closest brightness levels E in the LUT. A E B Using the target brightness and the actual color temperature as the target value, find the two closest color temperatures T in the LUT. C T DBased on the two target brightness levels and two target color temperatures, four corresponding CCMs can be found: CCM AC CCM AD CCM BC and CCM BD The four CCMs are interpolated twice based on the order of brightness and color temperature (the order of brightness and color temperature interpolation is not limited) to obtain the final CCM (i.e., the CCM corresponding to the image to be corrected).
[0134] For example, first compare CCMs with the same brightness but different color temperatures. AC CCM AD Interpolation is performed based on color temperature to obtain an intermediate CCM. BC and CCM BD Interpolation is performed based on color temperature to obtain another intermediate CCM; then, interpolation is performed again on the two intermediate CCMs based on brightness to obtain the final CCM. For example, first interpolate CCMs with the same color temperature but different brightness... AC CCM BC Interpolation is performed based on brightness to obtain an intermediate CCM. AD and CCM BD Interpolate the brightness to obtain another intermediate CCM; interpolate the two intermediate CCMs again based on the color temperature to obtain the final CCM.
[0135] S440. The final CCM is used to perform color correction on the actual raw data acquired in the image to be corrected. The actual raw data acquired here is the raw data in wide dynamic range mode.
[0136] This example provides a wide dynamic range (WDR) CCM correction method. Considering the significant differences in RAW data with different brightness levels under WDR, it combines brightness and color temperature to obtain the CCM. During correction, the influence of different factors in the actual environment on the CCM is taken into account, saving on subsequent online optimization costs and equipment performance. Then, a LUT table is obtained by combining brightness and color temperature, and the four nearest CCMs are found according to the actual environment. Two interpolations are performed to obtain the final CCM. Compared with the previous method that uses linear CCM, this method has better adaptability and higher accuracy.
[0137] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A method for determining a color correction matrix, characterized in that, include: For multiple preset color temperatures and multiple brightness levels, at least one color correction matrix is obtained for each color temperature and brightness level, including: for each preset color temperature, the following operations are performed: raw data of wide dynamic range mode at different brightness levels at that color temperature are collected; color correction is performed on the collected raw data of different brightness levels to obtain the color correction matrix corresponding to each brightness level at that color temperature; wherein, different brightness levels are identified as different exposure levels. The actual color temperature and actual brightness of the image to be corrected are obtained when it is captured, and multiple color correction matrices corresponding to the actual color temperature and actual brightness are found based on the actual color temperature and actual brightness; wherein, the original data of the image to be corrected is synthesized from multiple frames; Based on the found color correction matrix, the color correction matrix corresponding to the image to be corrected is determined by interpolation.
2. The color correction matrix determination method as described in claim 1, characterized in that, The collection of raw data at different brightness levels under this color temperature includes: At this color temperature, the exposure is adjusted to several preset exposure levels, and raw data of the brightness corresponding to the several different exposure levels are collected.
3. The color correction matrix determination method as described in claim 1, characterized in that, The process of performing color correction on the collected raw data of different brightness levels to obtain the color correction matrix corresponding to different brightness levels at that color temperature includes: The raw data collected for each brightness level at this color temperature are processed as follows to obtain the color correction matrix corresponding to each brightness level at this color temperature: Based on the given initial color correction matrix at this brightness, the RGB three-channel values of the color patches in the original data at this brightness are corrected to obtain the output RGB matrix, and the output RGB matrix is converted to Lab space; then in Lab space, for each color patch, the distance between the coordinate value of the color patch in the original data and the coordinate value of the corresponding color patch in the preset standard color chart is calculated; If the sum of the distances of all the calculated color blocks is greater than a preset threshold, the element values in the color correction matrix are adjusted and the above operation is performed again until the sum of the distances of all the calculated color blocks is not greater than the preset threshold. Then, the current color correction matrix is used as the color correction matrix for that brightness.
4. The color correction matrix determination method as described in claim 1, characterized in that, After obtaining at least one color correction matrix under different color temperatures and brightness levels, the process further includes: Save at least one color correction matrix obtained under different color temperatures and brightness levels, corresponding to the color temperature and brightness at which the color correction matrix was obtained. The step of finding the color correction matrix corresponding to the actual color temperature and the actual brightness based on the actual color temperature and the actual brightness includes: In the corresponding saved color temperature, brightness, and color correction matrix, the color correction matrix corresponding to the actual color temperature and actual brightness is searched according to the actual color temperature and actual brightness.
5. The color correction matrix determination method as described in claim 1, characterized in that, The step of finding multiple color correction matrices corresponding to the actual color temperature and actual brightness based on the actual color temperature and actual brightness includes: A color correction matrix is determined based on the two target color temperatures closest to the actual color temperature and the two target brightness levels closest to the actual brightness, including: Among a number of preset color temperatures, the two color temperatures with the smallest absolute difference from the actual color temperature are selected as target color temperatures. Among a number of preset brightness levels, the two brightness levels with the smallest absolute difference from the actual brightness level are selected as target brightness levels. Determine the four color correction matrices corresponding to the two target color temperatures and the two target brightness.
6. The color correction matrix determination method as described in claim 5, characterized in that, The step of determining the color correction matrix corresponding to the image to be corrected by interpolation based on the found color correction matrix includes: Two pairs of color correction matrices with the same color temperature among the four color correction matrices found are interpolated according to brightness to obtain two intermediate color correction matrices. The two intermediate color correction matrices are then interpolated again according to color temperature to obtain the color correction matrix corresponding to the image to be corrected. Alternatively, two pairs of color correction matrices with the same brightness among the four color correction matrices found can be interpolated according to color temperature to obtain two intermediate color correction matrices. The two intermediate color correction matrices can then be interpolated again according to brightness to obtain the color correction matrix corresponding to the image to be corrected.
7. A color correction method, characterized in that, include: The color correction matrix corresponding to the image to be corrected is determined according to the color correction matrix determination method as described in any one of claims 1-6; The image to be corrected is color-corrected according to the color correction matrix corresponding to the image to be corrected.
8. A color correction device, comprising a memory and a processor; characterized in that: The memory is used to store the color correction program; The processor is used to read and execute the color correction program, perform the color correction matrix determination method as described in any one of claims 1-6, or perform the color correction method as described in claim 7.
9. A storage medium, characterized in that: The storage medium is used to store a program for color correction; when the program for color correction is read and executed, it performs the color correction matrix determination method as described in any one of claims 1-6, or the color correction method as described in claim 7.
Citation Information
Patent Citations
Image processing method, terminal and computer readable storage medium
CN107846554A
Color correction matrix adjusting method and device, terminal equipment and medium
CN112073703A
Color reproduction correction method, color reproduction correction device and imaging apparatus
JP2015204481A