Adaptive infrared image detail enhancement algorithm based on guided filter

An adaptive infrared image enhancement algorithm using guided filtering and layered processing solves the problems of image detail loss and noise amplification, effectively enhancing image details and reducing noise, thus improving the overall image quality.

CN115546052BActive Publication Date: 2025-12-16TIANJIN JINHANG INST OF TECH PHYSICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211148584.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2025-12-16
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

Existing infrared image enhancement algorithms are prone to loss of image details and amplification of noise during compression. Traditional algorithms have poor enhancement effects in different scenarios and cannot effectively preserve target detail information and reduce noise levels.

Method used

An adaptive infrared image detail enhancement algorithm based on guided filtering is adopted. The detail layer image and the base layer image are calculated through the first and second guided filters. Combined with the improved AGC algorithm, the histogram enhancement algorithm based on local binarization function statistics and the AOC algorithm, image layer processing and weighted fusion are performed to reduce noise and enhance details.

Benefits of technology

It effectively enhances the detail of images, enriches the sense of depth, and reduces noise levels, ensuring image enhancement effects in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546052B_ABST
    Figure CN115546052B_ABST
Patent Text Reader

Abstract

The application discloses an adaptive infrared image detail enhancement algorithm based on guided filtering. The original image is subjected to a first guided filter and a second guided filter to obtain a first output image and a second output image, and the first output image is subtracted from the second output image to obtain a first detail layer image; the second output image is subjected to an improved AGC algorithm to obtain an enhanced first enhanced base layer image, and is subjected to a histogram enhancement algorithm based on local binarization function statistics to obtain an enhanced second enhanced base layer image; the first enhanced base layer image and the second enhanced base layer image are subjected to weighted fusion to obtain an enhanced base layer image; the first detail layer image is subjected to mask processing to remove image fixed noise, is subjected to normalization to map the image to an 8-bit image space, and is subjected to an AOC algorithm to obtain an enhanced detail layer image; the enhanced base layer image and the enhanced detail layer image are subjected to weighted fusion to obtain a final enhanced image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image enhancement algorithm technology, specifically to an adaptive infrared image detail enhancement algorithm based on guided filtering. Background Technology

[0002] To obtain richer scene information, infrared imaging systems typically use 14-bit / 16-bit ADCs (Analog to Digital Converters) to convert the analog level signals output by the infrared detector into digital signals. However, current display devices can only display 8-bit image grayscale levels. Therefore, it is necessary to compress the original 14-bit or 16-bit image grayscale levels output by the infrared detector to 8 bits for display. This compression process is called dynamic range compression (DRC). If the compression is not done properly, it can lead to problems such as loss of image details and amplification of noise. Therefore, infrared image enhancement algorithms must preserve as much of the original infrared image information as possible, especially the details of the target, and ensure that image noise is not excessively amplified.

[0003] Traditional infrared image enhancement algorithms can be divided into spatial domain enhancement algorithms and transform domain enhancement algorithms. Spatial domain enhancement algorithms mainly include image fixed gain control (AOC), automatic gain control (AGC), and histogram-based algorithms. In the AOC algorithm, when the deviation between pixel grayscale values ​​and the image mean is small, the image dynamic range is small, the image contrast is low, and image details are not prominent. When the deviation is large, it leads to the loss of detail information in bright or dark targets. In the AGC algorithm, if the image is a uniform scene, such as a sky or desert scene, image noise will be excessively amplified. The presence of bright or dark scenes in an image can increase the grayscale range of a 14-bit / 16-bit image, resulting in a less noticeable enhancement effect. Histogram-based algorithms typically use grayscale levels with higher probability distributions in background and uniform regions, while pixels in detail regions usually correspond to grayscale levels with lower probability distributions. After histogram equalization, noise in the background and flat regions is excessively amplified, and pixels in detail regions cannot be effectively enhanced. Consequently, histogram equalization cannot achieve good image enhancement results. Therefore, we propose an adaptive infrared image detail enhancement algorithm based on guided filtering to address these issues. Summary of the Invention

[0004] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide an adaptive infrared image detail enhancement algorithm based on guided filtering that can improve image contrast, enrich image depth, and reduce image noise level.

[0005] In a first aspect, this application provides an adaptive infrared image detail enhancement algorithm based on guided filtering, comprising:

