Image enhancement method and system based on improved msr and clah

By improving the MSR and CLAHE methods, the problems of insufficient detail, low contrast, and uneven brightness in cervical cancer images were solved, achieving image detail enhancement and color stretching, and optimizing the visual effect of the images.

CN116416162BActive Publication Date: 2026-04-17ANHUI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANHUI UNIV
Filing Date
2023-04-17
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing medical image enhancement algorithms suffer from problems such as insufficient detail, low contrast, uneven brightness, and color distortion in cervical cancer image processing, making it difficult to meet the requirements.

Method used

An image enhancement method employing an improved multi-scale retina theory (MSR) and contrast-limited dual adaptive histogram stretching (CLDAHE) enhances image details while maintaining color fidelity through steps such as separating red, green, and blue channels, guided filtering, multi-scale detail extraction, and adaptive gamma correction.

Benefits of technology

While maintaining color fidelity, the colors are stretched to the maximum extent, image details are enhanced, noise is eliminated, uneven brightness is optimized, and the visual effect of the image is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116416162B_ABST
    Figure CN116416162B_ABST
Patent Text Reader

Abstract

This invention discloses an image enhancement method and system based on improved MSR and CLAHE, belonging to the field of image enhancement technology. The method involves extracting the reflection components from each channel using the improved MSR algorithm, quantizing them back to 0-255 to obtain R1, G1, and B1, and then performing CLAHE on the green channel G1 and the blue channel B1 to obtain G2 and B2, resulting in a color image img2. Guided filtering is then applied to img2, and a multi-scale method is used to extract and enlarge its detail information, achieving detail preservation. Finally, the image is converted to the HSV color space, and adaptive gamma correction is performed on the V channel to improve image brightness. The image enhancement method provided by this invention solves the problems of insufficient detail highlighting, low contrast, uneven brightness, and color distortion in existing medical image enhancement methods for cervical cancer images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image enhancement technology, and more specifically to an image enhancement method and system based on an improved MSR and CLAHE. Background Technology

[0002] Medical image enhancement primarily involves performing a series of processes on medical images to enhance their overall quality or local details, thereby improving overall and local contrast, suppressing unwanted detail information, and obtaining high-resolution medical images with clearer information about patient tissues and organs. Existing research has proposed many medical image enhancement methods, mainly divided into traditional medical image enhancement methods and deep learning-based image enhancement methods.

[0003] Traditional medical image enhancement algorithms mainly fall into two categories based on their processing domain: spatial domain-based and frequency domain-based. Spatial domain-based methods focus on the grayscale domain of the image, emphasizing the selection of an appropriate mapping transformation function based on the processing scenario. Frequency domain-based methods, on the other hand, focus on adjusting the transformation function in the image's transform domain. Typical spatial domain-based image enhancement algorithms include histogram equalization and its improvements, the Retinex algorithm, and grayscale transformation algorithms. Frequency domain-based algorithms primarily include Fourier transform-based enhancement algorithms and wavelet transform-based enhancement algorithms.

[0004] The above-mentioned medical image enhancement algorithms based on traditional methods have the following drawbacks in the process of enhancing cervical cancer images, such as insufficient detail, color distortion, uneven brightness, etc. The existing traditional enhancement algorithms alone cannot process the characteristics of cervical images, and the effect is difficult to meet the requirements.

[0005] Therefore, how to provide an image enhancement method and system based on the improved multiscale retina theory (MSR) and contrast-limited dual adaptive histogram stretching (CLDAHE) has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, and in response to the problems of insufficient detail enhancement, low contrast, uneven brightness, and color distortion in existing medical image enhancement methods for cervical cancer images, this invention provides an image enhancement method and system based on improved MSR and CLAHE.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] An image enhancement method based on improved MSR and CLAHE includes the following steps:

[0009] The input image to be enhanced is separated into red, green, and blue channels;

[0010] Based on the improved MSR algorithm, the reflection components of the red channel, green channel and blue channel are extracted by channel and quantized back to RGB image to obtain the first red channel, first green channel and first blue channel, and then the image to be enhanced is enhanced in detail;

[0011] CLAHE is performed on the first green channel and the first blue channel to obtain the second green channel and the second blue channel, and the colors of the image to be enhanced are stretched.

[0012] The first red channel, the second green channel, and the second blue channel are merged into a first image;

