A method for enhancing the color of medical images
By employing a multi-level progressive image processing method, separating the brightness layer and detail layer, performing channel merging and mask calculation, and combining image fusion and color processing, the problem of local overexposure and noise caused by color enhancement in endoscopic images is solved, thereby improving the visual effect and diagnostic accuracy of the images.
Patent Information
- Application Number
- CN202310133845.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-17
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-02-17
AI Technical Summary
Existing image processing methods are prone to local overexposure or noise during color enhancement, affecting the image's depth and diagnostic accuracy, especially in endoscopic images, which may lead to misdiagnosis or surgical failure.
A multi-level progressive image processing method is adopted, which separates the brightness layer and detail layer through guided filtering, performs channel merging and mask calculation, and combines image fusion and color processing to improve the color saliency and accuracy of the image.
It achieves smooth color enhancement of images, improves visual effects and diagnostic accuracy, avoids problems caused by local over-enhancement, and enhances the salience of foreground targets.
Smart Images

Figure CN116051420B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and specifically relates to a method for enhancing the color of medical images. Background Technology
[0002] Endoscopic images are crucial for doctors to diagnose dysplasia and early lesions. Therefore, the color discrimination and color rendering capabilities of medical endoscopes are of paramount importance. The color rendering ability of an endoscope is closely related to the accurate differentiation between normal and pathological tissues, and its impact on clinical treatment is critical. If the endoscope's color rendering is poor, it may fail to clearly alert doctors to potential lesions, potentially affecting their observation and manipulation of human tissues within the field of vision, leading to misdiagnosis or even surgical failure.
[0003] Therefore, ideal color rendering is particularly important because color can provide information about the health status of a specific tissue. For example, if a tissue is not receiving enough oxygen, its color will change.
[0004] Currently, color enhancement methods can be broadly categorized into two types: traditional image processing and methods using convolutional neural networks. Traditional image processing, based on the Retinex theory of color constancy, is representative. One multi-scale color enhancement method based on hue constancy extracts the luminance component from the original image, then applies a multi-scale Gaussian filter to it. The filtered image represents the estimated illumination component. Subtracting the illumination component from the original image yields the reflection component. The luminance enhancement ratio can be calculated from the luminance and reflection components. Finally, the three color channels of the original image are multiplied by the luminance enhancement ratio to obtain the enhanced image. Convolutional neural networks for image color enhancement typically involve training a large amount of data to train the network model, enabling it to perform color enhancement processing.
[0005] The Retinex method processes the three color channels of the original image by multiplying them by a brightness enhancement factor. However, this operation is linear and can lead to local overexposure of the original image, where brighter areas become too bright, resulting in the loss of some details in these areas. At the same time, noise appears in the darker areas of the original image.
[0006] Using convolutional neural networks to enhance the color of an image as a whole with the same intensity can easily lead to the background information in the original image becoming more vivid than the foreground information after enhancement. This changes the key information that the original image is meant to convey, resulting in a poor sense of depth and indistinct distinction between primary and secondary objects in the enhanced image.
[0007] Therefore, we propose a processing method that helps improve the saliency of image colors, which can effectively enhance the color capabilities of image targets and help improve the diagnostic accuracy of doctors. Summary of the Invention
[0008] To overcome the above technical problems, this invention provides a method for enhancing the color of medical images, resulting in images with better visual effects and higher color accuracy.
[0009] To achieve the above objectives, the technical solution provided by this invention is as follows:
[0010] A method for color enhancement of medical images includes the following steps:
[0011] (1) The original image of the white light endoscope is divided into three RGB channels; each channel image is regarded as a grayscale image, and then guided filtering is performed on each channel image with itself as the guide image to obtain the image brightness layer; the background color of the image is concentrated; among which, the formula for guided filtering is (Ⅰ):
[0012]
[0013] Where I represents the original image, I b I g I r f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image;
[0014] In this step, other filtering methods such as Gaussian filtering can also be used, but this will result in excessive time overhead. Moreover, Gaussian filtering will also process the field of view edge of the endoscopic image at the same time. As the processing radius increases, the edge feathering range will also be larger, which is not conducive to subsequent processing.
[0015] (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II):
[0016]
[0017] Among them, D b D g D r It is a detail layer image of the B, G, and R channels;
[0018] For endoscopic images, most of the foreground information, such as the mucosa and blood vessels, is concentrated in the detail layer. Therefore, it is necessary to separate the detail information of the image. Subtracting the image brightness layer from the original image yields the image of the detail layer. Since the image brightness layer plus the detail layer equals the source image, this decomposition method can be called additive decomposition. At this point, an image has been divided into the brightness layer and the detail layer.
[0019] (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain a preliminary color transformation image. This stretches the pixel values of the three background color channels to be similar, making the color information as close to white as possible, while increasing the pixel value of the foreground information R channel, making the color information as close to red as possible, resulting in the merged image. The processing formula is (Ⅲ):
[0020]
[0021] Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer;
[0022] (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E′. b E′ g E′ r ;
[0023] For the common field of view in endoscopy, namely the observation area is a circular area in the center of the image and the surrounding area is black, a mask needs to be set, that is, a binarization operation is used. By setting a threshold, the pixel value of the area to be processed is 255, and the pixel value of the area not to be processed is 0, so as to ensure the accuracy of the image processing area and reduce the amount of computation.
[0024] (5) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground target is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅳ):
[0025] I′=ε*I+(1-ε)*E′ (Ⅳ)
[0026] Where ε is the fusion coefficient and I′ is the fused image;
[0027] (6) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V):
[0028]
[0029]
[0030]
[0031] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Min (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
[0032] Preferably, the method for enhancing the color of medical images further includes performing a secondary color enhancement on the image that has undergone initial color enhancement.
[0033] Preferably, the method for enhancing the color of medical images includes the following steps:
[0034] (1) Divide the original image of the white light endoscope into three RGB channels; treat each channel image as a grayscale image, and then perform guided filtering on each channel image with itself as the guide image to obtain the image brightness layer; wherein, the formula for guided filtering is (Ⅰ):
[0035] G b =f guidfilter (I b )
[0036] G g =f guidfilter (I g )
[0037] G r =f guidfilter (I r )
[0038] Where I represents the original image, I b I g Ir f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image;
[0039] (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II):
[0040] D b =I b -G b
[0041] D g =I g -G g
[0042] D r =I r -G r
[0043] Where Db, Dg, and Dr are detail layer images of the B, G, and R channels, respectively.
[0044] (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain the merged image; the processing formula is (Ⅲ):
[0045] E b =α b *G b +β b *D b
[0046] E g =α g *G g +β g *D g
[0047] E r =α r *G r +β r *D r
[0048] Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer;
[0049] (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E′. b E′ g E′ r ;
[0050] (5) Perform a second color enhancement on the initially color-enhanced image to further stretch the pixel values of the three channels of the background color to be closer together, and further enlarge the foreground target information; the resulting image with second color enhancement is processed by formula (VI):
[0051]
[0052] Wherein, NC is the calculated emphasis reference diagram. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It enhances the output image; the color emphasis formula changes the case of considering only the R and G channels, and also includes the B channel in the consideration, ensuring more complete calculation and avoiding the impact of large channel deviation on the accuracy of the results.
[0053] (6) By fusing the image enhanced by secondary color with the original image, an image with prominent foreground targets and similar background colors (i.e., a near-white background) is obtained. Image fusion effectively avoids the phenomenon of excessively large or small gray values of some interfering pixels in the enhancement step. By using a fusion factor for adjustment, the fused image is more like a gradual adjustment on the original image, so that the observer does not feel visually abrupt and it does not affect the experience. The processing formula is (Ⅶ):
[0054] I′=ε*I+(1-ε)*H
[0055] Where ε is the fusion coefficient and I′ is the fused image;
[0056] (7) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V):
[0057]
[0058]
[0059]
[0060] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Min (r、h、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image; staineding the fused image increases the pixel value of the R channel, making the stained effect more vivid.
[0061] Another object of the present invention is to provide a method for color enhancement of medical images, characterized by comprising the following steps:
[0062] (1) Enhance the color of the original image; the resulting image with preliminary color enhancement is processed by formula (VIII):
[0063]
[0064] Where I represents the original image, I b I g I r This represents the B, G, and R channel images of image I, with NC being the calculated emphasis reference image. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It is an enhanced output graph;
[0065] (2) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground object is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅶ):
[0066] I′=ε*I+(1-ε)*H
[0067] Where ε is the fusion coefficient and I′ is the fused image;
[0068] (3) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V):
[0069]
[0070]
[0071]
[0072] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Mih (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
[0073] Furthermore, during the image coloring process, grayscale values can be used instead of the average value.
[0074] Compared with the prior art, the technical advantages of the present invention are as follows:
[0075] 1. This invention primarily enhances image color through a multi-level, gradual adjustment method, avoiding situations where local algorithms overemphasize effects, leading to undesirable overall results. The color enhancement effect after image fusion processing is relatively smooth, the visual effect of the image after color enhancement is prominent, and the color accuracy of the image after coloring processing is also good.
[0076] 2. This invention is an invention that can be implemented in a multi-level manner. The implementation order of the algorithm is one of the core aspects. Processing the original image starting with color enhancement, or removing the secondary color enhancement processing step, can also achieve a relatively good image processing effect.
[0077] 3. The image fusion of the present invention is a key step to avoid local over-enhancement and conform to the gradual enhancement perceived by the human eye. Attached Figure Description
[0078] Figure 1 Image processing flowchart;
[0079] Figure 2 Example 1: Image processing procedure AB-C1-E;
[0080] Figure 3 Example 2: Image processing procedure AB-C2-DE;
[0081] Figure 4 Image processing procedure AFGH in Example 3;
[0082] Wherein, A is the original image; B is the preliminary color-enhanced image after additive decomposition of the original image, stretching of the luminance and detail layers, and channel merging; C1 is the image obtained after fusion of the preliminary color-enhanced image after masking; C2 is the image obtained after secondary color enhancement after masking; D is the image obtained after fusion of preliminary color enhancement, secondary color enhancement, and tinting; E is the final color-enhanced image after tinting; F is the image obtained after direct color enhancement of the original image; G is the fused image; and H is the final color-enhanced image after tinting.
[0083] The present invention will now be further described in conjunction with the accompanying drawings and embodiments: Detailed Implementation
[0084] The present invention will be described below through specific embodiments to make the technical solution of the present invention easier to understand and master, but the present invention is not limited thereto. Unless otherwise specified, the experimental methods described in the following embodiments are conventional methods; unless otherwise specified, the reagents and materials are all commercially available.
[0085] Example 1
[0086] A method for color enhancement of medical images, characterized by comprising the following steps:
[0087] (1) Divide the original image of the white light endoscope into three RGB channels; treat each channel image as a grayscale image, and then perform guided filtering on each channel image with itself as the guide image to obtain the image brightness layer; wherein, the formula for guided filtering is (Ⅰ):
[0088] G b =f guidfilter (I b )
[0089] G g =f guidfilter (I g )
[0090] G r =f guidfilter (I r )
[0091] Where I represents the original image, I b I g I r f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image;
[0092] (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II):
[0093] D b =I b -G b
[0094] D g =I g -G g
[0095] D r =I r -G r
[0096] Where Db, Dg, and Dr are detail layer images of the B, G, and R channels, respectively.
[0097] (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain the merged image; the processing formula is (Ⅲ):
[0098] E b =α b *G b +β b *D b
[0099] E g =α g *G g +β g *D g
[0100] E r =α r *G r +β r *D r
[0101] Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer;
[0102] (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E′. b E′ g E′ r ;
[0103] (5) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground target is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅳ):
[0104] I′=ε*I+(1-ε)*E′
[0105] Where ε is the fusion coefficient and I′ is the fused image;
[0106] (6) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V):
[0107]
[0108]
[0109]
[0110] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Mih (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) It is the average value of the three channels of pixels, L bL g L r This is the stained image.
[0111] See processing results Figure 2 .
[0112] Example 2
[0113] A method for color enhancement of medical images, characterized by comprising the following steps:
[0114] (1) Divide the original image of the white light endoscope into three RGB channels; treat each channel image as a grayscale image, and then perform guided filtering on each channel image with itself as the guide image to obtain the image brightness layer; wherein, the formula for guided filtering is (Ⅰ):
[0115] G b =f guidfilter (I b )
[0116] G g =f guidfilter (I g )
[0117] G r =f guidfilter (I r )
[0118] Where I represents the original image, I b I g I r f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image;
[0119] (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II):
[0120] D b =I b -G b
[0121] D g =I g -G g
[0122] D r =I r -G r
[0123] Where Db, Dg, and Dr are detail layer images of the B, G, and R channels, respectively.
[0124] (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain the merged image; the processing formula is (Ⅲ):
[0125] E b =α b *G b +β b *D b
[0126] E g =α g *G g +β g *D g
[0127] E r =α r *G r +β r *D r
[0128] Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer;
[0129] (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E′. b E′ g E′ r ;
[0130] (5) Perform a second color enhancement on the image with the initial color enhancement; the resulting image with the second color enhancement is processed by formula (VI):
[0131] NC = 32 * log2(2 * E r ' / (E' b +E' g ))
[0132]
[0133]
[0134]
[0135] Wherein, NC is the calculated emphasis reference diagram. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It is an enhanced output graph;
[0136] (6) By fusing the image with secondary color enhancement with the original image, an image is obtained where the foreground target is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅶ):
[0137] I′=ε*I+(1-ε)*H
[0138] Where ε is the fusion coefficient and I′ is the fused image;
[0139] (7) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image. The resulting color-enhanced image is obtained. The processing formula is (V):
[0140]
[0141]
[0142]
[0143] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Mih (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
[0144] See processing results Figure 3 .
[0145] Example 3
[0146] A method for color enhancement of medical images, characterized by comprising the following steps:
[0147] (1) Enhance the color of the original image; the resulting image with preliminary color enhancement is processed by formula (VIII):
[0148] NC = 32 * log2(2 * I r / (I b +I g ))
[0149]
[0150]
[0151]
[0152] Where I represents the original image, I b I g I r This represents the B, G, and R channel images of image I, with NC being the calculated emphasis reference image. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It is an enhanced output graph;
[0153] (2) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground object is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅶ):
[0154] I′=ε*I+(1-ε)*H
[0155] Where ε is the fusion coefficient and I′ is the fused image;
[0156] (3) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V):
[0157]
[0158]
[0159]
[0160] Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Mih (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, preferably 5. (r、g、b) L is the average value of the three channels of pixels. b L g L r This is the stained image.
[0161] See processing results Figure 4 .
[0162] The above detailed description is a specific description of one of the feasible embodiments of the present invention. This embodiment is not intended to limit the patent scope of the present invention. All equivalent implementations or modifications that do not depart from the present invention should be included within the scope of the technical solution of the present invention.
Claims
1. A method for enhancing the color of medical images, characterized in that, Includes the following steps: (1) Divide the original image I of the white light endoscope into three RGB channels; treat each channel image as a grayscale image, and then perform guided filtering on each channel image with itself as the guide image to obtain the image brightness layer; wherein, the formula for guided filtering is (Ⅰ): G b =f guidfilter (I b ) G g =f guidfilter (I g ) G r =f guidfilter (I r ) Where I represents the original image, I b I g I r f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image; (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II): D b =I b -G b D g =I g -G g D r =I r -G r Where Db, Dg, and Dr are detail layer images of the B, G, and R channels, respectively. (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain the merged image; the processing formula is (Ⅲ): E b =a b *G b +b b *D b E g =a g *G g +b g *D g E r =a r *G r +b r *D r Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer; (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E b ′、E g ′、E r ′; (5) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground target is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅳ): I′=ε*I+(1-ε)*E′ Where ε is the fusion coefficient and I′ is the fused image; (6) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V): Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Min (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, and mean. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
2. The method for enhancing the color of medical images as described in claim 1, characterized in that, T is 5.
3. The method for enhancing the color of medical images as described in claim 1, characterized in that, The method for enhancing the color of medical images also includes performing a secondary color enhancement on the image that has undergone initial color enhancement.
4. A method for enhancing the color of medical images, characterized in that, Includes the following steps: (1) Divide the original image I of the white light endoscope into three RGB channels; treat each channel image as a grayscale image, and then perform guided filtering on each channel image with itself as the guide image to obtain the image brightness layer; wherein, the formula for guided filtering is (Ⅰ): G b =f guidfilter (I b ) G g =f guidfilter (I g ) G r =f guidfilter (I r ) Where I represents the original image, I b I g I r f represents the B, G, and R channel images of I. guidfilter Indicates guided filtering, G b G g G r This is the filtered channel image, representing the brightness layer image; (2) Subtract the image brightness layer from the original image to obtain the detail layer image. The processing formula is (II): D b =I b -G b D g =I g -G g D r =I r -G r Where Db, Dg, and Dr are detail layer images of the B, G, and R channels, respectively. (3) Stretch the brightness layer and detail layer separately, and then merge the channels to obtain the merged image; the processing formula is (Ⅲ): E b =a b *G b +b b *D b E g =a g *G g +b g *D g E r =a r *G r +b r *D r Among them, E b E g E r This is the image after merging the B, G, and R channels, α b α g α r It is the adjustment parameter of the brightness layer, β b β g β r These are the adjustment parameters for the detail layer; (4) Perform mask calculation on the merged image: Use binarization to set a threshold so that the pixel value of the area to be processed is 255 and the pixel value of the area not to be processed is 0; the gray value of the surrounding pixels is 0, and the central visual area obtains a preliminary color-enhanced image, with each channel being E b ′、E g ′、E r ′; (5) Perform a second color enhancement on the image with the initial color enhancement; the resulting image with the second color enhancement is processed by formula (VI): NC = 32 * log2(2 * E r ' / (AND b '+E' g )) Wherein, NC is the calculated emphasis reference diagram. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It is an enhanced output graph; (6) By fusing the image with secondary color enhancement with the original image, an image is obtained where the foreground target is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅶ): I′=ε*I+(1-ε)*H Where ε is the fusion coefficient and I′ is the fused image; (7) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image. The resulting color-enhanced image is obtained. The processing formula is (V): Where δ is the adjustment coefficient, Max (r , g , b) It is the maximum value of the pixels in the three channels (r, g, b), Min (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, and mean. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
5. The method for enhancing the color of medical images as described in claim 4, characterized in that, T is 5.
6. A method for enhancing the color of medical images, characterized in that, Includes the following steps: (1) Enhance the color of the original image I; the resulting image has been preliminarily color-enhanced. The processing formula is (VIII): NC=32*log2(2*I r / (I b +I g )) Where I represents the original image, I b I g I r This represents the B, G, and R channel images of image I, with NC being the calculated emphasis reference image. It emphasizes the average grayscale value of the reference image, coefficient. b coefficient g coefficient r H represents the emphasis coefficient for each channel. b H g H r It is an enhanced output graph; (2) By fusing the pre-enhanced color image with the original image, an image is obtained where the foreground object is prominent, the background color of each pixel is similar, that is, the image background is nearly white; the processing formula is (Ⅶ): I′=ε*I+(1-ε)*H Where ε is the fusion coefficient and I′ is the fused image; (3) Coloring the fused image: First, calculate the maximum, minimum, and average values of the three channels for each pixel. Process each channel individually. No processing is needed when the B and G channel values are equal to the maximum value. Processing is required when the R channel value is equal to the maximum value and the difference between the maximum and minimum values is greater than the default threshold. Adjust each pixel of each channel in the image to obtain the colored image, which is the final color-enhanced image. The processing formula is (V): Where δ is the adjustment coefficient, Max (r、g、b) It is the maximum value of the pixels in the three channels (r, g, b), Min (r、g、b) It is the minimum value of the three channels (r, g, b), where T is the default threshold, and mean. (r、g、b) It is the average value of the three channels of pixels, L b L g L r This is the stained image.
7. The method for enhancing the color of medical images as described in claim 6, characterized in that, T is 5.
Citation Information
Patent Citations
Underwater image enhancement method based on color correction and three-interval histogram stretching
CN112419210A
KR20220050977A