Color correction method adopting residual correction

By introducing residual correction and Gamma correction on the basis of the color correction matrix, the problem of insufficient specific color accuracy in the imaging system is solved, and high-precision color reduction and brightness adaptation in high-demand scenes such as endoscopes are realized.

CN120302169AActive Publication Date: 2025-07-11BEIJING JIANWEI ZHISHI TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510466971.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-11
Estimated Expiration
2045-04-15

AI Technical Summary

Technical Problem

Existing imaging systems have problems with insufficient accuracy in specific color correction, especially in high-demand scenarios such as endoscopes, which are difficult to achieve accurate restoration of pathological colors.

Method used

Using the residual correction method, a residual correction table is generated by constructing the residual space and performing three-dimensional Gaussian filtering and downsampling, and the color value after the color correction matrix is further corrected, and the brightness response curve is adjusted in combination with Gamma correction to adapt to the characteristics of the display device.

Benefits of technology

It improves the conversion accuracy of specific colors, reduces the reduction error of pathological colors, enhances the reliability of diagnosis, and adapts to the brightness characteristics of different display devices, avoiding details loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005358775770000031
    Figure BDA0005358775770000031
  • Figure BDA0005358775770000061
    Figure BDA0005358775770000061
  • Figure FDA0005358775760000011
    Figure FDA0005358775760000011
Patent Text Reader

Abstract

The invention discloses a color correction method adopting residual correction. The method comprises the following steps: S1, inputting an image: inputting the image shot by a camera into processing equipment; s2, obtaining a color correction matrix: converting an RGB color space of the input image into a standard color space, such as sRGB and DCI-P3; s3, residual error correction: based on a preset specific color sample set, calculating a residual error between the color value corrected by the color correction matrix and a corresponding standard color value, constructing a residual error space, carrying out three-dimensional Gaussian filtering and downsampling processing on the residual error space, and carrying out residual error correction on the color value corrected by the color correction matrix according to a residual error correction table; and S4, Gamma correction: converting the RGB value of the linear color space into a nonlinear display value. The method is more suitable for color correction of special occasions (imaging of an endoscope), a residual correction (RC) link is added on the basis of a color correction matrix (CCM), the conversion precision of specific colors can be improved, and the overall precision can be guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and particularly to a color correction method using residual correction. Background Art

[0002] The purpose of color correction of imaging devices is to convert the acquired color data from the device - related color space to a device - independent standard color space. The standard color space provides a unified reference for the encoding of colors. By sending the image data that conforms to the standard to a display that supports the corresponding standard, the color restoration display can be achieved. Currently, widely used color standards include sRGB, P3, etc.

[0003] In the prior art, the Chinese patent with the application number CN202411243541.7 discloses a color correction method, and specifically proposes a device, a system, and a technique for performing color correction. It can identify a color mapping model that maps colors within a subspace around a target color in an input color space to an adjusted color space and is applied to an input image to adjust the values of one or more pixels of the input image that fall within the subspace. The color mapping model can be initialized to map colors within a subspace around a target color in the input color space to an adjusted color space, and at least one parameter of the color mapping model can be adjusted to reduce the amount of visible artifacts generated by the color mapping model.

[0004] Again, in the prior art, the Chinese patent with the application number CN202410235570.2 discloses a color correction method and a color correction device. The color correction method includes respectively displaying a source image sequence on at least one display device; the source image sequence includes an identification code determined based on the display device on which the source image sequence is displayed and the background color of the source image sequence; simultaneously collecting the content displayed on at least one display device by an observation device to obtain an observation image sequence; based on the identification code and the observation image sequence, constructing a correspondence relationship between the first color included in the source image sequence and the second color included in the observation image sequence; based on the correspondence relationship, constructing a color lookup table corresponding to each display device, which can improve the accuracy and precision of the finally obtained color lookup table; and can achieve color calibration for multiple screens simultaneously, improving the automation degree of multi - screen color calibration and the consistency effect of multi - screen color calibration.

[0005] For another example, in the prior art, a Chinese patent with the application number CN201010548055.8 discloses a color correction method, including generating at least one color correction curve on each primary color channel and / or generating at least one color correction curve on the channel mixing each primary color according to a configuration file generated by a user writing node; using at least one of the color correction curves to correct the color values of pixels in a page, a generation module for generating at least one color correction curve on each primary color channel and / or generating at least one color correction curve on the channel mixing each primary color according to a configuration file generated by a user writing node; and a correction module for using at least one of the color correction curves to correct the color values of pixels in a page.

