3D LUT update methods, color correction methods and systems
Patent Information
- Application Number
- CN202311653913.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-12-05
AI Technical Summary
Existing 3D LUTs have long generation and debugging cycles, high labor costs, lack versatility and flexibility, and are prone to noise.
By acquiring the grid points to be updated in the preset 3D LUT, determining their corresponding target color pair datasets and weights, and updating the 3D LUT based on the pre-established mapping relationship and color difference target value, a target 3D LUT is generated.
It simplifies the debugging process, reduces labor costs, improves the versatility and flexibility of 3D LUTs, reduces noise, and is suitable for different precision and image processing workflows.
Smart Images

Figure CN117992468B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image processing technology, and in particular to a method for updating a 3D LUT, a color correction method, a system, an apparatus, a medium, a chip, and a chip module. Background Technology
[0002] 3D (3D) LUTs (Look-Up Tables) are commonly used for image filter creation and color effect adjustment. Traditional 3D LUT generation relies on the experience of the technician. When adjusting multiple similar colors to move closer to a target color, it's difficult to balance the effects achieved by different colors, leading to high debugging difficulty, long debugging cycles, and high labor costs. The location of the 3D LUT table within the ISP pipeline (image processing flow) affects the color to be adjusted, and the target color may differ. 3D LUTs built based on a single module or sensor lack versatility and flexibility. After mapping 3D RGB (red, green, blue, a color standard) point-to-point, the calculated 3D LUT is often not smooth enough, resulting in noise. Furthermore, the generated noise does not exhibit a universal pattern across a particular channel, making it difficult for ordinary denoising algorithms to achieve effective noise reduction. Summary of the Invention
[0003] The technical problem to be solved by this disclosure is to overcome the defects of existing technologies, such as long debugging cycle, high labor cost, lack of universality and flexibility of generated 3D LUTs, and susceptibility to noise, and to provide a 3D LUT update method, color correction method, system, device, medium, chip and chip module.
[0004] This disclosure solves the above-mentioned technical problems through the following technical solution:
[0005] This disclosure provides a method for updating a 3D LUT, the method comprising:
[0006] Obtain the grid points to be updated from the preset 3D LUT;
[0007] Obtain the target color pair dataset corresponding to the grid point to be updated, and determine the weight of each color pair in the target color pair dataset;
[0008] Each color pair data includes color data to be debugged and target color data corresponding to the color data to be debugged;
[0009] Based on the pre-established first mapping relationship and the first color difference target value, determine the first update parameter target value corresponding to the grid point to be updated;
[0010] Wherein, the first mapping relationship is a mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated, and the first color difference is the color difference between the color data to be debugged and the target color data;
[0011] The grid points to be updated are updated based on the target value of the first update parameter so as to update the preset 3D LUT to the target 3D LUT.
[0012] Preferably, the step of obtaining the target color pair dataset corresponding to the grid point to be updated includes:
[0013] Acquire several image data to be debugged and several target image data corresponding to the image data to be debugged;
[0014] An initial color pair dataset is constructed based on the image data to be debugged and the target image data;
[0015] Obtain the Euclidean distance between the color value of the grid point to be updated and each of the color data to be debugged in the initial color pair dataset;
[0016] Based on the Euclidean distance, a preset number of color pairs are selected from the initial color pair dataset to construct the target color pair dataset.
[0017] Preferably, each of the image data to be debugged includes the mean and standard deviation of the color values of several pixels in the image to be debugged;
[0018] The step of constructing an initial color pair dataset based on the image data to be debugged and the target image data includes:
[0019] The standard deviation of each image data to be debugged is compared with the first threshold.
[0020] In response to the fact that the standard deviation of all the image data to be debugged is less than or equal to the first threshold, the mean of the image data to be debugged is used as the first color data to be debugged, and a first color pair dataset is constructed based on the first color data to be debugged and the first target color data in the target image data corresponding to the first color data to be debugged, and the first color pair dataset is used as the initial color pair dataset.
[0021] In response to the fact that the standard deviation of all the image data to be debugged is greater than the first threshold, the mean of the image data to be debugged is used as the second color data to be debugged. A second color pair dataset is constructed based on the second color data to be debugged and the second target color data in the target image data that corresponds to the second color data to be debugged. The second color pair dataset is then denoised based on a clustering algorithm to obtain the initial color pair dataset.
[0022] In response to a partial standard deviation of the image data to be debugged being less than or equal to the first threshold and a partial standard deviation being greater than the first threshold, the mean of the image data to be debugged with a standard deviation less than or equal to the first threshold is used as the third color data to be debugged. A third color pair dataset is constructed based on the third color data to be debugged and the third target color data in the target image data that corresponds to the third color data to be debugged. The mean of the image data to be debugged with a standard deviation greater than the first threshold is used as the fourth color data to be debugged. A fourth color pair dataset is constructed based on the fourth color data to be debugged and the fourth target color data in the target image data that corresponds to the fourth color data to be debugged. The fourth color pair dataset is denoised based on a clustering algorithm. The initial color pair dataset is constructed based on the third color pair dataset and the denoised fourth color pair dataset.
[0023] Preferably, before the step of obtaining the Euclidean distance between the color value of the grid point to be updated and each of the color data to be debugged in the initial color pair dataset, the method further includes:
[0024] Based on the initial color pair dataset, obtain the number of color pairs corresponding to each sub-cube obtained by segmenting the preset 3D LUT;
[0025] The quantity is compared with a second threshold;
[0026] In response to the quantity being greater than or equal to the second threshold, the step of obtaining the Euclidean distance between the color value of the grid point to be updated and each of the color data to be debugged in the initial color pair dataset is performed;
[0027] In response to the quantity being less than the second threshold, the step of obtaining a plurality of image data to be debugged and a plurality of target image data corresponding to the image data to be debugged is returned to obtain new image data to be debugged and corresponding new target image data;
[0028] And / or,
[0029] The step of selecting a preset number of color pairs from the initial color pair dataset based on the Euclidean distance to construct the target color pair dataset includes:
[0030] The target color pair dataset is constructed by selecting a preset number of color pairs from the initial color pair dataset whose Euclidean distance is less than a preset distance or whose Euclidean distance is the smallest.
[0031] Preferably, the calculation formula for the step of determining the weight of each color pair in the target color pair dataset is as follows:
[0032] w(d t )=(d t p +e) -1
[0033] Where p and e are parameters, t represents the t-th color pair data, and d t w(d) represents the Euclidean distance corresponding to the t-th color pair data. t ) represents the weight corresponding to the t-th color pair data.
[0034] Preferably, the first mapping relationship is a first functional relationship between the first color difference and the first update parameter established by the least squares method;
[0035] The step of determining the target value of the first update parameter corresponding to the grid point to be updated based on the pre-established first mapping relationship and the first color difference target value includes:
[0036] In response to the first color difference target value being the minimum value among the first color differences, the first update parameter target value is determined based on the first functional relationship.
[0037] Preferably, the calculation formula corresponding to the first functional relationship is as follows:
[0038]
[0039] Where n represents the number of color pairs in the target color pair dataset, ref t src represents the t-th target color data. t Let t represent the t-th color data to be debugged, A represent the first update parameter, and y represent the first color difference.
[0040] Preferably, after the step of updating the grid points to be updated based on the first update parameter target value to update the preset 3D LUT to the target 3D LUT, the method further includes:
[0041] The color data to be debugged in the initial color pair dataset is input into the target 3D LUT to obtain the debugged color data;
[0042] Based on the pre-established second mapping relationship and the second color difference target value, the corresponding second update parameter target value of the target 3D LUT is determined;
[0043] Wherein, the second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT, and the second color difference is the color difference between the debugged color data and the target color data corresponding to the debugged color data in the initial color pair dataset;
[0044] The target 3D LUT is updated based on the target value of the second update parameter.
[0045] Preferably, the second mapping relationship is a second functional relationship between the second color difference and the second update parameter established by the least squares method;
[0046] The step of determining the corresponding second update parameter target value of the target 3D LUT based on the pre-established second mapping relationship and the second color difference target value includes:
[0047] In response to the second color difference target value being the minimum value among the second color differences, the second update parameter target value is determined based on the second functional relationship.
[0048] Preferably, the calculation formula corresponding to the second functional relationship is as follows:
[0049]
[0050] Where i represents the i-th color pair data, m represents the number of color pairs data in the initial color pair dataset, refi represents the i-th target color data, srci represents the i-th debugged color data, B represents the second update parameter, and z represents the second color difference.
[0051] Preferably, the second mapping relationship is a mapping relationship established based on the debugged color data after color space conversion and the target color data corresponding to the debugged color data in the initial color pair dataset.
[0052] This disclosure also provides a color correction method, the color correction method comprising:
[0053] The actual color data is input into the target 3D LUT for color correction, and the corrected color data is output. The target 3D LUT is obtained based on the 3D LUT update method described above.
[0054] This disclosure also provides a 3D LUT updating system, the updating system comprising:
[0055] The grid acquisition module is used to acquire the grid points to be updated in the preset 3D LUT;
[0056] The target data acquisition module is used to acquire the target color pair dataset corresponding to the grid point to be updated;
[0057] The weight determination module is used to determine the weight corresponding to each color pair in the target color pair dataset.
[0058] Each color pair data includes color data to be debugged and target color data corresponding to the color data to be debugged;
[0059] The first parameter determination module is used to determine the first update parameter target value corresponding to the grid point to be updated based on the pre-established first mapping relationship and the first color difference target value.
[0060] Wherein, the first mapping relationship is a mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated, and the first color difference is the color difference between the color data to be debugged and the target color data;
[0061] The first update module is used to update the grid points to be updated based on the target value of the first update parameter, so as to update the preset 3D LUT to the target 3D LUT.
[0062] Preferably, the target data acquisition module includes:
[0063] An image data acquisition unit is used to acquire several image data to be debugged and several target image data corresponding to the image data to be debugged;
[0064] An initial data construction unit is used to construct an initial color pair dataset based on the image data to be debugged and the target image data;
[0065] The distance acquisition unit is used to acquire the Euclidean distance between the color value of the grid point to be updated and each color data to be debugged in the initial color pair dataset;
[0066] The target data construction unit is used to select a preset number of color pairs from the initial color pair dataset based on the Euclidean distance to construct the target color pair dataset.
[0067] Preferably, each of the image data to be debugged includes the mean and standard deviation of the color values of several pixels in the image to be debugged;
[0068] The initial data construction unit includes:
[0069] The comparison subunit is used to compare the standard deviation of each of the image data to be debugged with a first threshold.
[0070] The first response subunit is configured to respond to the fact that the standard deviation of all the image data to be debugged is less than or equal to the first threshold, take the mean of the image data to be debugged as the first color data to be debugged, construct a first color pair dataset based on the first color data to be debugged and the first target color data in the target image data corresponding to the first color data to be debugged, and take the first color pair dataset as the initial color pair dataset.
[0071] The second response subunit is configured to respond to the fact that the standard deviation of all the image data to be debugged is greater than the first threshold, take the mean of the image data to be debugged as the second color data to be debugged, construct a second color pair dataset based on the second color data to be debugged and the second target color data in the target image data that corresponds to the second color data to be debugged, and perform noise reduction processing on the second color pair dataset based on a clustering algorithm to obtain the initial color pair dataset.
[0072] The third response subunit is configured to respond to a situation where a portion of the standard deviation of the image data to be debugged is less than or equal to the first threshold and a portion of the standard deviation is greater than the first threshold, by using the mean of the image data to be debugged with a standard deviation less than or equal to the first threshold as the third color data to be debugged, constructing a third color pair dataset based on the third color data to be debugged and the third target color data in the target image data corresponding to the third color data to be debugged, using the mean of the image data to be debugged with a standard deviation greater than the first threshold as the fourth color data to be debugged, constructing a fourth color pair dataset based on the fourth color data to be debugged and the fourth target color data in the target image data corresponding to the fourth color data to be debugged, performing denoising processing on the fourth color pair dataset based on a clustering algorithm, and constructing the initial color pair dataset based on the third color pair dataset and the denoised fourth color pair dataset.
[0073] Preferably, the target data acquisition module further includes:
[0074] The quantity acquisition unit is used to acquire the quantity of color pairs corresponding to each sub-cube obtained by segmenting the preset 3D LUT based on the initial color pair dataset;
[0075] A comparison unit is used to compare the quantity with a second threshold.
[0076] The first response unit is used to invoke the distance acquisition unit in response to the quantity being greater than or equal to the second threshold.
[0077] The second response unit is used to call the image data acquisition unit in response to the quantity being less than the second threshold, so as to acquire new image data to be debugged and corresponding new target image data.
[0078] And / or,
[0079] The target data construction unit is further configured to select a preset number of color pairs from the initial color pair dataset whose Euclidean distance is less than a preset distance or whose Euclidean distance is the smallest, in order to construct the target color pair dataset.
[0080] Preferably, the weight determination module uses the following calculation formula:
[0081] w(d t )=(d t p +e) -1
[0082] Where p and e are parameters, t represents the t-th color pair data, and d t w(d) represents the Euclidean distance corresponding to the t-th color pair data. t ) represents the weight corresponding to the t-th color pair data.
[0083] Preferably, the first mapping relationship is a first functional relationship between the first color difference and the first update parameter established by the least squares method;
[0084] The first parameter determination module is further configured to determine the first update parameter target value based on the first functional relationship in response to the first color difference target value being the minimum value among the first color differences.
[0085] Preferably, the calculation formula corresponding to the first functional relationship is as follows:
[0086]
[0087] Where n represents the number of color pairs in the target color pair dataset, reft represents the t-th target color data, and src t Let t represent the t-th color data to be debugged, A represent the first update parameter, and y represent the first color difference.
[0088] Preferably, the update system further includes:
[0089] The debugging data acquisition module is used to input the color data to be debugged in the initial color pair dataset into the target 3D LUT to obtain the debugged color data;
[0090] The second parameter determination module is used to determine the corresponding second update parameter target value of the target 3D LUT based on the pre-established second mapping relationship and the second color difference target value.
[0091] Wherein, the second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT, and the second color difference is the color difference between the debugged color data and the target color data corresponding to the debugged color data in the initial color pair dataset;
[0092] The second update module is used to update the target 3D LUT based on the target value of the second update parameter.
[0093] Preferably, the second mapping relationship is a second functional relationship between the second color difference and the second update parameter established by the least squares method;
[0094] The second parameter determination module is further configured to determine the second update parameter target value based on the second functional relationship in response to the second color difference target value being the minimum value among the second color differences.
[0095] Preferably, the calculation formula corresponding to the second functional relationship is as follows:
[0096]
[0097] Where i represents the i-th color pair data, m represents the number of color pairs data in the initial color pair dataset, refi represents the i-th target color data, srci represents the i-th debugged color data, B represents the second update parameter, and z represents the second color difference.
[0098] Preferably, the second mapping relationship is a mapping relationship established based on the debugged color data after color space conversion and the target color data corresponding to the debugged color data in the initial color pair dataset.
[0099] This disclosure also provides a color correction system, the color correction system comprising:
[0100] The correction module is used to input the actual color data into the target 3D LUT for color correction and output the corrected color data. The target 3D LUT is obtained based on the 3D LUT update system described above.
[0101] This disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and for running on the processor, wherein when the processor executes the computer program, it implements the 3D LUT update method as described above, or implements the color correction method as described above.
[0102] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the 3D LUT update method as described above, or the color correction method as described above.
[0103] This disclosure also provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the 3D LUT update method as described above, or the color correction method as described above.
[0104] This disclosure also provides a chip module for use in an electronic device, including a transceiver component and a chip, the chip being used to implement the 3D LUT update method as described above, or to implement the color correction method as described above.
[0105] Based on common knowledge in the field, the preferred conditions described can be combined arbitrarily to obtain various preferred embodiments of this disclosure.
[0106] The positive and progressive effects of this disclosure are as follows:
[0107] This disclosure determines the target value of the first update parameter corresponding to the grid point to be updated by establishing a first mapping relationship between the first color difference between the color data to be debugged and the target color data and the first update parameter of the grid point to be updated, thereby updating the grid point to be updated to update the preset 3D LUT to the target 3D LUT. It is simple to debug, convenient to operate, reduces labor costs, and is applicable to 3D LUTs of different precision, different target color data and different image processing workflows. It has versatility and flexibility, improves the smoothness of 3D LUT and reduces noise. Attached Figure Description
[0108] Figure 1 This is a flowchart of the 3D LUT update method according to Embodiment 1 of this disclosure.
[0109] Figure 2 This is a flowchart of step S102 in the 3D LUT update method of Embodiment 2 of this disclosure.
[0110] Figure 3 This is a schematic diagram of the 3D LUT in the 3D LUT update method of Embodiment 2 of this disclosure.
[0111] Figure 4This is a flowchart of the 3D LUT update method of Embodiment 2 of this disclosure.
[0112] Figure 5 This is a schematic diagram of the process for constructing the initial color pair dataset in the 3D LUT update method of Embodiment 2 of this disclosure.
[0113] Figure 6 This is a schematic diagram illustrating the process of globally optimizing the target 3D LUT in the 3D LUT update method of Embodiment 2 of this disclosure.
[0114] Figure 7 This is a schematic diagram of the module of the 3D LUT update system of Embodiment 4 of this disclosure.
[0115] Figure 8 This is a schematic diagram of the module of the 3D LUT update system of Embodiment 5 of this disclosure.
[0116] Figure 9 This is a schematic diagram of the structure of the electronic device according to Embodiment 7 of this disclosure. Detailed Implementation
[0117] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.
[0118] Example 1
[0119] This embodiment provides a method for updating a 3D LUT, such as... Figure 1 As shown, the update method includes:
[0120] S101. Obtain the grid points to be updated in the preset 3D LUT.
[0121] Specifically, the preset 3D LUT can be a high-precision 3D LUT or a low-precision 3D LUT. The grid points to be updated can be some or all of the grid points in the preset 3D LUT. That is, in this embodiment, only some grid points in the preset 3D LUT can be updated, or all grid points in the preset 3D LUT can be updated. The number of grid points to be updated can be adjusted according to actual needs, and each grid point to be updated can be updated separately.
[0122] S102. Obtain the target color pair dataset corresponding to the grid points to be updated.
[0123] S103. Determine the weight of each color pair in the target color pair dataset.
[0124] Each color pair dataset includes the color data to be debugged and the target color data corresponding to it. After determining the weight of each color pair in the target color pair dataset, a color pair weight table can be generated for convenient subsequent use.
[0125] S104. Based on the pre-established first mapping relationship and the first color difference target value, determine the first update parameter target value corresponding to the grid point to be updated.
[0126] The first mapping relationship is the mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated. The first color difference is the color difference between the color data to be debugged and the target color data.
[0127] S105. Update the grid points to be updated based on the target value of the first update parameter, so as to update the preset 3D LUT to the target 3D LUT.
[0128] Specifically, taking the updating of multiple grid points as an example, the calculation formula for updating the grid points based on the target value of the first update parameter is as follows:
[0129] N_LUT i =A i *O_LUT i
[0130] Where i represents the i-th grid point to be updated, A i O_LUT represents the target value of the first update parameter corresponding to the i-th grid point to be updated. i N_LUT represents the color value of the i-th grid point to be updated. i This represents the updated color value of the i-th grid point.
[0131] In the specific implementation process, A i It can be represented as a 3x3 matrix, O_LUT i and N_LUT i Both are 3x1 matrices.
[0132] After updating each grid point individually, the updated color values of each grid point are merged to obtain the entire target 3D LUT.
[0133] In this embodiment, by establishing a first mapping relationship between the first color difference between the color data to be debugged and the target color data and the first update parameter of the grid point to be updated, the target value of the first update parameter corresponding to the grid point to be updated is determined, thereby updating the grid point to be updated to update the preset 3D LUT to the target 3D LUT. The debugging is simple and convenient, reducing labor costs. It is applicable to 3D LUTs of different precision, different target color data and different image processing processes, and has versatility and flexibility. It improves the smoothness of the 3D LUT and reduces noise.
[0134] The execution subject of the 3D LUT update method provided in this embodiment can be a separate chip, chip module, or electronic device, or it can be a chip or chip module integrated into an electronic device.
[0135] Example 2
[0136] This embodiment provides a method for updating a 3D LUT, which is a further improvement on Embodiment 1.
[0137] In a feasible solution, such as Figure 2 As shown, step S102 includes:
[0138] S1021. Obtain several image data to be debugged and several target image data corresponding to the image data to be debugged.
[0139] Specifically, images of objects such as 24-color charts, 140-color charts, and outdoor scenes can be captured using the device to be debugged and the target device, respectively, thus obtaining the initial image to be debugged and the initial target image. The selection of objects can be based on the needs of the actual scene to be debugged. When using the device to be debugged and the target device for shooting, the lighting conditions can also be adjusted, for example, shooting under standard lightbox lighting and in an outdoor scene. The target device can be configured according to actual needs to obtain different target image data, making the 3D LUT versatile and flexible.
[0140] For the initial image to be debugged and the initial target image captured, select areas of the same color, such as color blocks in a 24-color chart. The selected color blocks are used as the actual image to be debugged and the target image.
[0141] The image to be debugged is the image captured by the device to be debugged, and the target image is the image captured by the target device. The purpose of this embodiment is to make the image to be debugged captured by the device to be debugged closer to the target image captured by the target device. Therefore, the image to be debugged and the target image are in one-to-one correspondence, and the data of the image to be debugged and the data of the target image are also in one-to-one correspondence.
[0142] S1022. Construct an initial color pair dataset based on the image data to be debugged and the target image data.
[0143] S1023. Obtain the Euclidean distance between the color value of the grid point to be updated and each color data to be debugged in the initial color pair dataset.
[0144] Specifically, taking the initial color pair dataset in the RGB color space as an example, the calculation formula for this step is as follows:
[0145]
[0146] Where t represents the t-th color data to be debugged, dt represents the Euclidean distance corresponding to the t-th color data to be debugged, Rt, Gt, and Bt represent the values of the t-th color data to be debugged in the red, green, and blue channels, respectively, and Rlut, Glut, and Blut represent the color values of the grid points to be updated in the red, green, and blue channels, respectively.
[0147] S1024. Based on Euclidean distance, select a preset number of color pairs from the initial color pair dataset to construct the target color pair dataset.
[0148] In this scheme, a preset number of color pairs are selected from the initial color pair dataset using Euclidean distance to construct the target color pair dataset, ensuring the accuracy and rationality of the selection of color pairs corresponding to the grid points to be updated.
[0149] In one feasible scheme, each image data to be debugged includes the mean and standard deviation of the color values of several pixels in the image to be debugged, and the target image data corresponding to each image data to be debugged includes the mean and standard deviation of the color values of several pixels in the target image.
[0150] Specifically, the mean and standard deviation for each image data point to be debugged can be the mean and standard deviation of the color values of all pixels in the image, or it can be the mean and standard deviation of the color values of a subset of pixels in the image, and can be set according to actual needs. The mean and standard deviation for each target image data point can also be set similarly.
[0151] Step S1022 includes:
[0152] The standard deviation of each image data to be debugged is compared with the first threshold.
[0153] In response to the fact that the standard deviation of all the image data to be debugged is less than or equal to the first threshold, the mean of the image data to be debugged is used as the first color data to be debugged. Based on the first color data to be debugged and the first target color data in the target image data corresponding to the first color data to be debugged, a first color pair dataset is constructed as the first color pair dataset.
[0154] In response to the fact that the standard deviation of all the image data to be debugged is greater than the first threshold, the mean of the image data to be debugged is used as the second color data to be debugged. Based on the second color data to be debugged and the second target color data in the target image data that corresponds to the second color data to be debugged, a second color pair dataset is constructed. The second color pair dataset is denoised based on the clustering algorithm to obtain the initial color pair dataset.
[0155] In response to a partial standard deviation of the image data to be debugged being less than or equal to a first threshold and a partial standard deviation being greater than the first threshold, the mean of the image data to be debugged with a standard deviation less than or equal to the first threshold is used as the third color data to be debugged. A third color pair dataset is constructed based on the third color data to be debugged and the third target color data in the target image data that corresponds to the third color data to be debugged. The mean of the image data to be debugged with a standard deviation greater than the first threshold is used as the fourth color data to be debugged. A fourth color pair dataset is constructed based on the fourth color data to be debugged and the fourth target color data in the target image data that corresponds to the fourth color data to be debugged. The fourth color pair dataset is denoised based on a clustering algorithm. An initial color pair dataset is constructed based on the third color pair dataset and the denoised fourth color pair dataset.
[0156] In the specific implementation process, for the multiple image data to be debugged, the standard deviation of each image data to be debugged can be compared with the first threshold, and the standard deviation of each target image data can be compared with the first threshold. Based on the comparison results, the corresponding initial color pair dataset can be constructed.
[0157] Since the noise levels of the device to be debugged and the target device are different, for the second color pair dataset and the fourth color pair dataset with higher noise levels, clustering algorithms such as K-Means clustering can be used to exclude the data with high noise levels.
[0158] In this scheme, the standard deviation and the first threshold corresponding to each image data to be debugged are judged respectively. The color pair dataset constructed based on the image data to be debugged with a standard deviation greater than the first threshold is subjected to noise reduction by a clustering algorithm. This ensures that the noise of the color pair data in the constructed initial color pair dataset meets the actual requirements, and ensures the accuracy and reliability of the color pair data.
[0159] In a feasible solution, such as Figure 2 As shown, before step S1023, step S102 further includes:
[0160] S1025. Based on the initial color pair dataset, obtain the number of color pairs corresponding to each sub-cube obtained by segmenting the preset 3D LUT.
[0161] Specifically, taking the RGB color space as an example, a 3D LUT is formed by countless sub-cubes distributed at equal steps across the RGB domain. It covers all colors that can be represented in the entire RGB color space. A preset 3D LUT can be divided using a step size that is an integer multiple of 2. Each sub-cube corresponds to 8 grid points, and the number of color pairs contained within each sub-cube can be counted separately. The step size used to divide the preset 3D LUT can be set according to actual needs. Figure 3 This is a schematic diagram of a 3D LUT, which is formed by 64 sub-cubes.
[0162] S1026. Compare the quantity with the second threshold.
[0163] In response to a quantity being greater than or equal to the second threshold, step S1023 is executed;
[0164] In response to the number being less than the second threshold, return to step S1021 to obtain new image data to be debugged and the corresponding new target image data.
[0165] In this scheme, the number of color pair data corresponding to the sub-cubes of the preset 3D LUT is determined. If the number is insufficient, new image data to be debugged and new target image data are obtained. The final initial color pair dataset is formed only when the number of color pair data corresponding to the sub-cubes is sufficient, thus ensuring the reliability of the constructed initial color pair dataset.
[0166] In one feasible embodiment, step S1024 includes:
[0167] Select a preset number of color pairs from the initial color pair dataset whose Euclidean distance is less than a preset distance or whose Euclidean distance is the smallest, to construct the target color pair dataset.
[0168] In this scheme, a preset number of color pairs with a Euclidean distance less than a preset distance are selected from the initial color pair dataset to construct the target color pair dataset, or a preset number of color pairs with the smallest Euclidean distance are selected from the initial color pair dataset to construct the target color pair dataset, thus ensuring the accuracy and reliability of the target color pair dataset.
[0169] In a feasible solution, the calculation formula corresponding to step S103 is as follows:
[0170] w(d t )=(d t p +e) -1
[0171] Where p and e are parameters, t represents the t-th color pair data, and d t w(d) represents the Euclidean distance between the t-th color pairs and the data. t ) represents the weight of the t-th color pair in the data.
[0172] In this scheme, the weights corresponding to each color pair are calculated by designing parameters p and e through the Euclidean distance corresponding to each color pair in the target color pair dataset, thus ensuring the reliability of the weights.
[0173] In one feasible scheme, the first mapping relationship is a first functional relationship between the first color difference and the first update parameter established by the least squares method;
[0174] Step S104 includes:
[0175] In response to the first color difference target value being the minimum value among the first color differences, the first update parameter target value is determined based on the first functional relationship.
[0176] Specifically, the calculation formula corresponding to the first functional relationship is as follows:
[0177]
[0178] Where n represents the number of color pairs in the target color pair dataset, ref t src represents the t-th target color data. t Let t represent the t-th color data to be debugged, A represent the first update parameter, y represent the first color difference, and ||ref t -A*src t || represents ref t -A*src t The Euclidean norm.
[0179] In this scheme, based on the color data to be debugged, the target color data, and the weights, the first functional relationship is fitted using the least squares method. When the first color difference corresponding to the first functional relationship is at its minimum value, the target value of the first update parameter corresponding to the grid point to be updated is determined, thereby optimizing the grid point to be updated and updating the preset 3D LUT. That is, nonlinear least squares are used to optimize the grid point to be updated, which is also a local optimization of the preset 3D LUT. The debugging is simple, the operation is convenient, and the labor cost is reduced. It is applicable to 3D LUTs with different precision, different target color data, and different image processing workflows. It has versatility and flexibility, improves the smoothness of the 3D LUT, and reduces noise.
[0180] In a feasible solution, such as Figure 4 As shown, after step S105, the update method further includes:
[0181] S106. Input the color data to be debugged from the initial color pair dataset into the target 3D LUT to obtain the debugged color data.
[0182] Specifically, the color data to be debugged in the initial color pair dataset is input into the target 3D LUT to obtain the debugged color data, that is, the target 3D LUT is applied. The methods used include, but are not limited to, commonly used methods such as tetrahedral interpolation and trilinear interpolation.
[0183] S107. Based on the pre-established second mapping relationship and the second color difference target value, determine the corresponding second update parameter target value of the target 3D LUT.
[0184] The second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT. The second color difference is the color difference between the target color data corresponding to the debugged color data in the debugged color data and the initial color pair dataset.
[0185] S108. Update the target 3D LUT based on the target value of the second update parameter.
[0186] In this scheme, the target value of the second update parameter corresponding to the target 3D LUT is determined by a pre-established second mapping relationship. The target 3D LUT is then updated according to the target value of the second update parameter. The scheme is simple to debug, convenient to operate, reduces labor costs, and is applicable to 3D LUTs of different precision, different target color data, and different image processing workflows. It has versatility and flexibility, improves the smoothness of the 3D LUT, and reduces noise.
[0187] In one feasible scheme, the second mapping relationship is a second functional relationship between the second color difference and the second update parameter established by the least squares method;
[0188] Step S107 includes:
[0189] In response to the second color difference target value being the minimum value among the second color differences, the second update parameter target value is determined based on the second functional relationship.
[0190] Specifically, the calculation formula corresponding to the second functional relationship is as follows:
[0191]
[0192] Where i represents the i-th color pair data, m represents the number of color pairs data in the initial color pair dataset, refi represents the i-th target color data, srci represents the i-th debugged color data, B represents the second update parameter, z represents the second color difference, and ‖refi-B*srci‖ represents the Euclidean norm of refi-B*srci.
[0193] It should be noted that the calculation formula for the second functional relationship given here is only an example; other color difference formulas can also be used to establish the corresponding functional relationship. Color difference formulas are not limited to those for CIE Delta E and CIE Delta C.
[0194] In this scheme, based on the debugged color data obtained by correcting the color data to be debugged in the initial color pair dataset and the target color data corresponding to the debugged color data in the initial color pair dataset, the second function relationship is fitted using the least squares method. When the second color difference corresponding to the second function relationship is at its minimum value, the target value of the second update parameter corresponding to the target 3D LUT is determined, thereby optimizing the target 3D LUT. That is, nonlinear least squares is used to perform global optimization of the entire target LUT. The debugging is simple, the operation is convenient, and the labor cost is reduced. It is applicable to 3D LUTs with different precision, different target color data, and different image processing workflows. It has versatility and flexibility, improves the smoothness of the 3D LUT, and reduces noise.
[0195] In one feasible scheme, the second mapping relationship is a mapping relationship established based on the debugged color data after color space conversion and the target color data corresponding to the debugged color data in the initial color pair dataset.
[0196] Specifically, this embodiment is applicable to different color spaces such as RGB color space, CIE LAB (a color model published by the International Commission on Illumination) color space, and HSL (hue, saturation, and brightness) color space. When performing global optimization on the target 3D LUT, conversion can be performed on different color spaces.
[0197] In this scheme, the second target update parameter value corresponding to the target 3D LUT is determined by establishing a second mapping relationship based on the debugged color data after color space conversion and the corresponding target color data after color space conversion, as well as the second target color difference value. The target 3D LUT is then updated according to the second target update parameter value, ensuring the reliability and practicality of the 3D LUT in different color spaces.
[0198] The working principle of the 3D LUT update method in this embodiment is explained below with specific examples:
[0199] like Figure 5 The diagram shows the process of constructing the initial color pair dataset. The detailed process is as follows: First, data acquisition is performed, i.e., multiple initial images to be tested and multiple initial target images are acquired using both the device to be tested and the target device. For each initial image to be tested and each initial target image, color blocks of the same color are selected, forming multiple images to be tested and multiple target images. The mean and standard deviation of the data corresponding to each image to be tested and the data corresponding to each target image are obtained. It is then determined whether the standard deviation corresponding to each image to be tested is less than or equal to a first threshold k1. If the standard deviation corresponding to the image to be tested is less than... If the mean value of the image to be debugged is greater than or equal to the first threshold k1, then the mean value of the image to be debugged is used as the color data to be debugged, and the color data to be debugged is added to the color pair dataset Database1. If the standard deviation of the image to be debugged is greater than the first threshold k1, then the mean value of the image to be debugged is used as the color data to be debugged, and the color data to be debugged is added to the color pair dataset Database2. The K-means clustering algorithm is used to filter and remove noise in the color pair dataset Database2, and the denoised color pair dataset Database2 is merged into the color pair dataset Database1. It is determined whether the number of color pair data of the sub-cube of the preset 3D LUT is greater than or equal to the second threshold k2. If the number of color pair data of the sub-cube of the preset 3D LUT is greater than or equal to the second threshold k2, then the color pair dataset Database1 is used as the initial color pair dataset Database. If the number of color pair data of the sub-cube of the preset 3D LUT is less than the second threshold k2, then the data acquisition step is returned to acquire a new initial image to be debugged and a new initial target image.
[0200] After constructing the initial color pair dataset, the process of local optimization of the grid points of the preset 3D LUT begins. The detailed process is as follows: Obtain the grid points to be updated in the preset 3D LUT; obtain the Euclidean distance between the color value of each grid point to be updated and each color data to be debugged in the initial color pair dataset; select the n color pairs with the smallest Euclidean distance from the initial color pair dataset to construct the target color pair dataset corresponding to each grid point to be updated; determine the weight corresponding to each color pair based on the Euclidean distance corresponding to each color pair in the target color pair dataset; determine the first update parameter corresponding to each grid point to be updated when the first color difference between the color data to be debugged and the target color data is minimized by using the least squares method based on the first functional relationship established by the color data to be debugged, the target color data, and the weights in the n color pairs; update the corresponding grid points to be updated according to the first update parameter to update the preset 3D LUT to the target 3D LUT.
[0201] After local optimization of the grid points of the preset 3D LUT, the process of global optimization of the target 3D LUT begins, such as... Figure 6 The diagram shows a flowchart of global optimization of the grid points of the target 3D LUT. The detailed process is as follows:
[0202] The debugged color data src_RGB (taking RGB color space as an example) from the initial color pair dataset is input into the target 3D LUT to obtain debugged color data. The data obtained after conversion to CIE LAB color space is denoted as src_LAB. The target color data ref_RGB corresponding to the debugged color data src_RGB in the initial color pair dataset is converted to CIE LAB color space, and the data obtained is denoted as ref_LAB. By using the least squares method to establish a second function relationship based on src_LAB and ref_LAB, the second update parameter corresponding to the target 3D LUT is determined when the second color difference between src_LAB and ref_LAB is at its minimum value. The target 3D LUT is updated according to the second update parameter.
[0203] In this embodiment, the first update parameter target value corresponding to the grid point to be updated is determined by fitting the first function relationship using the least squares method, thereby optimizing the grid point to be updated and realizing the local optimization of the preset 3D LUT. The second update parameter target value corresponding to the target 3D LUT is determined by fitting the second function relationship using the least squares method, thereby optimizing the target 3D LUT and realizing the global optimization of the target LUT. It is simple to debug, convenient to operate, reduces labor costs, and is applicable to 3D LUTs with different precision, different target color data, and different image processing workflows. It has versatility and flexibility, improves the smoothness of the 3D LUT, and reduces noise.
[0204] Example 3
[0205] This embodiment provides a color correction method, which includes:
[0206] The actual color data is input into the target 3D LUT for color correction, and the corrected color data is output.
[0207] The target 3D LUT is obtained based on the 3D LUT update method described in Example 1 or Example 2.
[0208] In addition, Target 3D LUTs can be used in devices and products that use cameras for shooting and previewing, such as mobile phones, industrial cameras, network cameras, tablet computer cameras, game console cameras, video smartwatches, security cameras, and camera modules. They can also be used in video image processing, rendering, and filtering software such as Photoshop (an image processing software).
[0209] In this embodiment, the actual color data is input into the target 3D LUT for color correction, and the corrected color data is output. This reduces the error between the output corrected color data and the target color data, ensuring the accuracy and reliability of the output corrected color data. The debugging is simple, the operation is convenient, and the labor cost is reduced.
[0210] The subject executing the color correction method provided in this embodiment can be a separate chip, chip module, or electronic device, or it can be a chip or chip module integrated into an electronic device.
[0211] Example 4
[0212] This embodiment provides a 3D LUT update system, such as Figure 7 As shown, the update system includes:
[0213] Grid point acquisition module 11 is used to acquire grid points to be updated in a preset 3D LUT;
[0214] Target data acquisition module 12 is used to acquire the target color pair dataset corresponding to the grid points to be updated;
[0215] The weight determination module 13 is used to determine the weight of each color pair in the target color pair dataset.
[0216] Each color pair data includes the color data to be debugged and the target color data corresponding to the color data to be debugged;
[0217] The first parameter determination module 14 is used to determine the first update parameter target value corresponding to the grid point to be updated based on the pre-established first mapping relationship and the first color difference target value.
[0218] The first mapping relationship is the mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated. The first color difference is the color difference between the color data to be debugged and the target color data.
[0219] The first update module 15 is used to update the grid points to be updated based on the target value of the first update parameter, so as to update the preset 3D LUT to the target 3D LUT.
[0220] The 3D LUT update system of this embodiment is used to implement the 3D LUT update method of Embodiment 1.
[0221] In this embodiment, by establishing a first mapping relationship between the first color difference between the color data to be debugged and the target color data and the first update parameter of the grid point to be updated, the target value of the first update parameter corresponding to the grid point to be updated is determined, thereby updating the grid point to be updated to update the preset 3D LUT to the target 3D LUT. The debugging is simple and convenient, reducing labor costs. It is applicable to 3D LUTs of different precision, different target color data and different image processing processes, and has versatility and flexibility. It improves the smoothness of the 3D LUT and reduces noise.
[0222] The 3D LUT update system described in the embodiments can be a separate chip, chip module, or electronic device, or it can be a chip or chip module integrated into an electronic device. The various modules / units included in the 3D LUT update system can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices or products applied to or integrated into a chip, all of its modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs running on a processor integrated within the chip, while the remaining modules / units can be implemented using hardware methods such as circuits. Similarly, for various devices or products applied to or integrated into a chip module, all of its modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into electronic devices, all of their components can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the electronic device, while the remaining modules / units can be implemented using hardware methods such as circuits.
[0223] Example 5
[0224] This embodiment provides a 3D LUT update system, which is a further improvement on embodiment 4.
[0225] In a feasible solution, such as Figure 8 As shown, the target data acquisition module 12 includes:
[0226] The image data acquisition unit 121 is used to acquire a plurality of image data to be debugged and a plurality of target image data corresponding to the image data to be debugged;
[0227] The initial data construction unit 122 is used to construct an initial color pair dataset based on the image data to be debugged and the target image data;
[0228] Distance acquisition unit 123 is used to acquire the Euclidean distance between the color value of the grid point to be updated and each color data to be debugged in the initial color pair dataset;
[0229] The target data construction unit 124 is used to select a preset number of color pairs from the initial color pair dataset based on Euclidean distance to construct the target color pair dataset.
[0230] In one feasible approach, each image data to be debugged includes the mean and standard deviation of the color values of several pixels in the image to be debugged;
[0231] The initial data construction unit 122 includes:
[0232] Comparison subunit 1221 is used to compare the standard deviation of each image data to be debugged with the first threshold respectively;
[0233] The first response subunit 1222 is used to respond to the fact that the standard deviation of all the image data to be debugged is less than or equal to the first threshold, take the mean of the image data to be debugged as the first color data to be debugged, construct a first color pair dataset based on the first color data to be debugged and the first target color data in the target image data corresponding to the first color data to be debugged, and take the first color pair dataset as the initial color pair dataset.
[0234] The second response subunit 1223 is used to respond to the fact that the standard deviation of all the image data to be debugged is greater than the first threshold, take the mean of the image data to be debugged as the second color data to be debugged, construct a second color pair dataset based on the second color data to be debugged and the second target color data in the target image data that corresponds to the second color data to be debugged, and perform noise reduction processing on the second color pair dataset based on the clustering algorithm to obtain the initial color pair dataset.
[0235] The third response subunit 1224 is used to respond to the fact that some standard deviations of the image data to be debugged are less than or equal to a first threshold and some standard deviations are greater than the first threshold. It takes the mean of the image data to be debugged with a standard deviation less than or equal to the first threshold as the third color data to be debugged, constructs a third color pair dataset based on the third color data to be debugged and the third target color data in the target image data that corresponds to the third color data to be debugged, takes the mean of the image data to be debugged with a standard deviation greater than the first threshold as the fourth color data to be debugged, constructs a fourth color pair dataset based on the fourth color data to be debugged and the fourth target color data in the target image data that corresponds to the fourth color data to be debugged, performs denoising processing on the fourth color pair dataset based on a clustering algorithm, and constructs an initial color pair dataset based on the third color pair dataset and the denoised fourth color pair dataset.
[0236] In one feasible embodiment, the target data acquisition module 12 further includes:
[0237] The quantity acquisition unit 125 is used to acquire the number of color pairs corresponding to each sub-cube obtained by segmenting the preset 3D LUT based on the initial color pair dataset.
[0238] Comparison unit 126 is used to compare the quantity with a second threshold;
[0239] The first response unit 127 is used to call the distance acquisition unit 123 in response to a quantity being greater than or equal to the second threshold.
[0240] The second response unit 128 is used to call the image data acquisition unit 121 in response to the quantity being less than the second threshold, so as to acquire new image data to be debugged and corresponding new target image data.
[0241] In one feasible embodiment, the target data construction unit 124 is further configured to select a preset number of color pairs from the initial color pair dataset whose Euclidean distance is less than a preset distance or whose Euclidean distance is the smallest, in order to construct the target color pair dataset.
[0242] In a feasible solution, the weight determination module 13 uses the following calculation formula:
[0243] w(d t )=(d t p +e) -1
[0244] Where p and e are parameters, t represents the t-th color pair data, and d t w(d) represents the Euclidean distance between the t-th color pairs and the data. t ) represents the weight of the t-th color pair in the data.
[0245] In one feasible scheme, the first mapping relationship is a first functional relationship between the first color difference and the first update parameter established by the least squares method;
[0246] The first parameter determination module 14 is also used to determine the first update parameter target value based on the first functional relationship in response to the first color difference target value being the minimum value among the first color differences.
[0247] In a feasible solution, the calculation formula corresponding to the first functional relationship is as follows:
[0248]
[0249] Where n represents the number of color pairs in the target color pair dataset, reft represents the t-th target color data, srct represents the t-th color data to be debugged, A represents the first update parameter, and y represents the first color difference.
[0250] In one feasible solution, the update system also includes:
[0251] The debug data acquisition module 16 is used to input the color data to be debugged in the initial color pair dataset into the target 3D LUT to obtain the debugged color data;
[0252] The second parameter determination module 17 is used to determine the corresponding second update parameter target value of the target 3D LUT based on the pre-established second mapping relationship and the second color difference target value.
[0253] The second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT. The second color difference is the color difference between the target color data corresponding to the debugged color data in the debugged color data and the initial color pair dataset.
[0254] The second update module 18 is used to update the target 3D LUT based on the target value of the second update parameter.
[0255] In one feasible scheme, the second mapping relationship is a second functional relationship between the second color difference and the second update parameter established by the least squares method;
[0256] The second parameter determination module 17 is also used to determine the second update parameter target value based on the second functional relationship in response to the second color difference target value being the minimum value among the second color differences.
[0257] In a feasible solution, the calculation formula corresponding to the second functional relationship is as follows:
[0258]
[0259] Where i represents the i-th color pair data, m represents the number of color pairs data in the initial color pair dataset, refi represents the i-th target color data, srci represents the i-th debugged color data, B represents the second update parameter, and z represents the second color difference.
[0260] In one feasible scheme, the second mapping relationship is a mapping relationship established based on the debugged color data after color space conversion and the target color data corresponding to the debugged color data in the initial color pair dataset.
[0261] The 3D LUT update system of this embodiment is used to implement the 3D LUT update method of embodiment 2.
[0262] In this embodiment, the first update parameter target value corresponding to the grid point to be updated is determined by fitting the first function relationship using the least squares method, thereby optimizing the grid point to be updated and realizing the local optimization of the preset 3D LUT. The second update parameter target value corresponding to the target 3D LUT is determined by fitting the second function relationship using the least squares method, thereby optimizing the target 3D LUT and realizing the global optimization of the target LUT. It is simple to debug, convenient to operate, reduces labor costs, and is applicable to 3D LUTs with different precision, different target color data, and different image processing workflows. It has versatility and flexibility, improves the smoothness of the 3D LUT, and reduces noise.
[0263] Example 6
[0264] This embodiment provides a color correction system, which includes:
[0265] The calibration module is used to input the actual color data into the target 3D LUT for color calibration, and output the calibrated color data.
[0266] The target 3D LUT is obtained based on the 3D LUT update system described in Embodiment 4 or Embodiment 5.
[0267] The color correction system in this embodiment is used to implement the color correction method in Embodiment 3.
[0268] In this embodiment, the actual color data is input into the target 3D LUT for color correction, and the corrected color data is output. This reduces the error between the output corrected color data and the target color data, ensuring the accuracy and reliability of the output corrected color data. The debugging is simple, the operation is convenient, and the labor cost is reduced.
[0269] Example 7
[0270] like Figure 9 The diagram shown is a structural schematic of an electronic device provided in Embodiment 7 of this disclosure. It includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the 3D LUT update method or color correction method as described in the above embodiments. Figure 9 The electronic device 90 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.
[0271] The electronic device 90 may be in the form of a general-purpose computing device, such as a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including memory 92 and processor 91).
[0272] Bus 93 includes a data bus, an address bus, and a control bus.
[0273] The memory 92 may include volatile memory, such as random access memory (RAM) 921 and / or cache memory 922, and may further include read-only memory (ROM) 923.
[0274] The memory 92 may also include a program / utility 925 having a set (at least one) of program modules 924, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0275] The processor 91 executes various functional applications and data processing by running computer programs stored in the memory 92, such as the 3D LUT update method or color correction method in the above embodiments of this disclosure.
[0276] Electronic device 90 can also communicate with one or more external devices 94 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 95. Furthermore, the model-generated electronic device 90 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public network, such as the Internet) via network adapter 96. As shown, network adapter 96 communicates with other modules of the model-generated electronic device 90 via bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0277] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.
[0278] Example 8
[0279] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the 3D LUT update method or color correction method as described in the above embodiment.
[0280] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.
[0281] In possible implementations, this disclosure can also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to execute an update method or color correction method for the 3D LUT as described in the above embodiments.
[0282] The program code for executing this disclosure can be written in any combination of one or more programming languages. The program code can be executed entirely on a user device, partially on a user device, as a standalone software package, partially on a user device and partially on a remote device, or entirely on a remote device.
[0283] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.
Claims
1. A method for updating a 3D LUT, characterized in that, The update method includes: Obtain the grid points to be updated in the preset 3D LUT; Obtain the target color pair dataset corresponding to the grid point to be updated, and determine the weight of each color pair in the target color pair dataset; The step of obtaining the target color pair dataset corresponding to the grid point to be updated includes: Acquire several image data to be debugged and several target image data corresponding to the image data to be debugged; An initial color pair dataset is constructed based on the image data to be debugged and the target image data; Obtain the Euclidean distance between the color value of the grid point to be updated and each color data to be debugged in the initial color pair dataset; Based on the Euclidean distance, a preset number of color pairs are selected from the initial color pair dataset to construct the target color pair dataset; Each color pair data includes color data to be debugged and target color data corresponding to the color data to be debugged; Based on the pre-established first mapping relationship and the first color difference target value, determine the first update parameter target value corresponding to the grid point to be updated; Wherein, the first mapping relationship is a mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated, and the first color difference is the color difference between the color data to be debugged and the target color data; The grid points to be updated are updated based on the first update parameter target value to update the preset 3D LUT to the target 3D LUT; The calculation formula for determining the weight of each color pair in the target color pair dataset is as follows: Where p and e are parameters, and t represents the t-th color pair data. This represents the Euclidean distance corresponding to the t-th color pair data. This represents the weight corresponding to the t-th color pair of data; The color data to be debugged in the initial color pair dataset is input into the target 3D LUT to obtain the debugged color data; Based on the pre-established second mapping relationship and the second color difference target value, the corresponding second update parameter target value of the target 3D LUT is determined; Wherein, the second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT, and the second color difference is the color difference between the debugged color data and the target color data corresponding to the debugged color data in the initial color pair dataset; The target 3D LUT is updated based on the target value of the second update parameter.
2. The 3D LUT update method as described in claim 1, characterized in that, Each of the image data to be debugged includes the mean and standard deviation of the color values of several pixels in the image to be debugged; The step of constructing an initial color pair dataset based on the image data to be debugged and the target image data includes: The standard deviation of each image data to be debugged is compared with the first threshold. In response to the fact that the standard deviation of all the image data to be debugged is less than or equal to the first threshold, the mean of the image data to be debugged is used as the first color data to be debugged, and a first color pair dataset is constructed based on the first color data to be debugged and the first target color data in the target image data corresponding to the first color data to be debugged, and the first color pair dataset is used as the initial color pair dataset. In response to the fact that the standard deviation of all the image data to be debugged is greater than the first threshold, the mean of the image data to be debugged is used as the second color data to be debugged. A second color pair dataset is constructed based on the second color data to be debugged and the second target color data in the target image data that corresponds to the second color data to be debugged. The second color pair dataset is then denoised based on a clustering algorithm to obtain the initial color pair dataset. In response to a partial standard deviation of the image data to be debugged being less than or equal to the first threshold and a partial standard deviation being greater than the first threshold, the mean of the image data to be debugged with a standard deviation less than or equal to the first threshold is used as the third color data to be debugged. A third color pair dataset is constructed based on the third color data to be debugged and the third target color data in the target image data that corresponds to the third color data to be debugged. The mean of the image data to be debugged with a standard deviation greater than the first threshold is used as the fourth color data to be debugged. A fourth color pair dataset is constructed based on the fourth color data to be debugged and the fourth target color data in the target image data that corresponds to the fourth color data to be debugged. The fourth color pair dataset is denoised based on a clustering algorithm. The initial color pair dataset is constructed based on the third color pair dataset and the denoised fourth color pair dataset.
3. The 3D LUT update method as described in claim 1, characterized in that, Before the step of obtaining the Euclidean distance between the color value of the grid point to be updated and each of the color data to be debugged in the initial color pair dataset, the method further includes: Based on the initial color pair dataset, obtain the number of color pairs corresponding to each sub-cube obtained by segmenting the preset 3D LUT; The quantity is compared with a second threshold; In response to the quantity being greater than or equal to the second threshold, the step of obtaining the Euclidean distance between the color value of the grid point to be updated and each of the color data to be debugged in the initial color pair dataset is performed; In response to the quantity being less than the second threshold, the step of obtaining a plurality of image data to be debugged and a plurality of target image data corresponding to the image data to be debugged is returned to obtain new image data to be debugged and corresponding new target image data; And / or, The step of selecting a preset number of color pairs from the initial color pair dataset based on the Euclidean distance to construct the target color pair dataset includes: The target color pair dataset is constructed by selecting a preset number of color pairs from the initial color pair dataset whose Euclidean distance is less than a preset distance or whose Euclidean distance is the smallest.
4. The 3D LUT update method as described in claim 1, characterized in that, The first mapping relationship is a first functional relationship between the first color difference and the first update parameter established by the least squares method; The step of determining the target value of the first update parameter corresponding to the grid point to be updated based on the pre-established first mapping relationship and the first color difference target value includes: In response to the first color difference target value being the minimum value among the first color differences, the first update parameter target value is determined based on the first functional relationship.
5. The 3D LUT update method as described in claim 4, characterized in that, The calculation formula corresponding to the first functional relationship is as follows: Where n represents the number of color pairs in the target color pair dataset. This represents the color data of the t-th target. Let t represent the t-th color data to be debugged, A represent the first update parameter, and y represent the first color difference.
6. The 3D LUT update method as described in claim 1, characterized in that, The second mapping relationship is a second functional relationship between the second color difference and the second update parameter established using the least squares method; The step of determining the corresponding second update parameter target value of the target 3D LUT based on the pre-established second mapping relationship and the second color difference target value includes: In response to the second color difference target value being the minimum value among the second color differences, the second update parameter target value is determined based on the second functional relationship.
7. The 3D LUT update method as described in claim 6, characterized in that, The calculation formula corresponding to the second functional relationship is as follows: Where i represents the i-th color pair data, and m represents the number of color pairs data in the initial color pair dataset. This represents the color data of the i-th target. Let B represent the i-th adjusted color data, B represent the second update parameter, and z represent the second color difference.
8. The 3D LUT update method as described in claim 1, characterized in that, The second mapping relationship is a mapping relationship established based on the debugged color data after color space conversion and the target color data corresponding to the debugged color data in the initial color pair dataset.
9. A color correction method, characterized in that, The color correction method includes: The actual color data is input into the target 3D LUT for color correction, and the corrected color data is output. The target 3D LUT is obtained based on the 3D LUT update method according to any one of claims 1-8.
10. A 3D LUT update system, characterized in that, The update system includes: The grid acquisition module is used to acquire the grid points to be updated in the preset 3D LUT; The target data acquisition module is used to acquire the target color pair dataset corresponding to the grid point to be updated; The weight determination module is used to determine the weight corresponding to each color pair in the target color pair dataset. The target data acquisition module includes: An image data acquisition unit is used to acquire several image data to be debugged and several target image data corresponding to the image data to be debugged; An initial data construction unit is used to construct an initial color pair dataset based on the image data to be debugged and the target image data; The distance acquisition unit is used to acquire the Euclidean distance between the color value of the grid point to be updated and each color data to be debugged in the initial color pair dataset. The target data construction unit is used to select a preset number of color pairs from the initial color pair dataset based on the Euclidean distance to construct the target color pair dataset. Each color pair data includes color data to be debugged and target color data corresponding to the color data to be debugged; The first parameter determination module is used to determine the first update parameter target value corresponding to the grid point to be updated based on the pre-established first mapping relationship and the first color difference target value. Wherein, the first mapping relationship is a mapping relationship between the first color difference established based on the color data to be debugged, the target color data, and the weight, and the first update parameter of the grid point to be updated, and the first color difference is the color difference between the color data to be debugged and the target color data; The first update module is used to update the grid points to be updated based on the target value of the first update parameter, so as to update the preset 3D LUT to the target 3D LUT; The weight determination module uses the following calculation formula: Where p and e are parameters, and t represents the t-th color pair data. This represents the Euclidean distance corresponding to the t-th color pair data. This represents the weight corresponding to the t-th color pair of data; The debugging data acquisition module is used to input the color data to be debugged in the initial color pair dataset into the target 3D LUT to obtain the debugged color data; The second parameter determination module is used to determine the corresponding second update parameter target value of the target 3D LUT based on the pre-established second mapping relationship and the second color difference target value. Wherein, the second mapping relationship is the mapping relationship between the second color difference and the second update parameter of the target 3D LUT, and the second color difference is the color difference between the debugged color data and the target color data corresponding to the debugged color data in the initial color pair dataset; The second update module is used to update the target 3D LUT based on the target value of the second update parameter.
11. A color correction system, characterized in that, The color correction system includes: A correction module is used to input actual color data into a target 3D LUT for color correction and output corrected color data, wherein the target 3D LUT is obtained based on the 3D LUT update system of claim 10.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes the computer program, it implements the 3D LUT update method as described in any one of claims 1-8, or implements the color correction method as described in claim 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the 3D LUT update method as described in any one of claims 1-8, or the color correction method as described in claim 9.
14. A chip, characterized in that, The chip stores a computer program, which, when executed by the chip, implements the 3D LUT update method as described in any one of claims 1-8, or the color correction method as described in claim 9.
15. A chip module, used in electronic devices, characterized in that, It includes a transceiver component and a chip, said chip being used to implement the 3D LUT update method as described in any one of claims 1-8, or to implement the color correction method as described in claim 9.
Citation Information
Patent Citations
Model training method, color difference correction method and device, medium and electronic equipment
CN109903256A
Color correction method and device and related equipment
CN116614723A
Color processing method and apparatus thereof
JP2007028426A