[0006] S1. Acquire a 14-bit / 16-bit infrared image and use the 14-bit / 16-bit infrared image as the guide image for the guide filter;

[0007] S2. Based on the guiding image, a first output image and a second output image are obtained by calculating the first guiding filter and the second guiding filter respectively. The filtering effect of the first output image is smaller than that of the second output image.

[0008] S3. Subtract the second output image from the first output image to obtain the first detail layer image;

[0009] S4. The improved AGC algorithm is used to calculate the second output image to obtain the first enhanced base layer image;

[0010] S5. The second output image is calculated using a histogram enhancement algorithm based on local binarization function statistics to obtain the second enhanced base layer image;

[0011] S6. Weighted fusion of the first base layer image and the second enhanced base layer image is performed to obtain the enhanced base layer image;

[0012] S7. Perform masking on the first detail layer image to obtain the second detail layer image;

[0013] S8. Normalize the second detail layer image to obtain the third detail layer image;

[0014] S9. Map the third detail layer image to an 8-bit image space to obtain the fourth detail layer image;

[0015] S10. The AOC algorithm is used to calculate the fourth detail layer image to obtain the enhanced detail layer image.

[0016] S11. The enhanced base layer image and the enhanced detail layer image are weighted and fused to obtain the final enhanced image.

[0017] According to the technical solution provided in the embodiments of this application, the formula for the guiding filter in S1-S2 is:

[0018] ;

[0019] ;

[0020] ;

[0021] in, To output the image;

[0022] For guiding images;

[0023] k is the pixel at a certain point on the guide image;

[0024] and To guide the image in The linear coefficients in;

[0025] Let k be a local window with radius r.

[0026] This represents the total number of pixels within the window.

[0027] To guide the image In the window The mean within;

[0028] To guide the image In the window within variance;

[0029] i represents a pixel in the image;

[0030] Input image;

[0031] Enter an image in the window The mean;

[0032] and To guide the image in The average value of the linear coefficients in;

[0033] The normalization factor;

[0034] First guiding filter Smaller than the first guiding filter .

[0035] According to the technical solution provided in the embodiments of this application, in S3, the first output image is subtracted from the second output image to obtain the first detail layer image: ;

[0036] This is the first detail layer image;

[0037] I_Base1 is the first output image;

[0038] I_Base2 is the second output image.

[0039] According to the technical solution provided in the embodiments of this application, in S4, the improved AGC algorithm is as follows:

[0040] S41. Obtain the original histogram of the second output image;

[0041] S42. Correct the original histogram using the upper and lower plateau values ​​to obtain the first histogram:

[0042] S43. If the first histogram is segmented to obtain the second histogram, proceed to S45; otherwise, proceed to S44.

[0043] S44. Noise suppression is applied to the first histogram using a linear smoothing mapping method to obtain the third histogram;

[0044] S45. Remove extreme points from the second or third histogram to obtain the fourth histogram;

[0045] S46. Perform AGC mapping on the fourth histogram to obtain the first enhanced base layer image.

[0046] According to the technical solution provided in the embodiments of this application, in S5, the histogram enhancement algorithm based on local binarization function statistics is as follows:

[0047] S51. Divide the second output image into several rectangular image blocks of the same size that do not overlap, to obtain several sub-images;

[0048] S52. The sub-image is processed by the histogram statistical method based on the binarization function to obtain the enhanced sub-image;

[0049] S53. Based on the enhanced sub-image, calculate the entire image to obtain the second enhanced base layer image.

[0050] According to the technical solution provided in the embodiments of this application, in S6, the first base layer image and the second enhanced base layer image are weighted and fused, and the calculation formula is as follows:

[0051] ;

[0052] in, The enhanced base layer image;

[0053] For fusion weights;

[0054] This is the first enhanced base layer image;

[0055] This is the second enhanced base layer image.

[0056] According to the technical solution provided in the embodiments of this application, the specific method in S7 is as follows:

[0057] S71, Obtain the first output image and the second output image. The linear coefficients in;

[0058] S72, Combine the first output image and the second output image in... The linear coefficients in the matrix are multiplied together to obtain the mask image;

[0059] S73. Multiply the mask image with the first detail layer image to obtain the second detail layer image.

[0060] According to the technical solution provided in the embodiments of this application, in S8-S9, the normalization algorithm is as follows:

