Infrared image enhancement method based on CLAHE
Through the infrared image enhancement method based on CLAHE, combined with Gaussian blur, grayscale merging, gamma correction and platform histogram equalization processing, the problem of difficulty in taking into account contrast, details and noise suppression in the prior art is solved, and efficient enhancement of infrared images is achieved.
Patent Information
- Application Number
- CN202411973476.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-15
AI Technical Summary
Existing infrared image enhancement algorithms are difficult to take into account contrast enhancement, detail enhancement and noise suppression, resulting in poor image quality.
Using an infrared image enhancement method based on CLAHE, noise is suppressed through Gaussian blur treatment, grayscale merger and gamma correction are performed to stretch the contrast of dark parts, and the detail layer is subjected to platform histogram equalization.
Effectively suppress noise, improve image contrast and detailed information, and improve image sharpness and human eye comfort.
Smart Images

Figure CN119831855A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of infrared image processing, and in particular relates to an infrared image enhancement method based on CLAHE. Background Art
[0002] As infrared focal plane arrays become more and more mature, they have the advantages of good concealment, strong resistance to electronic interference and all-weather operation, and are widely used in military and civilian fields, such as military target detection, target recognition, target tracking and security control, as well as civilian intelligent transportation and security monitoring. However, due to the limitations of the detector's own performance, the generated infrared images have problems such as overall darkness, low contrast, blurred edges, large noise, unclear details and poor visual effects. Therefore, an infrared image enhancement technology is urgently needed to improve the quality of infrared images.
[0003] Most of the image enhancement methods in the prior art are based on histograms, such as CLAHE (Contrast Limited Adaptive Histogram Equalization), which limits the excessive enhancement of the background, suppresses noise and improves the dynamic range of the image by limiting the maximum statistical number of any gray level in the image. At present, this type of algorithm can improve the visualization effect of infrared images under certain conditions, but directly using this type of algorithm is prone to detail loss and oversaturation. In addition, the selection of the platform threshold is also difficult. The algorithm based on histogram equalization combined with filters can improve contrast and suppress noise, but it will blur details at the same time. In summary, the current image enhancement algorithms have their own focus and cannot take into account image contrast enhancement, detail enhancement and noise suppression. Summary of the invention
[0004] The purpose of the present invention is to combine the advantages of the existing image enhancement algorithms and improve them, and to propose an infrared image enhancement method based on CLAHE.
[0005] To this end, the present invention provides an infrared image enhancement method based on CLAHE, comprising the following steps:
[0006] Step 1: Obtain the original image I;
[0007] Step 2: Process the original image I to obtain a Gaussian smoothing layer and a Gaussian detail layer;
[0008] Step 3, perform histogram statistics on the Gaussian smoothing layer, correct the histogram to retain the valid grayscale, and perform histogram mapping, the mapping range is the total number of valid grayscales;
[0009] Step 4: Perform gamma correction on the mapped image;
[0010] Step 5: divide the gamma-corrected image into four blocks, then calculate the histogram of each block, and then correct each histogram;
[0011] Step 6: Perform platform histogram equalization on the Gaussian detail layer to obtain a detail enhancement map;
[0012] Step 7: Add the detail enhancement map and the dimming smoothing map to obtain And Take anti-overflow measures.
[0013] Furthermore, the specific process of step 2, processing the original image I to obtain the Gaussian smoothing layer and the Gaussian detail layer is:
[0014] Step 201, taking a Gaussian template with a template size of 3×3 and σ=0.47, performing Gaussian filtering on the original image I to obtain a Gaussian smoothing layer;
[0015] Step 202: Take a Gaussian template with a template size of 3×3 and σ=0.57, perform filtering processing on the image I, and obtain a Gaussian detail layer by subtracting it from the original image.
[0016] Furthermore, the specific process of step 4, performing gamma correction on the mapped image is as follows:
[0017]
[0018] Where, γ=1.8 and the mapping range is 235.
[0019] Furthermore, in step 5, the gamma-corrected image is processed into 4 blocks, and then the histograms of each block are counted, and then each histogram is corrected, wherein the specific process of correcting the histogram is:
[0020] Count the local maximum values of non-zero gray levels, calculate the mean of the gray level number and the number of gray levels adjacent to the right, and then assign the mean value to the current gray level and the gray level adjacent to the right, respectively.
[0021] Furthermore, the Gaussian detail layer is subjected to platform histogram equalization to obtain a detail enhancement map, wherein the platform threshold is an empirical value T_d=M*N*0.0117%, and the mapping range Rang_d is calculated according to step 3.
[0022] Furthermore, the detail enhancement map is added to the dimming smoothing map to obtain And Do anti-overflow processing, as shown in formula (2):
[0023]
[0024] The advantages of the present invention are as follows: the present invention provides such an infrared image enhancement method based on CLAHE, which has the advantage of using different σ to perform Gaussian blur processing on the image to effectively suppress noise; grayscale merging processing is performed on the smoothing layer to retain as many grayscale levels of the 16-bit infrared image as possible, and gamma mapping is performed on the merged image to effectively stretch the dark contrast of the infrared image and improve the comfort of the human eye, and finally the CLAHE algorithm is improved to increase the contrast of the image area; platform histogram equalization processing is performed on the detail layer to enhance image details and improve image sharpness.
[0025] The present invention is described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is the flow chart of the infrared image enhancement method based on CLAHE.
[0027] Figure 2 It is the histogram of the total number of valid gray levels.
[0028] Figure 3 A schematic diagram of the mapping legend.
[0029] Figure 4 Schematic diagram of the histogram correction scheme.
[0030] Figure 5a CLAHE+Gaussian enhancement Figure 1 .
[0031] Figure 5b Schematic diagram of infrared image enhancement method based on CLAHE Figure 1 .
[0032] Figure 6a CLAHE+Gaussian enhancement Figure 2 .
[0033] Figure 6b Schematic diagram of infrared image enhancement method based on CLAHE Figure 2 . DETAILED DESCRIPTION
[0034] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose, the specific implementation methods, structural features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and embodiments.
[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.
[0037] Any feature disclosed in this specification (including any additional claims, abstract and drawings), unless otherwise stated, may be replaced by other equivalent or alternative features with similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.
[0038] Example 1
[0039] This embodiment proposes a Figure 1 The infrared image enhancement method based on CLAHE shown includes the following steps:
[0040] Step 1: Obtain the original image I;
[0041] Step 2: Process the original image I through Gaussian filtering to obtain a Gaussian smoothing layer and a Gaussian detail layer. The Gaussian filtering formula is as follows:
[0042]
[0043] Where σ is the standard deviation of Gaussian filtering. The larger the value, the more obvious the filtering effect and the stronger the detail extraction ability; m and n are the filter radius;
[0044] D=IG (2)
[0045] Where D is the Gaussian detail layer, and G is the Gaussian smoothing layer after Gaussian filtering;
[0046] Step 3: Merge the grayscale of the Gaussian smoothing layer G: First, perform histogram statistics, and then correct the statistical histogram (such as Figure 2 As shown), and perform histogram mapping, the mapping range is the total number of valid gray levels h;
[0047] Step 4: Perform gamma correction on the mapped image. The specific process of gamma correction is:
[0048] The formula is as follows:
[0049]
[0050] Where, γ=1.8 and the mapping range is 235.
[0051] Step 5: divide the gamma-corrected image into four blocks, then calculate the histogram of each block, correct each histogram, and finally map it to obtain the dimming smoothing map Y;
[0052] Step 6: Perform platform histogram equalization on the Gaussian detail layer D to obtain the detail enhancement map D e ;
[0053] Step 7: Enhance the details in Figure D e Added to the dimming smoothing map Y to get the final contrast enhancement map And Take anti-overflow measures.
[0054] Furthermore, in step 2, the original image I is processed by formula (1) to obtain a Gaussian smoothing layer and a Gaussian detail layer. The specific process and parameters are:
[0055] Step 201, taking a Gaussian template with a template size m×n of 3×3 and σ=0.47, performing Gaussian filtering on the original image I to obtain a Gaussian smoothing layer;
[0056] Step 202: Take a Gaussian template with a template size of m×n=3×3 and σ=0.57, perform filtering on the image I, and obtain a Gaussian detail layer G by subtracting it from the original image.
[0057] Furthermore, in step 5, the gamma-corrected image is processed into 4 blocks, and then the histograms of each block are counted, and then each histogram is corrected, wherein the specific process of correcting the histogram is:
[0058] Count the local maximum of non-zero gray levels, calculate the mean of the gray level and the gray level adjacent to the right, and then assign the mean to the current gray level and the gray level adjacent to the right (such as Figure 4 shown).
[0059] Furthermore, the Gaussian detail layer D is subjected to platform histogram equalization to obtain a detail enhancement map D e Specifically:
[0060] The threshold T is used to limit the number of pixels in the histogram of the Gaussian detail layer D to be greater than a certain number, and the number of pixels after the limit h is obtained. c (i)
[0061]
[0062] Where h(i) represents the number of pixels corresponding to gray level i in the detail layer histogram, T is the platform threshold, and T = M*N*0.0117% (M, N represent the length and width of the image). Histogram equalization is performed based on the corrected histogram, and its mapping range is Rang_d.
[0063] Further, the detail enhancement diagram D e Added to the dimming smoothing map Y to get the final contrast enhancement map And Do anti-overflow processing, as shown in formula (5):
[0064]
[0065] The advantages of the present invention are as follows: the present invention provides such an infrared image enhancement method based on CLAHE, which has the advantage of using different σ to perform Gaussian blur processing on the image to effectively suppress noise; grayscale merging processing is performed on the smoothing layer, and the grayscale level loss is minimized when mapping as many 16-bit infrared images as possible to 8 bits, and gamma mapping is performed on the merged image to effectively stretch the dark contrast of the infrared image and improve the comfort of human eyes at the same time, and finally the CLAHE algorithm is improved to improve the contrast of the image area; platform histogram equalization processing is performed on the detail layer to enhance image details and improve image sharpness.
[0066] Example 2
[0067] The same image is enhanced using the infrared image enhancement method based on CLAHE shown in Example 1 and the infrared image enhancement method combining CLAHE with Gaussian enhancement in the prior art, respectively. The results are shown in FIG5 and FIG6 , where Figure 5a , Figure 6a These are schematic diagrams of the infrared image enhancement method combining CLAHE and Gaussian enhancement. Figure 5b , Figure 6b Both are result diagrams of the infrared image enhancement method based on CLAHE. Comparing the two, the infrared image enhancement method based on CLAHE provided by the technical solution of this patent application has a better noise suppression effect; it is more effective in stretching the dark contrast of the infrared image, improving the comfort of the human eye, and the contrast of the image area is also significantly improved; the image details are more obviously enhanced, and the image sharpness is also significantly improved.
[0068] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A CLAHE-based infrared image enhancement method, characterized in that: The steps include: Step 1: Obtain the original image I; Step 2: Process the original image I to obtain a Gaussian smoothing layer and a Gaussian detail layer; Step 3, perform histogram statistics on the Gaussian smoothing layer, correct the histogram to retain the valid grayscale, and perform histogram mapping, the mapping range is the total number of valid grayscales; Step 4: Perform gamma correction on the mapped image; Step 5: divide the gamma-corrected image into four blocks, then calculate the histogram of each block, and then correct each histogram; Step 6: Perform platform histogram equalization on the Gaussian detail layer to obtain a detail enhancement map; Step 7: Add the detail enhancement map and the dimming smoothing map to obtain Y, and perform anti-overflow processing on Y.
2. The infrared image enhancement method based on CLAHE according to claim 1, characterized in that: The specific process of step 2, processing the original image I to obtain the Gaussian smoothing layer and the Gaussian detail layer is: Step 201, taking a Gaussian template with a template size of 3×3 and σ=0.47, performing Gaussian filtering on the original image I to obtain a Gaussian smoothing layer; Step 202: Take a Gaussian template with a template size of 3×3 and σ=0.57, perform filtering on the image I, and obtain a Gaussian detail layer by subtracting it from the original image.
3. The infrared image enhancement method based on CLAHE according to claim 1, characterized in that: The specific process of step 4, performing gamma correction on the mapped image is: The formula is as follows: Where, γ=1.8 and the mapping range is 235.
4. The infrared image enhancement method based on CLAHE according to claim 1, characterized in that: In step 5, the gamma-corrected image is processed into 4 blocks, and then the histograms of each block are counted, and then each histogram is corrected. The specific process of correcting the histogram is: Count the local maximum values of non-zero gray levels, calculate the mean of the gray level number and the number of gray levels adjacent to the right, and then assign the mean to the current gray level and the adjacent gray level on the right, respectively.
5. The infrared image enhancement method based on CLAHE according to claim 1, characterized in that: The Gaussian detail layer is subjected to platform histogram equalization to obtain a detail enhancement map, wherein the platform threshold is an empirical value T_d=M*N*0.0117%, and the mapping range Rang_d is calculated according to step 3.
6. The infrared image enhancement method based on CLAHE according to claim 1, characterized in that: The detail enhancement map is added to the dimming smoothing map to obtain And Do anti-overflow processing, as shown in formula (2):
Citation Information
Cited By
Image dimming method and device with high dynamic range
CN120198337A
Low-light image enhancement method and mine image enhancement method
CN121353145A
Turnout switch rail detection method, device, equipment and medium
CN121837089A