[0013] The first image is subjected to guided filtering to obtain the second image, and the detailed information of the first image is extracted and magnified using a multi-scale method to obtain the third image. The second image and the third image are then fused into the fourth image.

[0014] The fourth image is converted to the HSV color space, and adaptive gamma correction is performed on the V channel;

[0015] The H channel, S channel, and V channel after adaptive gamma correction in the HSV color space are merged to obtain the enhanced image and output it.

[0016] Preferably, the specific process of extracting the reflection components of the red channel, the green channel, and the blue channel based on the improved MSR algorithm and quantizing them back into an RGB image to obtain the first red channel, the first green channel, and the first blue channel includes:

[0017] a. Perform a logarithmic operation on the input image to be enhanced to obtain a logarithmic image;

[0018] b. Perform Gaussian blurring on the logarithmic image at three different scales to obtain three low-frequency images;

[0019] c. Calculate the difference between the image to be enhanced and the three low-frequency images respectively, and then sum them up in a weighted manner;

[0020] d. Quantize the logarithmic image to an RGB image using the improved quantization formula.

[0021] Preferably, the improved quantification formula is:

[0022]

[0023] Where i∈{R,G,B} represents three color channels, ψ is a dynamic parameter with an experimental value of 500, where Imean I represents the average pixel value of the input image. pR I pG and I pB These represent the pixel values ​​where the peak values ​​are located in the histogram of the RGB channels of the image.

[0024] Preferably, the specific process of performing CLAHE on the first green channel and the first blue channel to obtain the second green channel and the second blue channel is as follows:

[0025] a. Divide the input first red channel, first green channel, and first blue channel into multiple N*N region blocks, and use the region blocks as the unit for the next step;

[0026] b. Calculate the pixel mean r_mean of the first red channel;

[0027] c. Calculate the histograms of the first blue channel and the first green channel;

[0028] d. Clip and equalize the histogram according to clipLimit = 0.01 * r_mean;

[0029] e. Traverse the multiple N*N region blocks and perform bilinear interpolation between the region blocks to obtain the second green channel and the second blue channel.

[0030] Preferably, the second image is obtained by performing guided filtering on the first image, specifically including:

[0031] Guided filtering is performed on the first image, assuming that the filtering window at any position k in the first image is ω. k The expression is as follows:

[0032] O i =a k ·G i +b k , i∈ω k

[0033] Among them O i It is the output image, G i It is a guide image, a k and b k The solution formula is as follows:

[0034]

[0035]

[0036] Where Cov(·) represents covariance, Var(·) represents variance, ε is a control factor to avoid errors caused by zero denominator, and mean(·) represents mean.

[0037] Preferably, the third image is obtained by extracting detailed information from the first image using a multi-scale method and then magnifying it, specifically including:

[0038] The second image is obtained by filtering the input second blue channel and second green channel using three Gaussian filters of different scales.

[0039] The difference between the second blue channel and the second green channel is calculated to obtain detail information at different scales. Then, weighted fusion is performed, and the detail images of the second blue channel and the second green channel are magnified by 2 times to obtain the third image.

[0040] Preferably, fusing the second image and the third image into a fourth image specifically includes:

[0041] The second image and the third image are weighted and fused together to fill in the details of the second image:

[0042]

[0043]

[0044] B5 = αB3 + (1-α)(2·B4)

[0045] G5 = αG3 + (1-α)(2·G4)

[0046] I img5 =merge(B5,G5,R3)

[0047] Among them B i G i R i They represent img i The corresponding color channel, Gu k Represents the Gaussian kernel, ω k These are the weighting coefficients for fusing detailed information at different scales. Here, ω1, ω2, and ω3, corresponding to the filter kernel from smallest to largest, are 0.2, 0.3, and 0.5 respectively. k represents different scales, and α represents the weighting coefficient. The experimental value here is 0.8. img5 This represents the image after filtering and detail fusion, and merge(·) indicates merging channels.

[0048] The adaptive gamma correction process for the V channel specifically includes: constructing adaptive gamma parameters and performing adaptive gamma correction on the V channel of the fourth image, as shown in the following formula:

[0049] X γ =θ;

[0050] γ = log X θ;

[0051] Where X is the normalized mean of all pixels in the image, θ is a reasonable setting value, which is set to 0.5 here, and γ is the gamma parameter, which is determined by X and θ.