[0061] ;

[0062] in, This is the third detail layer image;

[0063] This is the second detail layer image;

[0064] This is the minimum value of the second detail layer image;

[0065] This is the maximum value of the second detail layer image;

[0066] The third detail layer image is mapped to an 8-bit image space using linear mapping:

[0067] ;

[0068] in, This is the fourth detail layer image.

[0069] According to the technical solution provided in the embodiments of this application, in S10, the AOC algorithm is as follows:

[0070] ;

[0071] in, This is the enhanced detail layer image;

[0072] Set a fixed gain value for the image;

[0073] for Image mean;

[0074] This represents the expected image mean of the enhanced detail layer image.

[0075] According to the technical solution provided in the embodiments of this application, in S11, the enhanced base layer image and the enhanced detail layer image are weighted and fused, and the formula is as follows:

[0076] ;

[0077] in, For the final enhanced image;

[0078] weight_Detail is the fusion weight.

[0079] In summary, this technical solution specifically discloses an adaptive infrared image detail enhancement algorithm based on guided filtering. This application passes 14-bit / 16-bit infrared images through a first guided filter to obtain a first output image, and a second guided filter to obtain a second output image. The first output image is subtracted from the second output image to obtain a first detail layer image. The second output image is then passed through an improved AGC algorithm to obtain an automatically enhanced first base layer image, and through a histogram enhancement algorithm based on local binarization function statistics to obtain a histogram-enhanced second base layer image. The first and second base layer images are then weighted and fused to obtain an enhanced base layer image. The first detail layer image undergoes masking to remove fixed image noise, and is normalized to map the image to an 8-bit image space. Finally, it is passed through the AOC algorithm to obtain the enhanced detail layer image. The enhanced base layer image and the enhanced detail layer image are weighted and fused to obtain the final enhanced image. By performing layered processing and fusion on the image, the detail representation of the algorithm can be effectively improved. The base layer uses local and global image compression algorithms, which can effectively improve the local and global information of the algorithm and enrich the sense of layering of the image. The detail layer uses noise reduction mask processing, which can effectively reduce the noise level of the image. Attached Figure Description

[0080] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0081] Figure 1 This is a schematic diagram of an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0082] Figure 2 This is the original image used in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0083] Figure 3 This is the first output image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0084] Figure 4 This is the second output image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0085] Figure 5 This is the first detail layer image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0086] Figure 6 This is a method for an adaptive infrared image detail enhancement algorithm based on guided filtering. The image.

[0087] Figure 7 This is a method for an adaptive infrared image detail enhancement algorithm based on guided filtering. The image.

[0088] Figure 8 This is a mask image used in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0089] Figure 9 This is the image before masking in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0090] Figure 10 This is a masked image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0091] Figure 11 The image is enhanced using the traditional AGC algorithm.

[0092] Figure 12 This is an image enhanced by an improved AGC algorithm in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0093] Figure 13 Image enhanced by traditional AGC algorithm when highlighting targets.

[0094] Figure 14 The image is enhanced by an improved AGC algorithm when a bright target is introduced in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0095] Figure 15 This is an image generated by a histogram equalization algorithm based on local binarization function statistics.

[0096] Figure 16 This is a histogram image based on the local binarization function statistics of an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0097] Figure 17 This is a local histogram image from the histogram equalization algorithm.

[0098] Figure 18 This is a local histogram image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0099] Figure 19 This represents all histogram images from the histogram equalization algorithm.

[0100] Figure 20 This is a collection of histogram images used in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0101] Figure 21 This is an image enhanced by an improved AGC algorithm in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0102] Figure 22 This is an image enhanced by the local histogram algorithm in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0103] Figure 23 This is a weighted fusion base layer image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0104] Figure 24 This is an enhanced detail layer image from an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0105] Figure 25 This is the enhanced base layer image in an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0106] Figure 26 This is an enhanced detail layer image from an adaptive infrared image detail enhancement algorithm based on guided filtering.

[0107] Figure 27 This is the final enhanced image in an adaptive infrared image detail enhancement algorithm based on guided filtering. Detailed Implementation

[0108] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0109] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0110] Example 1

[0111] Please refer to Figure 1 The adaptive infrared image detail enhancement algorithm based on guided filtering provided in this application includes:

[0112] S1. Acquire a 14-bit / 16-bit infrared image and use the 14-bit / 16-bit infrared image as the guide image for the guide filter;

[0113] S2. Based on the guiding image, a first output image and a second output image are obtained by calculating the first guiding filter and the second guiding filter respectively. The filtering effect of the first output image is smaller than that of the second output image.

[0114] S3. Subtract the second output image from the first output image to obtain the first detail layer image;

[0115] S4. The improved AGC algorithm is used to calculate the second output image to obtain the first enhanced base layer image;

[0116] S5. The second output image is calculated using a histogram enhancement algorithm based on local binarization function statistics to obtain the second enhanced base layer image;

[0117] S6. Weighted fusion of the first enhanced base layer image and the second enhanced base layer image is performed to obtain the enhanced base layer image;

[0118] S7. Perform masking on the first detail layer image to obtain the second detail layer image;

[0119] S8. Normalize the second detail layer image to obtain the third detail layer image;

[0120] S9. Map the third detail layer image to an 8-bit image space to obtain the fourth detail layer image;

[0121] S10. The AOC algorithm is used to calculate the fourth detail layer image to obtain the enhanced detail layer image.

[0122] S11. The enhanced base layer image and the enhanced detail layer image are weighted and fused to obtain the final enhanced image.

[0123] In this embodiment, S1, a 14-bit / 16-bit infrared image is acquired and used as the guide image for the guide filter;

[0124] S2. Based on the guiding image, calculate it using the first guiding filter and the second guiding filter respectively to obtain the first output image and the second output image. The filtering effect of the first output image is less than that of the second output image. The first output image is I_Base1 and the second output image is I_Base2.

[0125] S3. Subtract the second output image I_Base2 from the first output image I_Base1 to obtain the first detail layer image. The first detail layer image is... ;

[0126] S4. The improved AGC algorithm is used to calculate the second output image I_Base2 to obtain the first enhanced base layer image, which is: ;

[0127] S5. A histogram enhancement algorithm based on local binarization function statistics is used to calculate the second output image I_Base2 to obtain the second enhanced base layer image. The second enhanced base layer image is... ;

[0128] S6, Enhance the first base layer image Second Enhancement Base Layer Image Weighted fusion is performed to obtain an enhanced base layer image, wherein the enhanced base layer image is... ;

[0129] S7. For the first detail layer image A masking process is performed to obtain the second detail layer image, which is... ;

[0130] S8, For the second detail layer image Normalization is performed to obtain the third detail layer image, which is... ;

[0131] S9. Transfer the third detail layer image. Mapping to an 8-bit image space yields the fourth detail layer image, which is... ;

[0132] S10. Use the AOC algorithm to process the fourth detail layer image. Calculations are performed to obtain an enhanced detail layer image, which is... ;

[0133] S11, Enhanced base layer image and enhanced detail layer image Weighted fusion is performed to obtain the final enhanced image, which is: .

[0134] like Figure 1 As shown, the formula for the guided filter in S1-S2 is:

[0135] ;

[0136] ;

[0137] ;

[0138] in, To output the image;

[0139] For guiding images;

[0140] k is the pixel at a certain point on the guide image;

[0141] and To guide the image in The linear coefficients in;

[0142] Let k be a local window with radius r.

[0143] This represents the total number of pixels within the window.

[0144] To guide the image In the window The mean within;

[0145] To guide the image In the window within variance;

[0146] i represents a pixel in the image;

[0147] Input image;

[0148] Enter an image in the window The mean;

[0149] and To guide the image in The average value of the linear coefficients in;

[0150] The normalization factor;

[0151] Furthermore, during the movement of the filtering window, each pixel i on the image will be contained within a filtering window. In order to obtain the pixel value of a single pixel, it is necessary to calculate the average value of the sums within the window centered at i and with radius r.

[0152] As can be seen from the formula for the guided filter, The window size should be selected based on the minimum detail size of the image that needs to be preserved. To retain details of small objects such as leaves, the window size should not be too large; generally, a smaller size is preferable. The size should be appropriate, and the smoothness level of the image should be adjusted accordingly. Decide. If the selection is too small, not only will details be preserved, but image noise will also be preserved. If the filter size is too large, both detail and noise will be filtered out. Therefore, a smaller first pilot filter should be selected. The first guide filter should be set to a value that provides a slight filtering effect while preserving as much image detail as possible; the second guide filter should be set to a larger value. The value is adjusted to achieve a good filtering effect, removing all image noise, but at the same time, image details are also completely removed.