[0006] The most widely used color correction method is to use a color correction matrix CCM, which is usually a 3*3 matrix and can convert color data to the linear domain sRGB. Usually, the calibration method of CCM is as follows: select a specific number of color cards as samples; photograph the color cards under a specific light source to obtain the RGB response values of the camera; calculate the sRGB values of the color cards under this light source; and use an optimization method, such as the least squares method, to obtain the CCM that minimizes the overall sample conversion error.

[0007] In some usage scenarios involving feature recognition, people often have extremely high requirements for the accuracy of the imaging system regarding specific colors. For example, in the usage scenario of an endoscope, the user requires the endoscope to accurately restore the colors of certain pathological features. Since CCM is obtained through an optimization method, whose principle is to minimize the conversion error of the overall sample, it is difficult to guarantee for specific colors. Therefore, it is necessary to study a method to improve the conversion accuracy of specific colors based on CCM. Summary of the Invention

[0008] The purpose of the present invention is to provide a color correction method using residual correction to solve the problem of incomplete detection range proposed in the above background technology.

[0009] To achieve the above purpose, the present invention provides the following technical solution: a color correction method using residual correction, including the following steps:

[0010] S1. Input image: Input the image captured by the camera into the processing device;

[0011] S2. Color correction matrix: Convert the RGB color space of the input image to a standard color space, such as sRGB, DCI-P3;

[0012] S3. Residual correction: Based on a preset specific color sample set, calculate the residual between the color value after correction by the color correction matrix and the corresponding standard color value, construct a residual space, perform three-dimensional Gaussian filtering and downsampling on the residual space to generate a residual correction table, and perform residual correction on the color value after correction by the color correction matrix according to the residual correction table to obtain the final color correction result;

[0013] S4. Gamma correction: Convert the RGB values in the linear color space to non-linear display values to adapt to the brightness response curve of the display device.

[0014] Preferably, there are m specific color samples in the input image in S1, the color value after correction by the color matrix is Cccm(i) = [Rccm(i), Gccm(i), Bccm(i)], i = 1, 2,..., m, and the corresponding standard color value of the specific color sample is Cref(i) = [Rref(i), Gref(i), Bref(i)], i = 1, 2,..., m.

[0015] Preferably, use the R, G, and B channel values in the color space after correction by the color correction matrix as the spatial coordinate axes to define the residual spaces of its R, G, and B channels.

[0016] Preferably, the formula for the residual space is:

[0017]

[0018] Preferably, calculate the residual values for all m specific color patches to obtain the distribution of the residuals in the residual space, use these points as samples to fill the entire residual space, use nearest-neighbor interpolation for the points near the samples to obtain a piecewise residual space, and apply three-dimensional Gaussian filtering to the residual space considering the number of samples and the smoothness of the residuals to obtain the filtered R, G, and B channel residual spaces.

[0019] Preferably, when applying the residual space, sample the values in the residual space to reduce the data volume. Ensure that the m specific color patches are on the sampling grid points. After the color data of the endoscope is corrected by the color correction matrix, obtain the corresponding residual value CRES in the residual space according to the result data. The final color result Cresult is:

[0020] Cresult = Cccm + CRES.

[0021] Preferably, after performing color correction using residual correction, improve the conversion accuracy of specific color samples.

[0022] Preferably, the color correction matrix used in S2 is a 3*3 matrix. In S3, the residual correction uses the ColorChecker color card as the color sample. There are 24 color samples in total. For each sample, the residuals in the three RGB channels are calculated to obtain the residual spaces of the three channels.

[0023] Preferably, three-dimensional Gaussian filtering is applied to the residual spaces of the three channels respectively, and downsampling is performed according to 17*17*17 respectively. Then, 24 sample points are added to obtain the residual correction table applied to the imaging system.

[0024] Preferably, the color values after the color correction matrix are further corrected by the residual correction table to improve the color correction accuracy.

[0025] Compared with the prior art, the beneficial effects of the present invention are as follows: The color correction method using residual correction adopts a novel structural design, and the specific content is as follows:

[0026] 1. This method is more suitable for color correction in special occasions (such as endoscope imaging). On the basis of the color correction matrix (CCM), a residual correction (RC) link is added, which can not only improve the conversion accuracy of specific colors but also ensure the overall accuracy.

