An endoscope color correction method based on color offset estimation

CN115345799BActive Publication Date: 2026-10-30ZHEJIANG UE MEDICAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211046427.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2026-10-30
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

本发明解决了光源不均匀性带来的图像偏色问题,校正后的图像更加符合真实颜色

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345799B_ABST
    Figure CN115345799B_ABST
Patent Text Reader

Abstract

The present application provides an endoscope color correction method based on color offset estimation. The method first acquires an image using an endoscope, then estimates the color offset value in the original image, and constructs a color offset component with the same size as the original image using a distance formula. Then, gray scale images under different light source brightnesses at the same distance are acquired, and the R channel in the image is separated. The least square method is used to estimate the illumination surface under different light source brightnesses, and the least square method is used again to fit the illumination surface coefficients under medium light source brightness. The illumination surface fitting formula is used to estimate the illumination surface of the color offset component, and the illumination component is obtained by convolution with the color offset component. The R, G and B channels of the color offset component are respectively subtracted by their illumination components, and gain compensation is performed at the same time, so that the reflection component of the color offset component can be obtained. Finally, the color offset between the color offset component and the reflection component is calculated, the original image is color corrected using the color offset, and finally the color corrected image is obtained. The present application solves the endoscope image color offset problem under different light source brightnesses and different distances while maintaining global consistency, improves the image perception, and the corrected image is more consistent with the human eye observation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical image processing and computer vision, and in particular to an endoscopic color correction method based on color offset estimation. Background Technology

[0002] With the continuous advancement of science and technology, the medical, optical, computer, and electronic fields are becoming increasingly integrated, leading to the maturation of endoscopic technology. Endoscopes have become one of the most widely used medical devices today and an indispensable tool in clinical examination and treatment.

[0003] Due to the application scenarios and requirements of endoscopes, endoscopic images often exhibit brightness shadows and color casts. This is mainly due to certain optical characteristics of the lens and the unevenness of the light source, thus affecting image quality. If we assume the real world is colorless, the color we perceive is the result of the object's own reflective properties and the intensity of light around it. According to the theory of color constancy, objects have their own inherent properties and are not affected by light; an object's ability to reflect different wavelengths of light determines its color. However, in practical applications, it is difficult to obtain a uniform light source, and uneven light sources not only cause brightness shadows but also color deviations.

[0004] One current method for color cast correction is to use the illumination surface of the image, eliminating the illumination surface from the original image to obtain the corrected image. The earliest method for estimating the illumination surface involved convolving a Gaussian function with the original image. However, this method relies on the correlation coefficient of the Gaussian function, and the accuracy of the illumination surface estimation depends on the setting of the Gaussian function coefficients. Furthermore, the processed image is prone to halo effects. Later researchers used least squares methods and polynomials to directly estimate the illumination surface of the image, thereby eliminating the influence of the illumination components in the original image and thus correcting the color cast.

[0005] The inventors discovered that when directly estimating the illumination surface of the original image, the estimation is inaccurate for images with high and low light source brightness, and therefore cannot be applied to images with all light source brightness. The image correction effect is poor under low and high light source brightness. Summary of the Invention

[0006] To address the aforementioned problems, the present invention aims to provide a color correction method for endoscopic images based on color shift estimation. By estimating the color cast value of the original image, a color cast component of equal magnitude to the original image is constructed. The illumination surface coefficients are fitted using a grayscale image under moderate light source brightness to estimate the illumination surface of the color cast component, thereby obtaining the reflection component of the color cast component. The color shift of the image is then calculated using the reflection and color cast components, and color correction is performed on each channel of the image based on the color shift. This invention solves the image color cast problem caused by light source inhomogeneity, resulting in a corrected image that more closely matches the true colors.

[0007] A color correction method for endoscopic images based on color offset estimation specifically includes the following steps:

[0008] Step S1: Acquire images using an endoscope.

[0009] Step S2: For the image in step S1, the pixel values ​​of the R, G and B channels of the image are arranged in reverse order, and the average value of the pixel values ​​within the threshold range is calculated to estimate the color cast value of the image. Based on the distance formula between two points, a color cast component of the same size as the original image is constructed.

[0010] Step S3: For the color cast component in step S2, acquire grayscale images and fit the illumination surface using the least squares method. Then, fit the illumination surface coefficients of the medium light source to the illumination surface coefficient fitting model again using the least squares method to estimate the illumination surface of its color cast component.