[0153] like Figure 3 As shown, in S3, the first output image I_Base1 is subtracted from the second output image I_Base2 to obtain the first detail layer image. : ;

[0154] I_Base1 is the first output image;

[0155] I_Base2 is the second output image;

[0156] Furthermore, the first output image I_Base1 has k=3. =25;

[0157] The second output image I_Base2 has k=3. =2500;

[0158] Depend on Figure 3 It is known that the detail layer image obtained by the two-stage guided filter contains a large amount of noise information. The image noise must be suppressed in order to obtain a better image enhancement effect.

[0159] like Figure 11 As shown, further, in response to the problems of excessive stretching of images with small grayscale distribution and excessive amplification of noise in traditional AGC algorithms, as well as the problem that the image stretching effect is not obvious in scenes that are too bright or too dark, an improved AGC algorithm that can adapt to special scenes is proposed.

[0160] Furthermore, such as Figure 2 Original image Figure 3 and Figure 4 For image comparison after filtering; by Figure 3 and Figure 4 As can be seen from the comparison images, since the noise in the base layer image obtained by the second guiding filter is completely removed and it contains a large amount of low-frequency information of the image, the second output image I_Base2 is used as the base layer of the final output image.

[0161] In S4, the improved AGC algorithm is as follows:

[0162] S41. Obtain the original histogram of the second output image I_Base2. ;

[0163] S42. Correct the original histogram using the upper and lower plateau values ​​to obtain the first histogram:

[0164]

[0165] in, This is the original histogram;

[0166] This is the value for the platform.

[0167] This is the value of the next platform.

[0168] This is the first histogram;

[0169] Furthermore, the original image histogram is corrected by removing a very small number of pixel response values ​​through the lower platform histogram threshold, so as to eliminate the interference of a very small number of points on the segmented histogram statistics; if the histogram statistical value is greater than the upper platform value, the histogram statistical value is limited to the upper platform value; if the histogram statistical value is less than the lower platform value, the histogram statistical value is limited to 0; otherwise, the histogram statistical value remains unchanged.

[0170] S43. If the first histogram is segmented to obtain the second histogram, proceed to S45; otherwise, proceed to S44.

[0171] Furthermore, the histogram segmentation position and number of segments are obtained through histogram segmentation statistics. This algorithm considers the histogram to be segmented if there are no new pixels in the response values ​​of 500 or more adjacent pixels after correction. The histogram is traversed in turn, and the starting pixel position of the segmented histogram is recorded. Assuming that there are 2 histogram segments, the segmentation positions are Xmax1 and Xmin2.

[0172] S44. Noise suppression is applied to the first histogram using a linear smoothing mapping method to obtain the third histogram;

[0173] Furthermore, if the original image has a small dynamic range, the desired output range should be reduced accordingly; if the original image has a large dynamic range, the desired output range should be increased accordingly. This avoids overstretching the image, which would significantly increase noise levels, while maintaining a relatively ideal image contrast in the enhanced image. If the original image has a smaller dynamic range... If the image has a small dynamic range, a suitable desired output range is obtained through linear smoothing mapping to avoid overstretching and increasing image noise. The linear smoothing formula is:

[0174] ;

[0175] ;

[0176] in, The default value is 250. The original image's grayscale range is [128-]. The desired output range is [128-]. 127+ ], denoted as If the dynamic range of the original image is greater than The dynamic range of the output image is [0, 255].

[0177] This method can change the output image range more smoothly, avoiding the frequent segmentation and flickering phenomenon that occurs when the grayscale range of the output image is changed in segments.

[0178] S45. Remove extreme points from the second or third histogram to obtain the fourth histogram;

[0179] Furthermore, to avoid interference from bad pixels (overly bright or overly dark pixels with abnormal responses) or abnormal scenes (small target scenes that are either too bright or too dark) on the histogram extreme point statistics, 1% of the maximum and minimum points are removed to obtain the original image's maximum grayscale value. and minimum point ;

[0180] S46. Perform AGC mapping on the fourth histogram to obtain the first enhanced base layer image. Its formula is:

[0181] ;

[0182] ;