[0052] An image enhancement system based on improved MSR and CLAHE, for implementing any of the above-mentioned image enhancement methods based on improved MSR and CLAHE, the system comprising:

[0053] The channel separation module is used to separate the input image to be enhanced into red, green, and blue channels;

[0054] The image detail enhancement module is used to extract the reflection components of the red channel, the green channel, and the blue channel based on the improved MSR algorithm and quantize them back into an RGB image to obtain the first red channel, the first green channel, and the first blue channel.

[0055] The color stretching module is used to perform CLAHE on the first green channel and the first blue channel to obtain the second green channel and the second blue channel;

[0056] The first channel merging module is used to merge the first red channel, the second green channel, and the second blue channel into a first image;

[0057] An image fusion module is used to perform guided filtering on the first image to obtain the second image, and to magnify the details of the first image using a multi-scale method to obtain the third image; and to fuse the second image and the third image into a fourth image.

[0058] The color model conversion module is used to convert the fourth image to the HSV color space and perform adaptive gamma correction on the V channel.

[0059] The image output module merges the H channel, S channel, and V channel after adaptive gamma correction in the HSV color space to obtain an enhanced image and output it.

[0060] As can be seen from the above technical solutions, compared with the prior art, this invention discloses an image enhancement method and system based on improved MSR and CLAHE. This invention maximizes color stretching while ensuring color fidelity, allowing doctors to more clearly observe image changes and details. Secondly, it utilizes Retinex theory to extract the reflection component, obtaining the essential attributes of the image and effectively enhancing image details, making the edges and states of observed objects in the image clearer. Furthermore, it extracts image detail information in advance during noise reduction, greatly avoiding the loss of details caused by filtering. Finally, to address the uneven brightness problem during image acquisition, adaptive gamma correction brightness is adopted to further optimize the visual effect of the image. Attached Figure Description

[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0062] Figure 1 This is a flowchart illustrating an image enhancement method based on an improved MSR and CLAHE according to an embodiment of the present invention.

[0063] Figure 2(a) is the original image of cervical cancer, Figure 2(b) is the effect image of the image enhancement method of the present invention, Figure 2(c) is the effect image after processing by the CLAHE algorithm, Figure 2(d) is the effect image after processing by the automatic color balance algorithm (ACE), Figure 2(e) is the effect image after processing by the MSR algorithm, and Figure 2(f) is the effect image after processing by the MSR algorithm with color restoration.

[0064] Figure 3 This is a structural framework diagram of an image enhancement system based on an improved MSR and CLAHE according to an embodiment of the present invention. Detailed Implementation

[0065] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0066] This invention discloses an image enhancement method based on an improved MSR and CLAHE, such as... Figure 1 As shown, it includes the following steps:

[0067] The input image to be enhanced, img1, is separated into the red channel R, the green channel G, and the blue channel B;

[0068] Based on the improved MSR algorithm, the reflection components of the red channel R, green channel G, and blue channel B are extracted and quantized back into the RGB image to obtain the first red channel R1, the first green channel G1, and the first blue channel B1. The image img1 to be enhanced is then enhanced in detail.

[0069] Since different colors absorb and reflect light differently, this embodiment only performs CLAHE on the obtained green channel G1 and blue channel B1 to obtain the second green channel G2 and the second blue channel B2, and stretches the color of the image img1 to be enhanced.

[0070] The first red channel R1, the second green channel G2, and the second blue channel B2 are merged into the first image img2;

[0071] The first image img2 is subjected to guided filtering to obtain the second image img3, eliminating the noise generated during the enhancement process. The detailed information of the first image img2 is extracted using a multi-scale method and magnified to obtain the third image img4. The second image img3 and the third image img4 are then fused to obtain the fourth image img5.

[0072] The fourth image, img5, is converted to the HSV color space, and adaptive gamma correction is applied to the V channel to improve image brightness.

[0073] The H channel, S channel, and V channel after adaptive gamma correction in the HSV color space are merged to obtain the enhanced image and output it.

[0074] Furthermore, in this embodiment of the invention, Retinex theory posits that the shape and color of an object are determined by its ability to reflect light, and that the surface features of the object are unaffected by non-uniform illumination, exhibiting uniformity. By estimating the incident component, the reflection component is separated from the original image, thereby obtaining the surface characteristics of the object. The visual image S(x,y) can be composed of the incident component L(x,y) and the object's reflection component R(x,y), and the relationship between them is expressed by the following equation:

[0075] S(x,y)=L(x,y)·R(x,y) (1)

[0076] Where L(x,y) is the incident component, which is affected by lighting and environmental factors and determines the dynamic range of the image S(x,y); R(x,y) is the reflection component, which reflects the reflective properties of the object itself. The object's ability to absorb and reflect light is related to the properties of its surface. To better separate the incident and reflection components, equation (1) is expressed logarithmically:

[0077] Log(R(x,y))=Log(S(x,y))-Log(L(x,y)) (2)

[0078] In Retinex theory, it is assumed that the illumination changes slowly, so L(x,y) is a low-frequency component, which can be approximated by Gaussian blur. Therefore, formula (2) can be written as:

[0079]

[0080] in Let G(x,y) represent convolution, and G(x,y) represent the Gaussian kernel. Finally, Log(R(x,y)) needs to be quantized into pixel values ​​in the range of 0 to 255 as the final output. The quantization formula is as follows:

[0081] R(x,y)=(Value-Min / Max-Min)·(255-0) (4)

[0082] Where Max and Min represent the maximum and minimum values ​​of Log(R(x,y)) respectively, and Value represents the pixel value.

[0083] The above describes the single-scale Retinex theory. To balance local contrast and color fidelity in image enhancement, and to take into account the advantages of large, medium, and small scales, a multi-scale Retinex algorithm can be selected to achieve better image enhancement results. The expression can be rewritten as:

[0084]

[0085] Where k represents three different Gaussian kernel scales, i represents three color channels R, G, and B, and ω k This represents the weights corresponding to the three scales, typically taken as ω1 = ω2 = ω3 = 1 / 3.

[0086] Both single-scale and multi-scale Retinex theories use direct linear quantization when quantizing to the 0-255 range. This results in an overall grayish image. This is because the original color values ​​have a smaller data range after logarithmic processing, and the differences between channels also decrease. Furthermore, the subsequent linear quantization is much smoother than an exponential curve, thus distorting the overall image color. To address this issue, this paper improves the quantization formula of the multi-scale Retinex algorithm for medical images. The quantization formula is rewritten as follows:

[0087]

[0088] Where i∈{R,G,B} represents three color channels, ψ is a dynamic parameter with an experimental value of 500, where I mean I represents the average pixel value of the input image. pR I pG and I pB These represent the pixel values ​​where the peak values ​​are located in the histogram of the RGB channels of the image. During the calculation, it is important to note that values ​​exceeding 255 should be set to 255 to prevent overflow.

[0089] In the improved MSR algorithm, the pixel values ​​where the peak values ​​of the histograms of each channel are located are used in conjunction with dynamic parameters to increase the slope of the quantization formula. This can adaptively expand the data range and the differences between channels according to different images, thereby maintaining the color. At the same time, the mean of the image histogram is used as a brightness compensation factor to ensure that each input image can maintain good brightness and also avoid negative pixel values.

[0090] The specific process of extracting the reflection components of the red channel R, green channel G, and blue channel B based on the improved MSR algorithm and quantizing them back into an RGB image to obtain the first red channel R1, the first green channel G1, and the first blue channel B1 includes:

[0091] a. Perform a logarithmic operation on the input image to be enhanced, img1, to obtain a logarithmic image;

[0092] b. Apply Gaussian blur to the logarithmic image at three different scales to obtain three low-frequency images;

[0093] c. Calculate the difference between the image to be enhanced (img1) and the three low-frequency images respectively, and then sum them up in a weighted manner;

[0094] d. Quantize the logarithmic image to an RGB image using the improved quantization formula.

[0095] Preferably, after enhancing image details, it is also necessary to stretch the image colors. Histogram equalization can effectively stretch colors. Histogram equalization adjusts the distribution (probability density) of the histogram to a uniform distribution. Global histogram equalization considers the overall contrast of the image. When there are large variations in grayscale values ​​between bright and dark areas in the image, the effect of global histogram equalization is not good and it will enhance background noise. To solve these two problems, researchers proposed adaptive histogram equalization to solve the global problem, and contrast-limited histogram equalization to solve the problem of background noise enhancement. Combining the two forms the contrast-limited adaptive histogram equalization algorithm (CLAHE).