[0011] Step S4: Based on the illumination surface in step S3, the illumination component is obtained by convolving it with the color cast component. The illumination component is then subtracted from the R, G, and B channels of the color cast component to obtain the reflection component, and gain compensation is applied to it.

[0012] Step S5: For the reflection component and color cast component in step S4, the difference between the reflection component and the color cast component is used as the color offset. Based on the color offset, the original image is color-corrected using a modified brightness formula to finally obtain the color-corrected image.

[0013] In the above technical solution, the method of acquiring images with an endoscope in step S1 is as follows: in an endoscope-lit, darkroom environment, images of any object are acquired.

[0014] Furthermore, step S2 estimates a color cast component of the same magnitude as the original image based on the distance formula:

[0015]

[0016] g(x, y) = pixel i ×Distance(x,y)(i=R′,G′,B′) (2)

[0017] In equation (1), x0 and y0 are the center points of the image, and Distance(x, y) is the distance from the center point of the image; in equation (2), g(x, y) is the color cast component of the image, where pixel is calculated as follows:

[0018] First, sort the pixel values ​​in the single-channel image in reverse order and set a threshold. Then, sum all pixel values ​​within the threshold range. The formula is as follows:

[0019]

[0020] num=m×n×thr (4)

[0021] In equation (3), sumP is the sum of pixel values, num is the number of pixel values, and f is the original image; in equation (4), m and n are the sizes of the original image, and thr is the threshold, which can be adjusted according to the image. Then, the average of the sum of pixel values ​​in equation (3) can be used to calculate the pixel. i The value.

[0022] Furthermore, in step S3, the specific steps for illuminating the surface are as follows:

[0023] Step S31: Acquire grayscale images under different light source brightness;

[0024] Step S32: Calculate the coefficients of the illuminated surface under different light source brightness;

[0025] Step S33: Fit the illumination surface coefficients using the least squares estimation method;

[0026] Step S34: Estimate the illumination surface of the color cast component.

[0027] Furthermore, step S31 specifically involves: acquiring grayscale images at the same distance with different light source brightness in an active illumination and darkroom environment of the endoscope, acquiring light source brightness images between 0 and 100; and separating the R channel component in the image. Since the R channel component is stronger than other channel components in the endoscope, the R channel component is used for related calculations.

[0028] Furthermore, step S32 specifically involves calculating the coefficients of the illumination surface for the R channel component under different light source brightness levels, as shown in the following formula:

[0029]

[0030] In equation (5), f(x, y) represents the pixel value of the original image, x0 and y0 are the center points of the image, and A and C are the correlation coefficients of the illumination surface. Taking the logarithm of both sides of (1):

[0031] lnf(x, y) = lnA - C × [(x - x0)] 2 +(y-y0) 2 (6)

[0032] The least squares method minimizes the sum of squares of errors between the fitted data and the target data, i.e., minimizes Loss(x, y) in equation (7), thus allowing the calculation of the illumination surface coefficients A and C under different light source brightness. The equations are as follows:

[0033] Loss(x,y)=lnA-C×[(x-x0) 2 +(y—y0) 2 -lnf(x, y) (7)

[0034] Furthermore, in step S32, the illumination surface coefficients of images with medium light source brightness are estimated relatively accurately, while those of images with low and high light source brightness are not. To accurately estimate the illumination surface of the images, least squares fitting is performed based on the illumination surface coefficients of images with medium light source brightness, thereby further accurately estimating the illumination surface of images with all light source brightness.

[0035] Furthermore, step S33 specifically involves establishing the following mathematical model for the illumination surface coefficients A and C of an image with moderate light source brightness:

[0036]

[0037] Q i (x)=D*x 2 +E*x+P(i=A,C) (9)

[0038] In equation (8), α = 0.216, β = 0.7152, and γ = 0.0722 are the values ​​used in Rec.709. These are the average values ​​of the Red, Green, and Blue channels, respectively, and Lum is the brightness of the image; in equation (9), x is the average brightness of the image channel, and Q(x) is the surface coefficient.

[0039] The least squares method minimizes the sum of squares of the errors between the fitted data and the target data, i.e., the Loss in equation (10). i If (x) is minimized, then the coefficients D, E, and P can be calculated. The formula is as follows:

[0040] Loss i (x)=D*x 2 +E*x+P—Q i (x, y)(i = A, C) (10)

[0041] Furthermore, step S34 specifically involves: calculating the illumination surface coefficients A and C of the color cast component using formula (9), thereby estimating the illumination surface of the color cast component.

[0042] Furthermore, in step S4, the illumination component is obtained by convolving the illumination surface with the color cast component, as shown in the following formula:

[0043] L(x, y) = S i (x, y)*Q(x, y)(i=R) (11)

[0044] In Equation (11), L(x, y) is the illumination component of the image, S(x, y) is the R channel component in the color cast component, Q(x, y) is the illumination surface, and * represents convolution.

[0045] Furthermore, by subtracting the illumination component from the R, G, and B channels of the color cast component using the illumination component, the reflection component is obtained, as shown in the following formula:

[0046] g i (x, y) = L(x, y) * Ref i (x, y)(i = R, G, B) (12)

[0047] In equation (12), L(x, y) is the illumination component of the image, g(x, y) is the color cast component, and Ref(x, y) is the reflection component, where * represents the product. Direct calculation is computationally intensive, so we take the logarithm of both sides of the above equation to obtain the following equation:

[0048] ln S i (x, y) = ln L(x, y) + ln Ref i (x, y)(i = R, G, B) (13)

[0049] Therefore, the reflection component can be obtained as:

[0050] Ref i (x, y) = exp(ln g i (x,y)-ln L(x,y))(i=R,G,B) (14)

[0051] Gain compensation is applied to the reflection component, which involves a linear stretching process. The formula is as follows:

[0052]

[0053] Further, in step S5, based on the color cast component and reflection component obtained in step S4, the color offset of the image is obtained, and its formula is as follows:

[0054] r = R Ref -Rg

[0055] g = G Ref —G g (16)

[0056] b = B Ref -B g

[0057] In equation (16), R Ref G Ref and B Ref For the R, G, and B channels of the reflection component, R g G g and B g Let r, g, and b be the R, G, and B channels of the color cast component of the image, where r, g, and b are the color offsets. Then, color correction is performed on the image according to formula (17), which is as follows:

[0058] R out =R in +(1-α)*r-β*g-γ*b

[0059] G out =G in +(1-β)*g-α*r-γ*b (17)

[0060] B out =B in +(1-γ)*b-α*r-β*g

[0061] In formula (17), α=0.216, β=0.7152, γ=0.0722, where R in G in B in The input image consists of R, G, and B channel components. out G out B out To correct the R, G, and B channel components of the image, the three channels are fused to obtain the final color-corrected image.

[0062] Based on the above technical solution, this invention first acquires images using an endoscope, then estimates the color cast value in the original image, and constructs a color cast component of the same size as the original image using a distance formula. Next, grayscale images at the same distance but with different light source brightness are acquired, and the R channel in the image is separated. For the R channel under different light source brightness, the least squares method is used to estimate the illumination surface, and the illumination surface coefficients under medium light source brightness are again fitted using the least squares method. The illumination surface is estimated for the color cast component using the illumination surface fitting formula, and convolved with the color cast component to obtain the illumination component. Then, the illumination component is subtracted from the R, G, and B channels of the color cast component, and gain compensation is performed simultaneously to obtain the reflection component of the color cast component. Finally, the color shift between the color cast component and the reflection component is calculated, and the original image is color-corrected using the color shift, ultimately obtaining a color-corrected image. This method estimates the color cast value in the original image, constructs a color cast component of the same size as the original image using a distance formula, and extracts the distribution of color cast information in the image. Secondly, it establishes an illumination surface coefficient model using grayscale images under medium light source brightness areas, which can more accurately estimate the illumination surface of the image under high and low light source brightness. The color shift is calculated through reflection and color cast components, and the original image is corrected using the color shift. The corrected image is more consistent with what the human eye sees. Attached Figure Description

[0063] Figure 1 This is a schematic diagram of the method flow for implementing the present invention.

[0064] Figure 2 This is the R, G, and B channel diagram for a light source with a brightness of 15.

[0065] Figure 3 This is a graph showing the pixel values ​​of the R, G, and B channels before and after image correction for a light source brightness of 15. Detailed Implementation

[0066] The objectives and technical solutions of the present invention will be described more clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only specific examples of the present invention, but are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the principles and ideas of the present invention should be considered within the reasonable protection scope of the present invention.

[0067] See Figure 1 This is a flowchart illustrating an embodiment of an endoscopic image color correction method provided by the present invention.

[0068] This invention provides an endoscopic color correction technique based on color offset estimation, specifically including the following steps:

[0069] Step S1: Acquire images using an endoscope.

[0070] Step S2: For the image in step S1, the pixel values ​​of the R, G and B channels of the image are arranged in reverse order, and the average value of the pixel values ​​within the threshold range is calculated to estimate the color cast value of the image. Based on the distance formula between two points, a color cast component of the same size as the original image is constructed.

[0071] Step S3: For the color cast component in step S2, acquire grayscale images and fit the illumination surface using the least squares method. Then, fit the illumination surface coefficients of the medium light source using the least squares method again to fit the illumination surface coefficient fitting model and estimate the illumination surface of its color cast component.

[0072] Step S4: Based on the illumination surface in step S3, the illumination component is obtained by convolving it with the color cast component. The illumination component is then subtracted from the R, G, and B channels of the color cast component to obtain the reflection component, and gain compensation is applied to it.

[0073] Step S5: For the reflection component and color cast component in step S4, the difference between the reflection component and the color cast component is used as the color offset. Based on the color offset, the original image is color-corrected using a modified brightness formula to finally obtain the color-corrected image.

[0074] In this embodiment, in step S1, an endoscope is used to acquire a color-distorted image; when acquiring the image, in order to avoid interference from other stray light, it is best to acquire the image in a dark room.

[0075] In this embodiment, in step S2, a color cast component of the same magnitude as the original image is estimated according to the distance formula, which is as follows:

[0076]

[0077] g(x, y) = pixel i ×Distance(x,y)(i=R′,G′,B′) (2)

[0078] In equation (1), x0 and y0 are the center points of the image, and Distance(x, y) is the distance from the center point of the image; in equation (2), g(x, y) is the color cast component of the image, where pixel is calculated as follows:

[0079] First, the pixel values ​​in the single-channel image are sorted in reverse order and a threshold is set. Then, all pixel values ​​within the threshold range are summed, using the following formula:

[0080]

[0081] num=m×n×thr (4)

[0082] In equation (3), sumP is the sum of pixel values, num is the number of pixel values, and f is the original image; in equation (4), m and n are the size of the single-channel image, and thr is the threshold, which can be adjusted according to the image. Then, the average of the sum of pixel values ​​in equation (3) can be used to calculate the pixel. i The value.

[0083] In this embodiment, the specific steps for obtaining the illuminated surface in step S3 are as follows:

[0084] Step S31: Acquire grayscale images under different light source brightness;

[0085] Step S32: Determine the coefficients of the illuminated surface under different light source brightness;

[0086] Step S33: Fit the illumination surface coefficients using the least squares estimation method;

[0087] Step S34: Estimate the illumination surface of the color cast component.

[0088] In this embodiment, step S31 specifically involves: acquiring grayscale images of different light source brightness at the same distance using an endoscope, specifically acquiring light source brightness images ranging from 0 to 100; and separating the R channel component in the image. Since the R channel component is stronger than other channel components in the endoscope, the R channel component is used for related calculations. Figure 2 The image is a three-channel image of R, G, and B at a light source brightness of 15, with an image resolution of 960×1080.

[0089] In this embodiment, step S32 specifically involves calculating the coefficients of the illumination surface for the R channel component under different light source brightness levels, as shown in the following formula:

[0090]

[0091] In equation (5), f(x, y) represents the pixel value of the original image, x0 and y0 are the center points of the image, and A and C are the correlation coefficients of the illumination surface. Taking the logarithm of both sides of (1):

[0092] lnf(x, y) = lnA - C × [(x - x0)] 2 +(y—y0) 2 (6)

[0093] The least squares method minimizes the sum of squares of errors between the fitted data and the target data, i.e., minimizes Loss(x, y) in equation (7), thus allowing the calculation of the illumination surface coefficients A and C under different light source brightness. The equations are as follows:

[0094] Loss(x,y)=lnA-C×[(x-x0) 2+(y—y0) 2 -lnf(x, y) (7)

[0095] In this embodiment, in step S32, the illumination surface coefficients of images with medium light source brightness are estimated relatively accurately, while the illumination surface coefficients of images with low and high light source brightness are not estimated accurately. In order to accurately estimate the illumination surface of the images, least squares fitting is performed based on the illumination surface coefficients of images with medium light source brightness, thereby further accurately estimating the illumination surface of images with all light source brightness.

[0096] In this embodiment, step S33 specifically involves establishing the following mathematical model for the illumination surface coefficients A and C of a medium light source brightness image, as shown in the following formula:

[0097]

[0098] Q i (x)=D*x 2 +E*x+P(i=A,C) (9)

[0099] In equation (8), α = 0.216, β = 0.7152, and γ = 0.0722 are the values ​​used in Rec.709. These are the average values ​​of the Red, Green, and Blue channels, respectively, and Lum is the brightness of the image; in equation (9), x is the average brightness of the image channel, and Q(x) is the surface coefficient.

[0100] The least squares method minimizes the sum of squares of the errors between the fitted data and the target data, i.e., the Loss in equation (10). i If (x) is minimized, then the coefficients D, E, and P can be calculated. The formula is as follows:

[0101] Loss i (x)=D*x 2 +E*x+P—Q i (x, y)(i = A, C) (10)

[0102] In this embodiment, step S34 specifically involves: calculating the illumination surface coefficients A and C of the color cast component according to formula (9), thereby estimating the illumination surface of the color cast component.

[0103] In this embodiment, in step S4, the illumination component is obtained by convolving the illumination surface with the color cast component, as shown in the following formula:

[0104] L(x, y) = S i (x, y)*Q(x, y)(i=R) (11)

[0105] In Equation (11), L(x, y) is the illumination component of the image, S(x, y) is the R channel component in the color cast component, Q(x, y) is the illumination surface, and * represents convolution.

[0106] Then, using the illumination component, the R, G, and B channels of the color cast component are subtracted from the illumination component to obtain the reflection component, as shown in the following formula:

[0107] g i (x, y) = L(x, y) * Ref i (x, y)(i = R, G, B) (12)

[0108] In equation (12), L(x, y) is the illumination component of the image, g(x, y) is the color cast component, and Ref(x, y) is the reflection component, where * represents the product. Direct calculation is computationally intensive, so we take the logarithm of both sides of the above equation to obtain the following equation:

[0109] ln S i (x, y) = ln L(x, y) + ln Ref i (x, y)(i = R, G, B) (13)

[0110] Therefore, the reflection component can be obtained as:

[0111] Ref i (x, y) = exp(ln g i (x,y)-ln L(x,y))(i=R,G,B) (14)

[0112] Gain compensation is applied to the reflection component, which involves a linear stretching process. The formula is as follows:

[0113]

[0114] In this embodiment, in step S5, the color offset of the image is obtained based on the color cast component and reflection component obtained in step S4, and its formula is as follows:

[0115] r = R Ref -R g

[0116] g = G Ref —G g (16)

[0117] b = B Ref -B g

[0118] In equation (16), R Ref G Ref and B Ref For the R, G, and B channels of the reflection component, Rg G g and B g Let R, G, and B be the three channels of the color cast component of the image, where r, g, and b are the color offsets. Then, color correction is performed on the image according to formula (17), which is as follows:

[0119] R out =R in +(1-α)*r-β*g-γ*b

[0120] G out =G in +(1-β)*g-α*r-γ*b (17)

[0121] B out =B in +(1-γ)*b-α*r-β*g

[0122] In formula (17), α=0.216, β=0.7152, γ=0.0722, where R in G in B in The input image consists of R, G, and B channel components. out G out B out To correct the R, G, and B channel components of the image, the three channels are fused to obtain the final color-corrected image.

[0123] The effects before and after correction are as follows Figure 3 As shown, the color values ​​of the three channels are now closer, especially the B channel pixel values, which are higher than before correction, indicating that the color cast of the image has been corrected accordingly. In practical applications, the color cast of images may vary under different light source brightness and distances. This method can solve the color cast problem of images under different acquisition distances and light source brightness, making the correction results consistent with human visual observation.

Claims

1. A color correction method for endoscopic images based on color offset estimation, characterized in that, Specifically, the following steps are included: Step S1: Acquire images using an endoscope; Step S2: For the image in Step S1, the pixel values ​​of the R, G, and B channels are arranged in reverse order, and the average value of the pixels within the threshold range is calculated to estimate the color cast value of the image. Then, a color cast component of the same size as the original image is constructed based on the distance formula from the pixel to the image center point. (1) (2); In equation (1), x0 and y0 are the center points of the image, and Distance(x, y) is the distance from the center point of the image; in equation (2), Let be the color cast component of the image, where The calculation method is as follows: First, sort the pixel values ​​in the single-channel image in reverse order and set a threshold. Then, sum all pixel values ​​within the threshold range. The formula is as follows: (3); (4); In formula (3) The sum of pixel values, The number of pixel values. The original image; in equation (4), m and n are the sizes of the original image. The threshold is used; then the average of the sum of the pixel values ​​in equation (3) is calculated. The value; Step S3: For the color cast component in Step S2, acquire a grayscale image and fit the illumination surface using the least squares method. Then, fit the illumination surface coefficients of the medium light source again using the least squares method to obtain the illumination surface coefficient fitting model, and estimate the illumination surface of its color cast component. The specific steps for the illumination surface in Step S3 are as follows: Step S31: Acquire grayscale images under different light source brightness; Step S32: Calculate the coefficients of the illumination surface under different light source brightness; specifically: calculate the coefficients of the illumination surface for the R channel component under different light source brightness, as shown in the following formula: (5); In equation (5), f(x,y) represents the pixel value of the original image. and The center point of the image, and These are the correlation coefficients of the illuminated surface; Step S33: Fit the illumination surface coefficients using the least squares estimation method; specifically, establish the following mathematical model for the illumination surface coefficients A and C of an image with moderate light source brightness, as shown in the following formula: (8); (9); In equation (8) , , Using the values ​​from Rec.709, , , These are the average values ​​of the Red, Green, and Blue channels, respectively. It is the brightness of the image; in equation (9), x is the average brightness of the image channel. The least squares method minimizes the sum of squares of the errors between the fitted data and the target data, i.e., in equation (10). To minimize these values, we can calculate the coefficients D, E, and P, as shown in the following formula: (10); Step S34: Estimate the illumination surface of the color cast component, specifically: calculate the illumination surface coefficients A and C of the color cast component according to formula (9), and thus estimate the illumination surface of the color cast component; Step S4: Based on the illumination surface in step S3, the illumination component is obtained by convolving it with the color cast component. In the logarithmic domain, the illumination component is subtracted from the three channels of the color cast component R, G, and B respectively to obtain the reflection component, and gain compensation is performed on it. Step S5: For the reflection component and color cast component in step S4, the difference between the reflection component and the color cast component is used as the color offset. Based on the color offset, the original image is color corrected using the deformed brightness formula to finally obtain the color corrected image.

2. The color correction method according to claim 1, characterized in that, The method for acquiring images using an endoscope in step S1 is as follows: in an endoscope-lit, darkroom environment, images of any object are acquired.

3. The color correction method according to claim 1, characterized in that, In step S4: Take the logarithm of both sides of formula (5): (6); The least squares method minimizes the sum of squares of the errors between the fitted data and the target data, i.e., in equation (7). To minimize these values, the illumination surface coefficients A and C under different light source brightnesses can be determined; their formulas are as follows: (7)。 4. The color correction method according to claim 1, characterized in that, In step S4, the illumination component is obtained by convolving the illumination surface with the color cast component, as shown in the following formula: (11); In equation (11), L(x,y) represents the illumination component of the image. Let R be the R channel component of the color cast component, and Q(x,y) be the illumination surface, where... For convolution; In step S5, the color offset of the image is obtained based on the color cast component and reflection component obtained in step S4, and its formula is as follows: (16); In equation (16) , and For the R, G, and B channels of the reflection component, , and For the color cast components of the image, the R, G, and B channels are used. , and Let be the color offset; then, perform color correction on the image according to formula (17), which is as follows: (17); In equation (17) , , ,in , , The input image consists of R, G, and B channel components. , , To correct the R, G, and B channel components of the image, the three channels are fused to obtain the final color-corrected image.

5. The color correction method according to claim 4, characterized in that, In the logarithmic domain, the illumination component is subtracted from the R, G, and B channels of the color cast component to obtain the reflection component, as shown in the following formula: (12); In equation (12), L(x,y) represents the illumination component of the image, and g i (x,y) represents the color cast component, Ref i (x,y) represents the reflection component, where Since the product is a product, taking the logarithm of both sides of the above equation yields the following equation: (13); Therefore, the reflection component is: (14); Gain compensation is applied to the reflection component, which involves a linear stretching process. The formula is as follows: (15)。 6. The color correction method according to claim 1, characterized in that, Step S31 specifically involves: acquiring grayscale images of different light source brightness at the same distance in an active illumination and darkroom environment of the endoscope, and acquiring light source brightness images between 0 and 100. The R channel component in the image is then separated, and related calculations are performed using the R channel component.

Citation Information

Patent Citations

  • Color constancy method in two steps under complex illumination

    CN101930596A

  • Endoscope color correction method based on Gaussian surface fitting

    CN114418871A