[0183] If the histogram is segmented, assuming that the histogram is divided into two segments after segmentation statistics, namely [Xmin1, Xmax1] and [Xmin2, Xmax2], where Xmin1 is Xmin calculated in S45 and Xmax2 is Xmax calculated in S45, then the gray range of histogram segment 1 is Xmax1 - Xmin1, and the gray range of histogram segment 2 is Xmax2 ~ Xmin2. Calculate the stretching weights W1 and W2 for each segment based on the histogram gray range.

[0184] The grayscale distribution range of the low-temperature segment image is: ;

[0185] The grayscale distribution range of the high-temperature segment image is as follows: ;

[0186] The weight value W1 for the desired grayscale distribution range after low-temperature enhancement is:

[0187] ;

[0188] The weight value W2 for the desired grayscale distribution range after high-temperature enhancement is:

[0189] ;

[0190] Then, the expected output values ​​EYmin1, EYmax1, EYmin2, and EYmax2 for each segment are obtained, and the formula is as follows:

[0191] ;

[0192] ;

[0193] ;

[0194] ;

[0195] The formulas for image gain and image bias for each segment are:

[0196] ;

[0197] ;

[0198] ;

[0199] ;

[0200] The final image obtained after AGC transformation is given by the following formula:

[0201] ;

[0202] If the image histogram has "multi-peaks", that is, there are multiple histogram segments, the histogram segmentation can be extended by analogy with the above method to generate the G and O values ​​of multiple histogram segments;

[0203] Furthermore, the enhancement effects of traditional and improved AGC algorithms in uniform scenarios are compared to, for example... Figure 11 and Figure 12 As shown; when a highlighted target is introduced, the images enhanced by the traditional AGC algorithm and the improved AGC algorithm are as follows. Figure 13 and Figure 14 As shown;

[0204] like Figures 17 to 20 As shown, in S5, the histogram enhancement algorithm based on local binarization function statistics is as follows:

[0205] Furthermore, assuming the original infrared image is X, with L gray levels, its corresponding gray level histogram is:

[0206] ;

[0207] in, This represents the total number of pixels with a grayscale value of in the original image.

[0208] This represents the total number of gray levels in the original image;

[0209] Using the histogram equalization algorithm and the desired number of gray levels R in the enhanced image (typically chosen as 256, i.e., an 8-bit image), the image enhancement algorithm based on histogram equalization can be derived, and its formula is as follows:

[0210] ;

[0211] in, It is a mapping function; representing the mapping function. The input infrared image at grayscale levels is mapped to R grayscale levels. Image; N represents the total number of pixels in the original image; adjacent gray levels of the original image. and After mapping, the contrast enhancement ratio is:

[0212] ;

[0213] In the formula, Proportional to In other words, after histogram equalization, gray levels with higher probability distribution in the original image have stronger image contrast with their adjacent gray levels; conversely, the contrast of gray levels with lower probability distribution with their adjacent gray levels will be compressed. In actual images, pixels located in the background and uniform regions usually have gray levels with higher probability distribution, while pixels located in detailed regions usually correspond to gray levels with lower probability distribution. After histogram equalization, noise in the background and flat regions of the image will be excessively amplified, while pixels in detailed regions cannot be effectively enhanced, resulting in histogram equalization not achieving a good image enhancement effect.

[0214] S51. Divide the second output image I_Base2 into several rectangular image blocks of the same size that do not overlap, to obtain several sub-images;

[0215] S52. The sub-image is processed by the histogram statistical method based on the binarization function to obtain the enhanced sub-image;

[0216] Furthermore, to enhance the contrast of image detail areas while avoiding excessive amplification of noise in the background and flat regions, this paper employs the idea of ​​local histogram statistical analysis to segment the original image into rectangular image blocks of the same size that do not overlap, such as... Within each sub-image block, a histogram statistical method based on a binarization function is used to perform sub-image histogram statistics, and the neighborhood gray level is analyzed. The formula for the histogram is:

[0217] ;

[0218] In the formula, Represents the row and column index values ​​of the sub-block. Let r represent the total number of cells in the sub-block, and r represent the neighborhood radius of the cell to be counted. Let t be the total number of neighborhood pixels, and t be the binarization function. The segmentation threshold is calculated using the following formula:

[0219] ;

[0220] S53. Based on the enhanced sub-image, calculate the entire image to obtain the second enhanced base layer image. ;