[0027] 2. The global linear transformation of the color correction matrix (CCM) converts the device-related RGB color space into a standard color space (such as sRGB, DCI-P3), eliminates the inherent color deviation of the device, and optimizes the CCM parameters by the least squares method to ensure the minimization of the overall color conversion error. It is applicable to a wide range of scenarios and meets the general color restoration requirements.

[0028] 3. The residual correction (RC) performs local compensation for key colors, further reduces the restoration error of pathological colors (such as abnormal tissue colors), improves the diagnostic reliability. By calculating the difference between the color after CCM correction and the standard value, a three-dimensional residual space is established to retain the compensation information of specific colors. Using three-dimensional linear interpolation or nearest neighbor interpolation, the residual compensation value of the current pixel is calculated in real time to ensure the local color accuracy, supports the addition of specific color samples (such as new pathological colors collected during surgery), and dynamically updates the residual correction table to enhance adaptability.

[0029] 4. Gamma correction adjusts the brightness response curve through a power function or a predefined LUT to adapt to the brightness characteristics of the display device, ensuring that the image is presented on the display in line with the non-linear perception of human eyes for brightness, avoiding the loss of details caused by overexposure or underexposure, and supporting Gamma curves of multiple standard color spaces (such as sRGB, P3) to adapt to different display devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1This is the overall process system block diagram of the present invention. Detailed implementation manners

[0031] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0032] Embodiment 1: Please refer to Figure 1 , the present invention provides the following technical solution: A color correction method using residual correction, including the following steps:

[0033] S1. Input image: Input the image captured by the endoscope into the processing device;

[0034] S2. Color correction matrix: Convert the RGB color space of the input image into a standard color space, such as sRGB, DCI-P3;

[0035] S3. Residual correction: Based on a preset specific color sample set, calculate the residual between the color value corrected by the color correction matrix and the corresponding standard color value, construct a residual space, perform three-dimensional Gaussian filtering and downsampling processing on the residual space to generate a residual correction table, and perform residual correction on the color value corrected by the color correction matrix according to the residual correction table to obtain the final color correction result;

[0036] S4. Gamma correction: Convert the RGB values in the linear color space into non-linear display values to adapt to the brightness response curve of the display device.

[0037] The specific color samples of the input image in S1 are m, the color values corrected by the color matrix are Cccm(i) = [Rccm(i), Gccm(i), Bccm(i)], i = 1, 2,..., m, and the corresponding standard color values of the specific color samples are Cref(i) = [Rref(i), Gref(i), Bref(i)], i = 1, 2,..., m.

[0038] Define the residual space of the R, G, and B channels with the R, G, and B channel values in the color space corrected by the color correction matrix as the space coordinate axes.

[0039] The formula for the residual space is:

[0040]

[0041] Residual values are obtained for all m specific color patches, and the distribution of the residuals in the residual space is obtained. These points are used as samples to fill the entire residual space. The nearest neighbor interpolation is used for the points near the samples to obtain a segmented residual space. Considering the number of samples and the smoothness of the residuals, a three-dimensional Gaussian filter is applied to the residual space to obtain the filtered residual spaces of the R, G, and B channels.

[0042] When applying the residual space, the values in the residual space are sampled to reduce the amount of data. The m specific color patches are guaranteed to be on the sampling grid points. After the color data of the endoscope is corrected by the color correction matrix, the corresponding residual value CRES in the residual space is obtained according to the result data. The final color result Cresult is:

[0043] Cresult = Cccm + CRES.

[0044] After color correction using residual correction, the conversion accuracy for specific color samples is improved.

[0045] The color correction matrix in S2 uses a 3*3 matrix. In S3, residual correction uses the ColorChecker color card as color samples. There are a total of 24 color samples. The residuals in the three RGB channels are calculated for each sample to obtain the residual spaces of the three channels.

[0046] Three-dimensional Gaussian filtering is applied to the residual spaces of the three channels respectively, and each is downsampled according to 17*17*17, and then 24 sample points are added to obtain a residual correction table applied to the imaging system.

[0047] The color values after the color correction matrix are further corrected by the residual correction table to improve the color correction accuracy.

[0048] Example 2: In endoscopic surgery, it is necessary to accurately restore the colors of pathological tissues (such as bleeding red and lesion yellow). In this example, residual correction is integrated into the endoscopic imaging system. The specific real-time steps are as follows:

[0049] System hardware configuration (equipment)

[0050] Endoscopic camera (resolution 4K, frame rate 60fps), FPGA acceleration module (for real-time CCM and residual compensation calculations), medical-grade monitor (supporting DCI-P3 color gamut).

