Image enhancement method based on region decomposition and illumination guided filtering
Image enhancement methods using region decomposition and illumination-guided filtering solve the problem of uneven illumination in patient-taken images, improving image clarity and contrast to meet the quality requirements of doctors' diagnoses.
Patent Information
- Application Number
- CN202511728764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-24
- Publication Date
- 2026-02-27
AI Technical Summary
During telemedicine, uneven lighting or improper exposure in images taken by patients can lead to poor image quality, affecting the doctor's diagnostic results.
An image enhancement method based on region decomposition and illumination-guided filtering is adopted to improve image quality through steps such as mean filtering, illumination region segmentation, illumination compensation, multi-layer Gaussian pyramid detail enhancement, color correction, and Gamma correction.
It improves image clarity and contrast, overcomes blurring caused by uneven lighting, and ensures image quality meets the diagnostic needs of doctors.
Smart Images

Figure CN121582129A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of image processing, and particularly relates to an image enhancement method based on region decomposition and illumination guided filtering. BACKGROUND
[0002] In the actual photographing process, sometimes due to insufficient environmental light intensity or unreasonable exposure time design of the camera equipment, the obtained image appears uneven illumination or low overall brightness. Especially in the process of remote medical treatment, many pictures of sick parts are taken by patients and then transmitted to doctors, and the non-professional photographing of the patients can easily lead to uneven light intensity or unreasonable exposure time, resulting in poor picture quality. The quality of the picture can easily affect the judgment of the doctor on the disease, and therefore an image processing method is needed to process the related pictures to obtain pictures with high quality, so as to facilitate the diagnosis of the doctor. SUMMARY
[0003] To solve the above problems, the application discloses an image enhancement method based on region decomposition and illumination guided filtering.
[0004] To achieve the above purpose, the technical scheme of the application is as follows: An image enhancement method based on region decomposition and illumination guided filtering, comprising the following steps: S1: performing mean filtering on the image to obtain a filtered image; S2: dividing the filtered image into an illumination sufficient region and an illumination insufficient region according to the illumination intensity ratio; S3: performing illumination compensation on the illumination sufficient region and the illumination insufficient region respectively to obtain a global enhanced image; S4: performing detail enhancement on the global enhanced image by using a multi-layer Gaussian pyramid to obtain an enhanced image; S5: performing color correction on the enhanced image to obtain a color-corrected image; S6: applying Gamma correction to the color-corrected image to obtain an enhanced image.
[0005] Further improvement, in step S1, the mean filtering method is as follows: (1); Wherein, represents a pixel point A of the filtered calculation result, represents A the pixel value of the th point in the neighborhood range of the point, represents the number of pixel points in the neighborhood.
[0006] Further improvement, the specific steps of step S2 are as follows: S2.2, according to the theory of Retinex, it is considered that the image is generated by the joint action of incident light and object surface properties: (2); Among them, represent the image, represent the incident light, represent the object surface properties, indicates the coordinates of the pixel point. Therefore, it can be; (3); Among them: denotes The illumination variation coefficient of the pixel point with coordinates ; S2.2, all the pixel points with ≥1 are combined to form an area as an area with sufficient illumination, and the rest is an area with insufficient illumination.
[0007] Further improvement, step S3 includes the following steps: S3.1, the pixel value of the area with sufficient illumination is suppressed, and the specific calculation is as follows: (4); Among them: and are the pixel values before and after processing respectively, is a coefficient, indicates the coordinates of the pixel point; S3.2, for the area with insufficient illumination, a filter is set to guide the pixel point to obtain information from the brighter position within the neighborhood b, and the formula is as follows: (5); Among them: is the filtering result, is the value of the pixel point in the neighborhood, is the filter weight, is the selection coefficient, represents the position serial number of the pixel point in the neighborhood. The formula indicates that if the current point is less than the center point , the filtering weight is 0, otherwise it is 1; S3.3, combine the compensated area with sufficient illumination and the compensated area with insufficient illumination to obtain a global image, and finally limit the dynamic range of the global image to obtain a global enhanced image by the following formula: (6); (7); (8); wherein: , respectively represent the lower limit of pixel value, the upper limit of pixel value, the mean value and the variance before limiting the dynamic range, the compensated pixel value, is a coefficient, and represents the intensity of controlling the dynamic range.
[0008] Further improvement, 。
[0009] Further improvement, the steps of step S4 are as follows: S4.1, input the global enhanced image into the multi-layer Gaussian pyramid, the multi-layer Gaussian pyramid is sequentially subjected to three times of Gaussian down-sampling, and then sequentially subjected to three times of Gaussian up-sampling to obtain an image set , respectively are the first Gaussian down-sampled image, the second Gaussian down-sampled image and the third Gaussian down-sampled image, the Gaussian down-sampling refers to deleting odd rows and odd columns of the original image to obtain an image with a size reduced by half, and then performing Gaussian filtering on the image with the size reduced by half; the Gaussian up-sampling refers to inserting a column vector full of 0 between columns and columns of the image, and inserting a row vector full of 0 between rows and rows to obtain an image with a size doubled, and performing Gaussian filtering on the image with the size doubled; S4.2, calculate to obtain an image information set: (9); wherein: is a weight, represents the image information set of different scales, respectively represent the image information under three different scales; S4.3, calculate to obtain a detail image: (10); wherein: and respectively represent the detail information of three different scales, refers to the input image; namely, the up-sampling calculation; S4.4, feature information fusion: (11); (12); wherein: respectively refer to three coefficients, refers to the output image, namely the enhanced image, The input image, i.e. the global enhanced image, The sign function, when >0, = 1; The sign function, when = 0 The sign function, when =0; The sign function, when <0 The sign function, when = -1.
[0010] Further improvement, the specific steps of step S5 are as follows: S5.1, the proportion of the RGB value of a pixel value in the image obtained after the steps S1~4 is , The proportion of the RGB value of the pixel before processing is RGB , The calculation is as follows: (13); Wherein: The red channel weight ratio is The blue channel weight ratio is The green channel weight ratio is The red channel correction coefficient is The blue channel correction coefficient is The green channel correction coefficient is The natural logarithm is S5.2, 2) after calculating the transformation coefficient, the corrected RGB proportion is calculated: (14); The RGB proportion of the pixel point is replaced by , That is, the image after color correction can be obtained.
[0011] Further improvement, step S6 includes the following steps: S6.1, normalization, the pixel value is converted to a value between 0 and 1, that is: (15); wherein: The converted pixel value is The original pixel value is S6.2, solve the pixel value after nonlinear change, as follows: (16); Wherein: The pixel value after nonlinear change is The value is the normalized value. Gamma value ; S6.3, Inverse Normalization: Based on the calculation results of S6.2, the pixel values are transformed to the range of 0~255, that is: (17); The final image is the enhanced version.
[0012] Advantages of this invention: This invention divides an image into well-lit and poorly lit areas based on the ratio of light intensity, then performs pixel suppression or filtering on each area, followed by detail enhancement, color correction, and gamma correction, resulting in a clearer image and overcoming problems such as image blurring caused by uneven lighting. Attached Figure Description
[0013] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 The images shown are the results of the processing, where: (a1) is the original image at the first position; (b1) is the enhanced schematic diagram at the first position; (a2) is the original image at the second position; (b2) is the enhanced schematic diagram at the second position; (a3) is the original image at the third position; (b3) is the enhanced schematic diagram at the third position; (a4) is the original image at the fourth position; and (b4) is the enhanced schematic diagram at the fourth position. Detailed Implementation
[0014] The present invention will be further described below with reference to the accompanying drawings and embodiments. Example
[0015] like Figure 1 As shown, this is an image enhancement technique based on region decomposition and illumination-guided filtering according to the present invention. The method includes the following steps: S1: Preprocessing images of poor quality. In practical applications, sometimes insufficient ambient light or improper exposure time design of the camera equipment can lead to uneven lighting or low overall brightness in the obtained images, such as... Figure 2 As shown in images a1 (original image at the first position), a2 (original image at the second position), a3 (original image at the third position), and a4 (original image at the fourth position), in areas of low brightness, the signal-to-noise ratio drops significantly, and the impact of noise becomes more pronounced. To reduce the adverse effects of noise and improve the image enhancement effect, it is necessary to preprocess the image. The specific steps are as follows: S1.1 Perform mean filtering: (1); in, representing a certain point A the result of the filtering calculation, representing A the pixel value of a point in the neighborhood range of the point, representing the number of pixel points in the neighborhood. In general, it is A the filtering result of A the average of the pixel values of other points in the neighborhood of
[0016] S2: In the image with poor light quality, sometimes there are both sufficient and insufficient light areas. If the same intensity enhancement scheme is used for both areas, it is difficult to balance the enhancement effect of both, so it is necessary to decompose the two areas to facilitate further enhancement. The specific operation steps are as follows: S2.1, according to formula (2~3) to calculate the light intensity ratio : (2); (3); wherein: is the reflected light, is the incident light, representing the coordinates of the point, the light intensity ratio .
[0017] S2.2, according to appendix formula (18)~(24), the relationship between the light intensity ratio and 1 can be used as the basis for division. The area with light intensity ratio greater than or equal to 1 is the sufficient light area, and the rest is the insufficient light area. That is, when ≥1 it is considered to be a light area, otherwise it is an insufficient light area. Compared with the commonly used threshold segmentation method or similar segmentation method such as Otsu method, this method has strong physical meaning, and the accuracy of segmentation is also higher.
[0018] S3: This step is a light compensation step, different compensation methods need to be taken for sufficient light area and insufficient light area, the specific steps are as follows: S3.1, for the sufficient light area: the pixel value in the area needs to be suppressed, the specific calculation is as follows: (4); wherein: and respectively process the pixel values before and after, representing the position, is the coefficient, the coefficient selected in this paper is 0.7.
[0019] S3.2, for the light deficient area, set a special filter structure, guide the pixel points from the neighborhood of the rest of the brighter location to obtain information, the formula is as follows: (5); Among them: is the filter result, is the value of the pixel point in the neighborhood, is the filter weight, is the selection coefficient, if the current point is less than the center point 0, otherwise 1, i is the position in the field b . Essentially a filter with selection, through the pixel point comparison screening, get the pixel information of the brighter place, improve the enhancement effect of the light deficient area; S3.3, combine the two regions to get the global enhanced picture, finally limit its dynamic range by the following formula: (6); (7); (8); Among them: , respectively represent the lower limit of the changed pixel value, the upper limit of the pixel value, the mean and variance before limiting the dynamic range, is the coefficient, control the dynamic range, this paper selects =3。
[0020] S4: based on the multi-layer Gaussian pyramid to extract the multi-scale detail information, through the detail feature fusion technology to realize the detail enhancement of the image. Because a large number of filter calculation is used in S1~S3, including mean filter and Gaussian filter, it is inevitable to cause the loss of detail information of the image. In order to make the image have good clarity and contrast, it is necessary to carry out detail enhancement operation on the image, the specific operation is as follows: S4.1, three times of Gaussian down sampling is carried out on the input image, and then three times of Gaussian up sampling is carried out, to obtain the image set Because the size is too small, restoring to the original size will lose a lot of information, so p4 is discarded. Here, Gaussian down sampling means deleting the odd rows and odd columns of the original image to obtain an image with half size, and then carrying out Gaussian filtering on the image; Gaussian up sampling means inserting a column vector of all 0 between the columns and columns of the image, and inserting a row vector of all 0 between the rows and rows to obtain an image with double size, and then carrying out Gaussian filtering on the image.
[0021] S4.2, calculate the image information set: (9); wherein: is the weight, and 0.5 is selected herein. denotes a set of image information of different scales, denotes image information of three different scales, respectively.
[0022] S4.3, calculate the detail map: (10); wherein: and denote detail information of three different scales, respectively, denotes the input image. Since is obtained by combining image information after Gaussian down-sampling, the image size is inconsistent with the input image. In order to extract feature information, Gaussian up-sampling is performed to meet the size requirement, i.e., the up-sampling calculation.
[0023] S4.4, feature information fusion, the feature information extracted in S4.1-S4.3 is re-fused into the image to achieve the purpose of detail enhancement: (11); (12); wherein: denote three coefficients, respectively, denotes the output image, denotes the input image.
[0024] S5: color correction. Since the calculation process of S1-S4 does not consider the original color distribution of the image, it is very likely to cause color distortion. In order to have a better representation of the image in color, it is necessary to perform color correction, the specific calculation is as follows: S5.1, for convenience of explanation, take a point A as an example, the proportion of the RGB value of the untreated image corresponding to the A point is At the same time, the proportion of the RGB value of the image after S1-S4 processing at the A point position is R, G, B, The calculation is as follows: (13); S5.2, after calculating the transformation coefficient, the corrected RGB proportion is calculated: (14).
[0025] S6: GAMMA correction enhances the overall effect, since the enhancement effect of S1-S4 is for local area, different area fusion will appear visual demarcation between different areas (light sufficient area and light insufficient area), thereby affecting the overall visual effect, therefore, it is necessary to apply Gamma correction to reduce the demarcation between areas, the specific operation steps are as follows: S6.1, normalization, the pixel value is converted to a value between 0 and 1, that is: (15); wherein: is the converted pixel value, is the original pixel value; S6.2, solve the pixel value after nonlinear change, as follows: (16); wherein: is the pixel value after nonlinear change, is the normalized value after S6.1 step, is the Gamma value, ;
[0026] de-normalization, according to the calculation result of S6.2, the pixel value is converted to the range of 0-255, that is: (17); the final enhanced image is obtained, as shown in Figure 2 .
[0027] Although the embodiments of the present application have been disclosed as above, it is not limited to the application listed in the specification and the embodiments, it can be fully applied to various fields suitable for the present application, and for those skilled in the art, other modifications can be easily realized, therefore, the present application is not limited to specific details and the figures shown and described herein, without departing from the general concept defined by the claims and the equivalent scope.
Claims
1. An image enhancement method based on region decomposition and illumination oriented filtering, characterized in that, It comprises the following steps: S1: mean filtering is performed on the image to obtain a filtered image; S2: the well-lit area and the insufficiently-lit area in the filtered image are divided according to the light intensity ratio; S3: the well-lit area and the insufficiently-lit area are respectively subjected to light compensation to obtain a globally enhanced image; S4: the globally enhanced image is subjected to detail enhancement by using a multi-layer Gaussian pyramid to obtain an enhanced image; S5: the enhanced image is subjected to color correction to obtain a color-corrected image; S6: the color-corrected image is subjected to Gamma correction to obtain an enhanced image.
2. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, In step S1, the mean filtering method is as follows: (1); wherein, represents a pixel point A the result of the filter calculation, represents A the pixel value of the point in the neighborhood of the point, represents the number of pixel points in the neighborhood.
3. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, The specific steps of step S2 are as follows: S2.1: according to the theory of Retinex, it is believed that the image is jointly generated by incident light and object surface properties: (2); wherein: representing an image, representing incident light, representing object surface properties, denotes the coordinates of a pixel point; The following expression is obtained: (3); wherein: S2.2: the correctness and feasibility of the area division in step S2: the illumination variation coefficient of the pixel point with coordinates the illumination variation coefficient of the pixel point with coordinates S2.2, region decomposition, specifically: all the pixel points with the value of S2.1≥1 form a region as a well-lit region, and the rest are insufficiently-lit regions; the region composed of the pixel points with the value of S2.1≥1 is a well-lit region, and the rest are insufficiently-lit regions; Suppose that there is a point light source in the center of a space, and for the convenience of subsequent calculation, the position of the point light source is (0, 0); the point light source emits light to the surrounding with a distance that continuously decays, and the light intensity is inversely proportional to the distance; according to the Retinex formula, the light of the center point is estimated as the result of Gaussian filtering of the point, so there is the following expression: Further: (4); And estimate the illumination for the point, for a neighborhood centered at the point, is a Gaussian filter, is a convolution computation; Therefore, the reflectivity at this point is as follows: (5); wherein: At any position, there is the following formula: respectively represent in-neighborhood pixel value of a position and filter weight, neighborhood is the area covered by the filter, since the Gaussian filter has , and when the center point is a light source, since the brightness of other points must be lower than the center point, therefore: (19); wherein: is the center point, here the light source, is the reflection value of this point, At the same time, since the weights of the Gaussian filters corresponding to the two points about the center symmetry are the same, the reflectivity of the point can be changed to: (19); Obviously, when moving away from the center point, the reflectivity changes from greater than 1 to less than 1; (20); When the point is far enough from the light source, suppose the other two points in the neighborhood ), and are symmetric about the center point in the neighborhood; since the light intensity is inversely proportional to the square of the distance, the light intensity at this point is proportional to the center point: (21); (22); Since the point is extremely far from the light source, at this time , so it can be considered , simplified as follows: (23); It can be seen that when the point When far enough from the light source, for two points symmetric about the center point, the sum of the ratios of their light intensity to that of the center point is greater than 2. Therefore, the physical and mathematical reasoning proves that the reflectivity can be used as a basis for dividing the insufficiently-lit area and the well-lit area. (24); wherein: is a point about the center point a point of symmetry; Step S3 comprises the following steps: S3.1: the pixel value of the well-lit area is suppressed, and the specific calculation is as follows:
4. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, S3.3: the compensated well-lit area and the compensated insufficiently-lit area are combined to obtain a global image, and finally the dynamic range of the global image is limited to obtain a globally enhanced image by the following formula: The steps of step S4 are as follows: (4); wherein: and respectively process the pixel values before and after, is a coefficient, denotes the coordinates of the pixel point; S3.2, For the light insufficient area, set filter, guide pixel point to obtain information from the neighborhood brighter position, the formula is as follows: (5); wherein: is a filtering result, is a value of a pixel point in a neighborhood, is a filter weight, is a selection coefficient, represents a position serial number of a pixel point in the neighborhood. If the current point is less than the center point 0 if the current point is less than the center point, otherwise 1; S4.2: the image information set is calculated: (6); (7); (8); wherein: and respectively represent the compensated lower limit of pixel value, upper limit of pixel value, mean value before limiting dynamic range, and variance; is a coefficient, and represents the intensity of controlling dynamic range.
5. The image enhancement method based on region decomposition and light oriented filtering of claim 4, wherein, 。 6. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, S4.3: the detail map is calculated: S4.1, input the global enhanced image into a multi-layer Gaussian pyramid, the multi-layer Gaussian pyramid is sequentially subjected to three times of Gaussian down-sampling, and then sequentially subjected to three times of Gaussian up-sampling to obtain an image set , respectively are a first time of Gaussian down-sampling image, a second time of Gaussian down-sampling image and a third time of Gaussian down-sampling image, the Gaussian down-sampling refers to deleting odd rows and odd columns of an original image to obtain an image with a size halved, and then performing Gaussian filtering on the image with the size halved; the Gaussian up-sampling refers to inserting a column vector all of which is 0 between columns and columns of an image, and inserting a row vector all of which is 0 between rows and rows to obtain an image with a size doubled, and performing Gaussian filtering on the image with the size doubled; S4.4: feature information fusion: (9); wherein: is a weight, denotes a set of image information of different scales, denotes image information at three different scales, respectively; sign(x)<0 (10); wherein: and respectively represent three different scales of detail information, denotes the input image; i.e. up-sampling calculation; The specific steps of step S5 are as follows: (11); (12); wherein: denote three coefficients, denotes the output image, i.e. the enhanced image, denotes the input image, i.e. the globally enhanced image, denotes the sign function, when > 0, = 1 when = 0 , =0 when RGB , = -1.
7. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, S5.2: after the transformation coefficient is calculated, the corrected RGB ratio is calculated: S5.1, the proportion of the RGB value of a pixel value in the image obtained after the steps of S1-S4 is , The pixel before processing Step S6 comprises the following steps: Channel proportions are respectively The calculation result is: (13); wherein: is a red channel weight ratio value, is a blue channel weight ratio value, is a green channel weight ratio value, is a red channel correction factor, is a blue channel correction factor, is a green channel correction factor, is a natural logarithm; S6.1: normalization, the pixel value is converted to a value between 0 and 1, i.e. (14); The RGB proportion of the pixel point is replaced by , The image after color correction is obtained.
8. The image enhancement method based on region decomposition and light oriented filtering of claim 1, wherein, S6.2: the pixel value after nonlinear change is solved, as follows: S6.3: denormalization: according to the calculation result of S6.2, the pixel value is converted to the range of 0~255, i.e. (15); wherein: is the transformed pixel value, is the original pixel value; Finally, the enhanced image is obtained. (16); wherein: is the pixel value after non-linear change, is the normalized value, is the Gamma value, ; (17);