[0221] Furthermore, by using a histogram statistical method based on a local binarization function, the statistical probability distribution of pixel values ​​that originally had a large distribution probability, such as the background and flat areas, becomes smaller due to the introduction of the binarization function. Conversely, the distribution probability of pixel values ​​in detailed areas is improved.

[0222] Furthermore, the global histogram is calculated using the sub-block histograms, and the formula is as follows:

[0223] ;

[0224] The histograms obtained by the traditional histogram equalization algorithm and the algorithm proposed in this paper, based on the statistics of the local binarization function, are as follows: Figure 15 and Figure 16 As shown, the histogram equalization algorithm for balanced scenarios suffers from over-enhancement, and the proposed algorithm effectively suppresses this problem.

[0225] Furthermore, the amplitudes of the local and global histograms calculated by the algorithm in this scheme are smaller than those of the histogram equalization algorithm, thus effectively suppressing the problem of excessive enhancement of the background and flat areas.

[0226] like Figures 21 to 23 As shown, in S6, the first enhanced base layer image Second Enhancement Base Layer Image Weighted fusion is performed, and the fused image has the best local and global contrast. The calculation formula is as follows:

[0227] ;

[0228] in, The enhanced base layer image;

[0229] For fusion weights;

[0230] This is the first enhanced base layer image;

[0231] For the second enhanced base layer image;

[0232] Furthermore, =0.8.

[0233] like Figures 6 to 10 As shown, the specific method in S7 is as follows:

[0234] S71, Obtain the first output image I_Base1 and the second output image I_Base2 in... linear coefficients in and ;

[0235] Furthermore, The matrix represents a large amount of detailed and noise information from the original image. The matrix primarily represents the detailed information of the original image, and In the image, k=3. =25; In the image, k=3. =2500, its image is as follows Figure 6 and Figure 7 As shown;

[0236] S72, Combine the first output image I_Base1 and the second output image I_Base2 in... linear coefficients in and Multiplying them yields a mask image, which is shown below. Figure 8 As shown;

[0237] Furthermore, and Multiplying them together creates a mask model used to measure the detail and noise levels of an image; the mask image. for:

[0238] ;

[0239] S73, Combine the mask image with the first detail layer image Multiply to obtain the second detail layer image. After masking, the second detail layer image The noise was effectively suppressed, and the images before and after the flooding process are as follows: Figure 9 and Figure 10 As shown.

[0240] like Figure 24 As shown, the image detail layer is obtained by subtracting the first guided filter and the second guided filter. Its grayscale range is generally around several hundred, and the grayscale values ​​can be positive or negative. The processing of the detail layer mainly considers the enhancement of detail information.

[0241] Considering that the grayscale values ​​of the detail layer can be positive or negative, detail layer normalization processing is required first. In S8-S9, the normalization algorithm is as follows:

[0242]

[0243] in, This is the third detail layer image;

[0244] This is the second detail layer image;

[0245] This is the minimum value of the second detail layer image;

[0246] This is the maximum value of the second detail layer image;

[0247] The third detail layer image is mapped using linear mapping. Mapped to 8-bit image space:

[0248] ;

[0249] in, This is the fourth detail layer image.

[0250] Furthermore, the grayscale range of the detail layer image varies drastically depending on the image detail layer information, which causes image flickering in the video stream. To avoid this problem, it is necessary to stabilize the grayscale of the detail image. The AOC algorithm is used to enhance the image so that the mean value of the enhanced image remains stable, thereby effectively suppressing image flickering.

[0251] In S10, the AOC algorithm is as follows:

[0252] ;

[0253] in, This is the enhanced detail layer image;

[0254] Set a fixed gain value for the image;

[0255] for Image mean;

[0256] This represents the expected image mean of the enhanced detail layer image.

[0257] like Figures 25 to 27 As shown, in S11, the enhanced base layer image is... and enhanced detail layer image The formula for weighted fusion is as follows:

[0258] ;

[0259] in, For the final enhanced image;

[0260] weight_Detail is the fusion weight, weight_Detail=0.3.