[0096] In the classic CLAHE algorithm, the luminance channel of the image is usually equalized, or the three RGB channels of the image are equalized separately and then merged. However, this approach has little effect on cervical cancer images. This invention, based on the characteristic that the human body has different absorption capabilities for different wavelengths of light, applies the CLAHE algorithm to the G and B channels, and then merges them with the original R channel to enhance the color stretching effect. Furthermore, in the classic CLAHE algorithm, the contrast limiting parameter clipLimit is a fixed value. However, the lesion areas in cervical cancer images are variable, while the overall color is relatively uniform. Using a fixed contrast limiting parameter can lead to insufficient or excessive color stretching. Extensive experimental observation revealed that the degree of color stretching required is directly proportional to the mean value of the R channel pixels. Therefore, this invention uses the mean value of the R channel pixels to control clipLimit, achieving a good color stretching effect.

[0097] The specific process of performing CLAHE on the first green channel G1 and the first blue channel B1 to obtain the second green channel G2 and the second blue channel B2 is as follows:

[0098] a. Divide the input first red channel R1, first green channel G1, and first blue channel B1 into multiple N*N region blocks, and use the region block as the unit for the next step;

[0099] b. Calculate the pixel mean r_mean of the first red channel R1;

[0100] c. Calculate the histograms of the first blue channel B1 and the first green channel G1;

[0101] d. Clip and equalize the histogram according to clipLimit = 0.01 * r_mean;

[0102] e. Traverse multiple N*N region blocks and perform bilinear interpolation between region blocks to obtain the second green channel G2 and the second blue channel B2.

[0103] Preferably, since noise is also amplified during image enhancement, image filtering and denoising are necessary. This algorithm uses a guided filter to filter the image after CLAHE processing. The guide image selects the input image, which helps preserve edge filtering. However, once an image is filtered, some details are inevitably lost. To preserve image details as much as possible, this invention performs multi-scale detail extraction on the CLAHE-processed image while performing guided filtering. Then, the detail information is amplified and weightedly fused with the filtered image to obtain a low-noise, detail-preserving image.

[0104] The most basic assumption of guided filtering is that the filtered output is a local linear transformation of the guided image, and for any position k in the image, the filtering window is ω. k Based on the above assumptions, the expression is as follows:

[0105] O i =a k ·G i +b k , i∈ω k (7)

[0106] Among them O i It is the output image, G i It is a guide image, a k and b k The solution formula is as follows:

[0107]

[0108]

[0109] Where Cov(·) represents covariance, Var(·) represents variance, ε is a control factor to avoid errors caused by a zero denominator, and mean(·) represents the mean. Combining formulas (7)-(8), the filtered image img3 can be obtained.

[0110] The second blue channel (B2) and the second green channel (G2) are filtered using three Gaussian filters of different scales to obtain the second image (img3). The differences between the second blue channel (B2) and the second green channel (G2) are calculated to obtain detail information at different scales, which are then weighted and fused. The detail images of the second blue channel (B2) and the second green channel (G2) are then magnified by a factor of 2 to obtain the third image (img4). Finally, the second image (img3) and the third image (img4) are weighted and fused to fill in the details of the second image (img3).

[0111]

[0112]

[0113] B5=αB3+(1-α)(2·B4) (12)

[0114] G5=αG3+(1-α)(2·G4) (13)

[0115] I img5 =merge(B5,G5,R3) (14)

[0116] Among them B i G i R i They represent imgi The corresponding color channel, Gu k Represents the Gaussian kernel, ω k These are the weighting coefficients for fusing detailed information at different scales. Here, ω1, ω2, and ω3, corresponding to the filter kernel from smallest to largest, are 0.2, 0.3, and 0.5 respectively. k represents different scales, and α represents the weighting coefficient. The experimental value here is 0.8. img5 This represents the image after filtering and detail fusion, and merge(·) indicates merging channels.

[0117] After the preceding processing, the image colors are stretched, details are enhanced, and noise is reduced, resulting in a clearer image. However, due to limitations in the acquisition methods, conditions, and equipment used for cervical cancer images, the brightness of some images is not optimal. To further optimize the visual effect, it is necessary to correct the image brightness. This algorithm employs an adaptive gamma algorithm to correct the image brightness.

