A method for enhancing image contrast
By employing adaptive sliding window technology and grayscale transformation curves, the shortcomings of existing technologies in enhancing low-frequency information in head images are addressed. This enables adaptive enhancement of head CT images, highlighting gray and white matter and other details, while simplifying algorithm complexity and parameter dependencies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FMI MEDICAL SYST CO LTD
- Filing Date
- 2022-09-28
- Publication Date
- 2026-05-26
AI Technical Summary
Existing image enhancement algorithms struggle to adaptively enhance low-frequency information, especially gray matter and other details, when processing medical head images, and are highly complex and dependent on parameters.
Adaptive sliding window technology is used to automatically determine enhancement parameters x1 and x2 through grayscale transformation curves. Combined with low-frequency filtering and image fusion, local enhancement is achieved, which is suitable for low-frequency image processing of head CT images.
An adaptive low-frequency enhancement of skull images was achieved, highlighting gray matter and other details. The algorithm was simplified, the dependence on parameters was reduced, and the effect was significant.
Smart Images

Figure CN115482172B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method and system for enhancing image contrast. Background Technology
[0002] Image enhancement algorithms are post-processing techniques applied to images acquired by imaging devices. Their purpose is to improve the overall and partial contrast of an image, while suppressing noise and increasing the signal-to-noise ratio to highlight specific image information of interest to the observer. Enhancement techniques are problem-oriented; different problems require different algorithms, and the observer is the ultimate evaluator of these algorithms.
[0003] Some enhancement algorithms significantly alter the overall pixel values of an image, potentially leading to image distortion, such as histogram equalization. Others focus on enhancing high-frequency information by sharpening contours and boundaries to improve contrast, such as fractional-order differential algorithms. Still others, while effective, are complex and resource-intensive, such as wavelet transform-based image enhancement. None of these algorithms meet the processing requirements for medical head and skull images.
[0004] Most enhancement algorithms improve contrast by enhancing high-frequency information in an image, such as the contour details of tissue structures. This method is not suitable for processing head images. Some algorithms are also suitable for head image processing, achieving low-frequency enhancement, but their applicability is limited (e.g., only for enhancing gray-white matter contrast), and their effectiveness depends on parameter adjustments. Summary of the Invention
[0005] In order to overcome the above-mentioned technical defects, the purpose of this invention is to provide an adaptive method and system for enhancing image contrast by performing low-frequency image enhancement processing on skull images.
[0006] This invention discloses a method for enhancing image contrast, comprising the following steps: acquiring an input image I in The target region for the input image I in Low-frequency filtering is performed to obtain the low-frequency image I. f Based on the low-frequency image, a sliding window with a width of ω is set; the low-frequency image is enhanced by a grayscale transformation curve to obtain the enhanced low-frequency image I. f-ce The grayscale transformation curve is in win mid x1 and x2 are calculated together, where k is the curvature of the curve; the center of the sliding window sequentially passes through each pixel on the low-frequency image, and x1 and x2 are obtained based on the pixel values that the sliding window passes through during its sliding process and are located within the target area; through the low-frequency image If and the enhanced low-frequency image I f-ce Obtain enhanced pre-image I ce The enhanced pre-image I ce With the input image I in The images are fused to obtain the enhanced output image I. out .
[0007] Preferred, win mid The midpoint of the grayscale transformation curve within the range [x1, x2] is...
[0008] Preferably, the center of the sliding window sequentially traverses each pixel on the low-frequency image. Obtaining x1 and x2 based on the pixel values traversed by the sliding window during its sliding process and located within the target region includes: obtaining the maximum value p of the pixel values traversed by the sliding window during its sliding process and located within the target region. max and minimum value p min Then x1 = α·p min x2=β·p max ; α∈[0,1], β∈[0,1].
[0009] Preferably, the center of the sliding window sequentially passes through each pixel on the low-frequency image. Obtaining x1 and x2 based on the pixel values traversed by the sliding window during its sliding process and located within the target region includes: performing median filtering on the pixel values traversed by the sliding window during its sliding process and located within the target region, and denoting the resulting median as win. mid ; will median win mid Subtract a preset value 'a' to get x1, and add a preset value 'b' to get x2.
[0010] Preferably, the center of the sliding window sequentially traverses each pixel on the low-frequency image. Obtaining x1 and x2 based on the pixel values traversed by the sliding window during its sliding process and located within the target region includes: performing C-means clustering on the pixel values traversed by the sliding window during its sliding process and located within the target region to obtain two cluster centers, the two cluster centers serving as [x1, win...]. mid ] and [win mid The center value of [x2].
[0011] Preferably, the low-frequency image I is used f and the enhanced low-frequency image I f-ce Obtain enhanced pre-image I ce The enhanced pre-image I ce With the input image Iin The images are fused to obtain the enhanced output image I. out It also includes: the enhanced pre-image I ce Smoothing process is performed to obtain a smoothed image I s ; the smoothed image I s With the input image I in The images are fused to obtain the enhanced output image I. out .
[0012] Preferably, the step of setting a sliding window with a width of ω based on the low-frequency image includes: for the low-frequency image, there are several displayable ranges; one of the displayable ranges is selected as the target display range, and the remaining display ranges are other display ranges; the target display range has a size of D1 and a matrix size of M1×M1; the other display ranges have a size of D2 and a matrix size of M2×M2, and the window width ω of the sliding window is ω=λ·ω p ,in ω p The window width when the target display area is defined.
[0013] Preferably, the step of acquiring the input image I in The target area includes: the area within a preset threshold is excluded by using a threshold method to obtain the target area; the area within the preset threshold includes air area and bone area.
[0014] Preferably, the grayscale transformation curve is in win mid The curvature k of the curves at both ends is different.
[0015] The present invention also discloses an image contrast enhancement system for implementing the steps of the image contrast enhancement method.
[0016] Compared with existing technologies, the above technical solution has the following advantages:
[0017] 1. Compared to existing technologies that enhance high-frequency information such as image contours and details, are based on empirical values, and provide global enhancement with symmetrical and discontinuous grayscale changes, this invention processes low-frequency information in the image, not just gray and white matter. This invention can automatically determine the enhancement parameters x1 and x2 through the grayscale transformation curve using pixel information captured by the sliding window, reducing dependence on image state and specific parameters. The sliding window provides strong local enhancement; and because the window is sliding, the grayscale changes in the image can be asymmetrical and continuous.
[0018] 2. A contrast enhancement algorithm applicable to head CT images can adaptively enhance low-frequency images of the head. It enhances not only gray and white matter but also other information, especially highlighting information such as brain sulci and gyri that are not prominently displayed; the algorithm is simple, has low parameter dependence, and achieves good results. Attached Figure Description
[0019] Figure 1 A flowchart of the image contrast enhancement method provided by the present invention;
[0020] Figure 2 A schematic diagram of the sigmoid curve on which the grayscale transformation curve provided by the present invention is based;
[0021] Figure 3 An unenhanced image;
[0022] Figure 4 The image is an enhanced image obtained by the image contrast enhancement method of the present invention. Detailed Implementation
[0023] The advantages of the present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments.
[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0025] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0026] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0027] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0028] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0029] In the following description, suffixes such as "module," "part," or "unit" used to denote elements are used only for the convenience of the description of the invention and have no specific meaning in themselves. Therefore, "module" and "part" can be used interchangeably.
[0030] See appendix Figure 1-2 This invention discloses a method for enhancing image contrast. First, the input image is low-pass filtered to obtain the low-frequency image. The enhancement process is then performed on this low-frequency image. Next, an adaptive sliding window is set according to the image parameters. Based on the CT value distribution within the window, the parameters of the enhancement curve are calculated to enhance the center pixel value. Then, local enhancement is continuously performed as the window slides, ensuring that details within the specified parameters are enhanced. Furthermore, this enhancement method is based on the image's grayscale transformation curve, maintaining continuity between the enhanced and non-enhanced regions at the boundary. The range and magnitude of the increase and decrease in the CT value within the enhanced region can be asymmetrical. Specifically, the method includes the following steps:
[0031] S100, Obtain the input image I in The target region for the input image I in Low-frequency filtering is performed to obtain the low-frequency image I. f ;
[0032] S200, A sliding window with a width of ω is set based on low-frequency images;
[0033] S300. Enhance the low-frequency image using a grayscale transformation curve to obtain the enhanced low-frequency image I. f-ce The grayscale transformation curve is in win midx1 and x2 are calculated together, and k is the curvature of the curve. The center of the sliding window moves sequentially across each pixel on the low-frequency image. x1 and x2 are obtained based on the pixel values that the sliding window passes through during the sliding process and are located within the target area.
[0034] S400, via low-frequency image I f and enhanced low-frequency image I f-ce Obtain enhanced pre-image I ce , will enhance the pre-image I ce With input image I in The images are fused to obtain the enhanced output image I. out .
[0035] For step S100, the input image I is typically acquired. in One method for identifying the target region is the thresholding method. This involves pre-setting several thresholds and excluding regions within those thresholds to obtain the target region. In head scans, the regions within the pre-set thresholds can include, but are not limited to, air regions and bone regions. The target region can also be a soft tissue region. Simultaneously, low-frequency filtering is applied to the input image, and subsequent enhancement operations focus on enhancing the low-frequency image.
[0036] For step S200, it is necessary to set an appropriate sliding window size, i.e., window width ω. Here is a preferred method: for low-frequency images, there are several displayable ranges. One of these displayable ranges is selected as the target display range, and the remaining displayable ranges are considered other display ranges. For example, a low-frequency image may have display ranges of 250mm and 150mm. If the 250mm display range is selected as the target display range, then the 150mm display range is considered another display range.
[0037] If the target display area has a size of D1 and a matrix size of M1×M1, and the other display areas have a size of D2 and a matrix size of M2×M2, then the window width ω of the sliding window is ω=λ·ω p ,in ω p This refers to the window width when the target display area is defined. Based on the example above (where only the target display area is determined and other display areas are uncertain), then...
[0038] By setting the size of the sliding window as described above, the image enhancement effect can be guaranteed to be consistent under various conditions.
[0039] Step S300 primarily involves adaptively determining the enhancement parameter values within a sliding window. First, the grayscale transformation curve is described: Where x0 is the midpoint of the range of parameter x, p is the maximum value the curve can reach, and k controls the amplitude of the curve's change. For example, to perform grayscale stretching on data within the range [x1, x2], the midpoint of the curve is... And if the stretched value is still within the range of [x1, x2], then the grayscale transformation curve can be expressed as follows: in
[0040] Normally, win mid The midpoint of the grayscale transformation curve within the range [x1, x2] is... But win also exists mid The case where the value is not the midpoint of the grayscale transformation curve within the range [x1, x2], i.e., [x1, win...] mid ] and [win mid The widths of x2 and x3 are not the same.
[0041] Therefore, for the aforementioned grayscale transformation curve, the shape of the curve needs to be determined by x1 and x2. In this invention, the settings of x1 and x2 are determined based on the statistical results of the CT values within the sliding window. Specifically, the statistical results of the CT values are obtained by sequentially sliding the center of the sliding window across each pixel on the low-frequency image and statistically analyzing the pixel value distribution within the target area under each window.
[0042] Furthermore, based on the statistical results of CT values, the following methods can be used to obtain parameters x1 and x2.
[0043] The first method involves obtaining the maximum value p of the pixels that the sliding window passes through during its sliding process and that are located within the target area. max and minimum value p min Then x1 = α·p min x2=β·p max ; α∈[0,1], β∈[0,1].
[0044] The second method involves performing median filtering on the pixel values that the sliding window passes through during its sliding process and are located within the target area. The resulting median value is denoted as win. mid ; will median win mid Subtract a preset value 'a' to get x1, and add a preset value 'b' to get x2, which is the median win. mid Expand to the left and right by a certain width, which will be x1 and x2 respectively.
[0045] The third method involves performing C-means clustering on the pixel values that the sliding window passes through during its sliding process and are located within the target area, obtaining two cluster centers. These two cluster centers serve as [x1, win] mid ] and [win midThe center value of [x2].
[0046] After obtaining the grayscale transformation curve described above, this curve is applied to grayscale stretching to enhance image contrast. It can be seen that the CT value varies the most within the range [x1, x2]; and, with win... mid Centered on, [x1, win mid The CT value of [win] was improved. mid The CT value of x2] was reduced.
[0047] Win mid Consider it as the dividing point of the concave and convex curves at both ends. The functions on both sides of the dividing point are not necessarily symmetrical about that point. That is, the same expression can be used with curves of different rates of change (i.e., different k), and different expressions can also be used, as long as they remain continuous within the range of influence.
[0048] As the window moves, the curve parameters change, but the window information between adjacent pixels partially overlaps, so the change is continuous.
[0049] The size of the sliding window can be set. When the sliding window size is equal to the image size, the algorithm degenerates into traditional global processing, but the parameter settings of the curve are still better than traditional fixed value settings.
[0050] For step S400, via low-frequency image I f and enhanced low-frequency image I f-ce Obtain enhanced pre-image I ce I ce =I f -I f-ce Furthermore, to avoid artifacts at the edges of the target region after fusion, the enhanced pre-image I is also... ce Perform smoothing processing; the smoothing degree doesn't need to be too high, to obtain a smoothed image I. s I s =smooth(I ce Finally, smooth the image I. s With input image I in The images are fused to obtain the enhanced output image I. out I out =I in +I s .
[0051] In traditional skull gray and white matter enhancement algorithms, the settings of x1 and x2 are fixed based on the CT values of gray and white matter. This method only applies to gray and white matter and modifies values within a fixed range. If the CT values deviate, the enhancement effect may not be achieved. In contrast, this invention can adaptively enhance low-frequency images of the skull. It not only enhances gray and white matter but also other information, especially highlighting information such as cerebral sulci and gyri that are not prominently displayed. Furthermore, the algorithm is simple, has low parameter dependence, and achieves good results.
[0052] The present invention also discloses an image contrast enhancement system for implementing the steps of the above-described image contrast enhancement method.
[0053] It should be noted that the embodiments of the present invention have better implementability and are not intended to limit the present invention in any way. Any person skilled in the art may use the above-disclosed technical content to change or modify it into equivalent effective embodiments. However, any modifications or equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of the technical solution of the present invention.
Claims
1. A method for enhancing image contrast, characterized in that, Includes the following steps: Get the input image The target region for the input image Low-frequency filtering is performed to obtain a low-frequency image. ; Based on the low-frequency image, the window width is set to... Sliding window; The low-frequency image is enhanced by applying a grayscale transformation curve to obtain the enhanced low-frequency image. The grayscale transformation curve is ;in , , for The midpoint of the grayscale transformation curve within the range, , The amplitude of the control curve change is determined; the center of the sliding window sequentially moves across each pixel on the low-frequency image, and the pixel values within the target area that the sliding window passes through during its movement are used to obtain the desired values. and ,and > ; Through the low-frequency image and the enhanced low-frequency image Obtain enhanced pre-images The enhanced preimage With the input image The images are fused to obtain the enhanced output image. .
2. The image contrast enhancement method according to claim 1, characterized in that, The center of the sliding window sequentially moves across each pixel in the low-frequency image, and the value is obtained based on the pixel values that the sliding window passes through during its movement and are located within the target area. and include: Obtain the maximum value of the pixel values that the sliding window passes through during its sliding process and that are located within the target area. and minimum value ,but , ; , .
3. The image contrast enhancement method according to claim 1, characterized in that, The center of the sliding window sequentially moves across each pixel in the low-frequency image, and the value is obtained based on the pixel values that the sliding window passes through during its movement and are located within the target area. and include: Median filtering is performed on the pixel values that the sliding window passes through during its sliding process and are located within the target area. The resulting median value is denoted as . ; median Subtract a preset value Later as Add a preset value Later as .
4. The image contrast enhancement method according to claim 1, characterized in that, The center of the sliding window sequentially moves across each pixel in the low-frequency image, and the value is obtained based on the pixel values that the sliding window passes through during its movement and are located within the target area. and include: C-means clustering is performed on the pixel values that the sliding window passes through during its sliding process and are located within the target area to obtain two cluster centers, which are used as... and The central value of .
5. The image contrast enhancement method according to claim 1, characterized in that, The low-frequency image and the enhanced low-frequency image Obtain enhanced pre-images The enhanced preimage With the input image The images are fused to obtain the enhanced output image. Also includes: For the enhanced pre-image Smoothing process to obtain a smoothed image ; The smoothed image With the input image The images are fused to obtain the enhanced output image. .
6. The image contrast enhancement method according to claim 1, characterized in that, Based on the low-frequency image, the window width is set to... The sliding window includes: For the low-frequency image, there are several displayable ranges. If one of the displayable ranges is selected as the target display range, then the remaining display ranges among the several displayable ranges are other display ranges. The size of the target display area is The size of the matrix is The dimensions of the other display areas are: The size of the matrix is The width of the sliding window is... ,in , The window width when the target display area is defined.
7. The image contrast enhancement method according to claim 1, characterized in that, The acquisition of input image The target areas include: The target region is obtained by excluding regions within a preset threshold using a threshold method; the regions within the preset threshold include air regions and bone regions.
8. The image contrast enhancement method according to claim 1, characterized in that, The grayscale transformation curve is in Curvature of the curves at both ends different.