[0261] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A guided filter based adaptive infrared image detail enhancement algorithm, characterized in that, The method comprises the following steps: S1, acquiring a 14bits / 16bits infrared image, and taking the 14bits / 16bits infrared image as a guide image of a guide filter; S2, calculating the guide image through a first guide filter and a second guide filter respectively based on the guide image to obtain a first output image and a second output image, wherein a filtering effect of the first output image is smaller than that of the second output image; S3, subtracting the second output image from the first output image to obtain a first detail layer image; S4, calculating the second output image by using an improved AGC algorithm to obtain a first enhanced base layer image; S5, calculating the second output image by using a histogram enhancement algorithm based on local binarization function statistics to obtain a second enhanced base layer image; S6, performing weighted fusion on the first base layer image and the second enhanced base layer image to obtain an enhanced base layer image; S7, performing mask processing on the first detail layer image to obtain a second detail layer image; S8, performing normalization processing on the second detail layer image to obtain a third detail layer image; S9, mapping the third detail layer image to an 8bits image space to obtain a fourth detail layer image; S10, calculating the fourth detail layer image by using an AOC algorithm to obtain an enhanced detail layer image; S11, performing weighted fusion on the enhanced base layer image and the enhanced detail layer image to obtain a final enhanced image; A formula of the guide filter in S1-S2 is as follows: ; ; ; wherein is an output image; to guide the image; k is a pixel at a certain point on the guide image; and is a linear coefficient for guiding the image in the direction of the line. a local window centered at k with radius r; N is the total number of pixels in the window; to guide the image in the window the mean value within the window to guide the image variance within the window the window i is a pixel point on the image; is an input image; the mean value of the input image in the window the mean value of the input image in the window and is the average value of the linear coefficients of the guiding image in the image. is a regularization factor; the first pilot filter less than the first pilot filter ; In S4, the improved AGC algorithm is as follows: S41, acquiring an original histogram of the second output image; S42, correcting the original histogram by using upper and lower platform values to obtain a first histogram: S43, if the first histogram is segmented to obtain a second histogram, S45 is entered, and if the first histogram is not segmented, S44 is entered; S44, performing noise suppression on the first histogram by using a linear smoothing mapping mode to obtain a third histogram; S45, performing extreme point elimination on the second histogram or the third histogram to obtain a fourth histogram; S46, performing AGC mapping on the fourth histogram to obtain the first enhanced base layer image; In S5, the histogram enhancement algorithm based on local binarization function statistics is as follows: S51, dividing the second output image into a plurality of rectangular image blocks of the same size and mutually non-overlapping to obtain a plurality of sub-images; S52, calculating the sub-images by using a histogram statistical method based on a binarization function to obtain enhanced sub-images; S53, calculating the entire image based on the enhanced sub-images to obtain the second enhanced base layer image; In S10, the AOC algorithm is as follows: ; wherein, is the enhanced detail layer image; is the image fixed gain value; To Image mean; is the desired image mean for the enhanced detail layer image.

2. The guided filter based adaptive infrared image detail enhancement algorithm according to claim 1, characterized in that: In S3, the first output image is subtracted from the second output image to obtain a first detail layer image: ; is a first detail layer image; I_Base1 is the first output image; I_Base2 is the second output image.

3. The guided filter based adaptive infrared image detail enhancement algorithm according to claim 1, wherein: In S6, the first base layer image and the second enhanced base layer image are weighted and fused, and a calculation formula is as follows: ; wherein, is the enhanced base layer image; is the fusion weight; is a first enhancement base layer image; is a second enhanced base layer image.

4. The guided filter based adaptive infrared image detail enhancement algorithm according to claim 1, wherein: The specific method in S7 is as follows: S71, obtaining linear coefficients of the first output image and the second output image in ​ S72, multiplying the first output image and the second output image by linear coefficients in to obtain a mask image; S73, multiplying the mask image and the first detail layer image to obtain the second detail layer image.

5. The guided filter based adaptive infrared image detail enhancement algorithm according to claim 1, wherein: In S8-S9, the normalization algorithm is as follows: ; wherein is a third detail layer image; is a second detail layer image; is the minimum value of the second detail layer image; is the maximum value of the second detail layer image; The third detail layer image is mapped to the 8 bits image space by a linear mapping: ; wherein, is a fourth detail layer image.

6. The guided filter based adaptive infrared image detail enhancement algorithm according to claim 1, wherein: In S11, the enhanced base layer image and the enhanced detail layer image are fused by weighting, and the formula is: ; wherein is the final enhanced image; weight_Detail is the fusion weight.