[0118] Gamma correction applies a non-linear operation to the grayscale values ​​of an input single-channel image, making the grayscale values ​​of the output image exponentially related to the grayscale values ​​of the input image. The specific formula is shown below:

[0119] f(I)=I γ (15)

[0120] Where f(I) is the output image, I is the output image, and γ is the gamma parameter, the value of which directly affects the effect of gamma correction. When γ < 1, the dynamic range increases in the low gray-level region, thus enhancing the image contrast; in the high gray-level region, the dynamic range decreases, and the overall image contrast decreases; when γ > 1, the dynamic range decreases in the low gray-level region and increases in the high gray-level region, reducing the contrast in the low gray-level region and increasing the contrast in the high gray-level region, while the overall gray-level of the image decreases.

[0121] When performing gamma correction, the γ value varies for different images. Manually adjusting the γ parameter value for each image is extremely time-consuming and labor-intensive. Therefore, this embodiment of the invention employs adaptive gamma correction. That is, assuming that the mean X of all pixels (after normalization) in a reasonable image is around θ, then the gamma value of automatic gamma correction should make the target image move towards this target.

[0122] X γ =θ (16)

[0123] γ = log X θ (17)

[0124] Where X is the normalized mean of all pixels in the image, θ is a reasonable setting value, which is set to 0.5 in this embodiment, and γ is the gamma parameter, which is determined by X and θ.

[0125] After converting the fused image img5 to HSV space, adaptive gamma correction is performed on the V channel according to formulas (15)-(17) to obtain a brighter and clearer output image.

[0126] like Figure 2(a)-Figure 2(b) These are comparison images of the experimental results of various classic algorithms and the present invention. From (a) to (b), they are the original image, the result of the present invention, the result of CLAHE, the result of the Automatic Color Balance (ACE) algorithm, the result of the MSR algorithm, and the result of the MSR algorithm with color restoration. The comparison shows that the image quality processed by the algorithm proposed in this invention is better.

[0127] An image enhancement system based on improved MSR and CLAHE is provided to implement any of the aforementioned image enhancement methods based on improved MSR and CLAHE, such as... Figure 3 As shown, the system includes:

[0128] The channel separation module is used to separate the input image to be enhanced into the red channel R, green channel G, and blue channel B;

[0129] The image detail enhancement module is used to extract the reflection components of the red channel R, green channel G, and blue channel B based on the improved MSR algorithm and quantize them back into an RGB image to obtain the first red channel R1, the first green channel G1, and the first blue channel B1.

[0130] The color stretching module is used to perform CLAHE on the first green channel G1 and the first blue channel B1 to obtain the second green channel G2 and the second blue channel B2.

[0131] The first channel merging module is used to merge the first red channel R1, the second green channel G2, and the second blue channel B2 into a first image img2;

[0132] The image fusion module is used to perform guided filtering on the first image img2 to obtain the second image img3, and to use a multi-scale method to magnify the details of the first image img2 to obtain the third image img4; the second image img3 and the third image img4 are fused into the fourth image img5.

[0133] The color model conversion module is used to convert the fourth image img5 to the HSV color space and perform adaptive gamma correction on the V channel.

[0134] The image output module merges the H channel, S channel, and V channel after adaptive gamma correction in the HSV color space to obtain an enhanced image and output it.

[0135] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image enhancement method based on improved MSR and CLAHE, characterized in that, Includes the following steps: The input image to be enhanced is separated into red, green, and blue channels; Based on the improved MSR algorithm, the reflection components of the red channel, the green channel, and the blue channel are extracted and quantized back into an RGB image to obtain the first red channel, the first green channel, and the first blue channel; CLAHE is performed on the first green channel and the first blue channel to obtain the second green channel and the second blue channel; The first red channel, the second green channel, and the second blue channel are merged into a first image; The first image is subjected to guided filtering to obtain the second image, and the detailed information of the first image is extracted and magnified using a multi-scale method to obtain the third image. The second image and the third image are then fused into the fourth image. The fourth image is converted to the HSV color space, and adaptive gamma correction is performed on the V channel; The H channel, S channel, and V channel after adaptive gamma correction in the HSV color space are merged to obtain the enhanced image and output it.

2. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The specific process of extracting the reflection components of the red, green, and blue channels based on the improved MSR algorithm and quantizing them back into an RGB image to obtain the first red channel, first green channel, and first blue channel includes: a. Perform a logarithmic operation on the input image to be enhanced to obtain a logarithmic image; b. Perform Gaussian blurring on the logarithmic image at three different scales to obtain three low-frequency images; c. Calculate the difference between the image to be enhanced and the three low-frequency images respectively, and then sum them up in a weighted manner; d. Quantize the logarithmic image to an RGB image using the improved quantization formula.

3. The image enhancement method based on improved MSR and CLAHE according to claim 2, characterized in that, The improved quantification formula is as follows: , in, This indicates three color channels. It is a dynamic parameter, with an experimental value of 500, where This represents the average pixel value of the input image. , and These represent the pixel values ​​where the peak values ​​are located in the histogram of the RGB channels of the image.

4. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The specific process of performing CLAHE on the first green channel and the first blue channel to obtain the second green channel and the second blue channel is as follows: a. Divide the input first red channel, first green channel, and first blue channel into multiple N... N region blocks, and use the region blocks as the unit for the next step; b. Calculate the pixel mean r_mean of the first red channel; c. Calculate the histograms of the first blue channel and the first green channel; d. Based on the contrast limiting parameter clipLimit=0.01 r_mean trims and equalizes the histogram; e. Traverse the multiple Ns For region blocks N, perform bilinear interpolation between region blocks to obtain the second green channel and the second blue channel.

5. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The process of obtaining the second image by performing guided filtering on the first image specifically includes: Perform guided filtering on the first image, assuming any position in the first image The filtering window is The expression is as follows: in It outputs an image. It is a guide image. and The solution formula is as follows: in To express the covariance, This indicates the calculation of variance. It is a control factor. This indicates that the mean value is being calculated.

6. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The third image is obtained by extracting detailed information from the first image using a multi-scale method and then magnifying it. Specifically, this includes: The second image is obtained by filtering the input second blue channel and second green channel using three Gaussian filters of different scales. The difference between the second blue channel and the second green channel is calculated to obtain detail information at different scales. Then, weighted fusion is performed to magnify the detail images of the second blue channel and the second green channel by 2 times to obtain the third image.

7. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The process of fusing the second image and the third image into a fourth image specifically includes: The second image and the third image are weighted and fused together to fill in the details of the second image: in , , They represent The corresponding color channel, Represents the Gaussian kernel. These are the weighting coefficients for fusing detailed information at different scales, where h represents different scales. Indicates the weighting coefficient. This represents the image after filtering and detail fusion. This indicates a merged channel.

8. The image enhancement method based on improved MSR and CLAHE according to claim 1, characterized in that, The adaptive gamma correction process for the V channel specifically includes: constructing adaptive gamma parameters and performing adaptive gamma correction on the V channel of the fourth image, as shown in the following formula: ; ; in, It is the normalized mean of all pixels in the image. This is a reasonable setting; it's set to 0.5 here. It is the gamma parameter, derived from and A joint decision.

9. An image enhancement system based on improved MSR and CLAHE, characterized in that, The system for implementing the image enhancement method based on the improved MSR and CLAHE as described in any one of claims 1-8, the system comprising: The channel separation module is used to separate the input image to be enhanced into red, green, and blue channels; The image detail enhancement module is used to extract the reflection components of the red channel, the green channel, and the blue channel based on the improved MSR algorithm and quantize them back into an RGB image to obtain the first red channel, the first green channel, and the first blue channel. The color adjustment module is used to perform CLAHE on the first green channel and the first blue channel to obtain a second green channel and a second blue channel; The first channel merging module is used to merge the first red channel, the second green channel, and the second blue channel into a first image; An image fusion module is used to perform guided filtering on the first image to obtain the second image, and to magnify the details of the first image using a multi-scale method to obtain the third image; and to fuse the second image and the third image into a fourth image. The color model conversion module is used to convert the fourth image to the HSV color space and perform adaptive gamma correction on the V channel. The image output module merges the H channel, S channel, and V channel after adaptive gamma correction in the HSV color space to obtain an enhanced image and output it.

Citation Information

Patent Citations

  • Endoscope image blood vessel enhancement algorithm based on improved weighted CLAHE

    CN112598607A

  • Image enhancement method and system based on brightness correction and fusion channel prior

    CN114627009A