[0051] Color correction process

[0052] CCM pre-calibration:

[0053] Under the endoscopic dedicated light source, a color card containing pathological color samples (such as a 24-color card + 10 pathological color samples) is photographed, and a dedicated CCM matrix is calibrated and stored in the FPGA;

[0054] Dynamic update of the residual table:

[0055] During the operation, new pathological color samples (such as the RGB values of the bleeding area collected in real time) are added, the residual space is recalculated, and the residual correction table is updated (trigger condition: the ΔE of the new sample > 3);

[0056] Real-time processing:

[0057] The FPGA performs CCM correction on each frame of image (delay < 1ms), queries the residual table according to the CCM result, preferentially compensates the pathological color area (such as increasing the weight of the red channel by 50%), and highlights the lesion area (such as superimposing a red contour);

[0058] Gamma adaptation:

[0059] Adjust the output brightness according to the monitor characteristics (DCI-P3 Gamma curve).

[0060] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A color correction method using residual correction, characterized in that Including the following steps: S1. Input image: Input the image captured by the camera into the processing device; S2. Color correction matrix: Convert the RGB color space of the input image into a standard color space, such as sRGB, DCI-P3; S3. Residual correction: Based on a preset specific color sample set, calculate the residual between the color value corrected by the color correction matrix and the corresponding standard color value, construct a residual space, perform three-dimensional Gaussian filtering and downsampling on the residual space to generate a residual correction table, and perform residual correction on the color value corrected by the color correction matrix according to the residual correction table to obtain the final color correction result; S4. Gamma correction: Convert the RGB values in the linear color space into non-linear display values to adapt to the brightness response curve of the display device.

2. The color correction method using residual correction according to claim 1, wherein: In S1, there are m specific color samples in the input image. The color value after correction by the color matrix is Cccm(i) = [Rccm(i), Gccm(i), Bccm(i)], i = 1, 2,..., m, and the standard color value corresponding to the specific color sample is Cref(i) = [Rref(i), Gref(i), Bref(i)], i = 1, 2,..., m.

3. A color correction method using residual correction according to claim 2, characterized in that: Define the residual space of the R, G, and B channels with the R, G, and B channel values in the color space corrected by the color correction matrix as the space coordinate axes.

4. A color correction method using residual correction according to claim 3, characterized in that: The formula for the residual space is:

5. A color correction method using residual correction according to claim 4, characterized in that: Obtain the residual values for all m specific color patches, get the distribution of the residuals in the residual space, use these points as samples to fill the entire residual space, perform nearest neighbor interpolation on the points near the samples to obtain a piecewise residual space, and apply three-dimensional Gaussian filtering to the residual space considering the number of samples and the smoothness of the residuals to obtain the filtered R, G, and B channel residual spaces.

6. A color correction method using residual correction according to claim 5, characterized in that: When applying the residual space, sample the values in the residual space to reduce the data volume. Ensure that the m specific color patches are on the sampling grid points. After the color data of the endoscope is corrected by the color correction matrix, obtain the residual value CRES in the corresponding residual space according to the result data. The final color result Cresult is: C result =C ccm +C RES。 7. A color correction method using residual correction according to claim 6, characterized in that: After using residual correction for color correction, improve the conversion accuracy of specific color samples.

8. A color correction method using residual correction according to claim 1, characterized in that: In S2, the color correction matrix used is a 3*3 matrix. In S3, the residual correction uses the ColorChecker color card as the color sample, with a total of 24 color samples. Calculate the residuals of each sample in the three RGB channels to obtain the residual spaces of the three channels.

9. A color correction method using residual correction according to claim 8, characterized in that: Apply three-dimensional Gaussian filtering to the residual spaces of the three channels respectively, and downsample each according to 17*17*17, and then supplement 24 sample points to obtain the residual correction table applied to the imaging system.

10. A color correction method using residual correction according to claim 9, characterized in that: Further correct the color value after the color correction matrix with the residual correction table to improve the color correction accuracy.

Citation Information

Patent Citations

  • Color correction method and device

    CN102469239B

  • Color correction method and color correction device

    CN118314852A

  • Color correction method

    CN119583734A

  • Human face skin color correction method and device, computer equipment and readable storage medium

    CN111583127A

  • Image color correction method and device, computer device and storage medium

    CN113628135A

Cited By

  • Printed matter color correction method

    CN121053227A