A method and system for infrared weak target enhancement based on adaptive window
By adopting adaptive window technology in infrared weak object detection, using adaptive thresholds and multi-scale filters for object detection and image enhancement, the problem of poor detection effect of the prior art in low signal-to-noise ratio and complex background is solved. Achieve higher detection accuracy and image quality.
Patent Information
- Application Number
- CN202411718888.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-28
AI Technical Summary
The existing infrared weak target detection methods are poor in low signal-to-noise ratio and complex background conditions, making it difficult to effectively detect and enhance weak targets.
An infrared weak target enhancement method based on adaptive windows is adopted to perform object detection and image enhancement through adaptive thresholds and multi-scale filters. Specific steps include infrared image denoising, local background parameter calculation, adaptive threshold detection, multi-scale filtering and contrast adjustment.
It significantly improves the detection accuracy and image quality of infrared weak targets, enhances the robustness and adaptability under complex background and noise conditions, and can effectively identify weak targets in complex environments.
Smart Images

Figure CN119228706B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of infrared weak target enhancement, and in particular to an infrared weak target enhancement method and system based on an adaptive window. Background Art
[0002] Infrared images are widely used in military, surveillance and aerospace fields because they can capture targets in low-light environments or completely dark conditions. However, due to the imaging principle of infrared images, there are usually problems with low signal-to-noise ratio and poor contrast, especially when detecting faint targets. These problems are more prominent. Traditional infrared image processing methods include image denoising, image enhancement and target detection techniques, but there are still many challenges in weak target detection.
[0003] At present, there are many methods for detecting and enhancing weak infrared targets, including detection methods based on global thresholds, filtering methods, and adaptive algorithms. The global threshold-based method does not work well when processing images with complex backgrounds or low target contrast. Because the global threshold cannot adapt to the brightness changes in different areas of the image, it is easy to cause missed or false detection of targets. Traditional filtering methods will weaken the detailed information in the image while removing noise, especially the information of weak targets. This results in the target being easily submerged by background noise under low signal-to-noise ratio conditions and difficult to detect effectively. Although adaptive algorithms such as adaptive Wiener filtering and adaptive median filtering can improve image quality and detection performance to a certain extent, these methods are usually complex in calculation and take a long time to process, making it difficult to meet the needs of real-time applications. Summary of the invention
[0004] In view of this, the present invention provides an infrared weak target enhancement method based on an adaptive window, the purpose of which is to adaptively adjust detection and enhancement parameters to improve the enhancement effect of weak targets.
[0005] To achieve the above object, the present invention provides an infrared weak target enhancement method based on an adaptive window, comprising the following steps:
[0006] S1: Denoise the acquired infrared image and calculate the local background parameters, use the adaptive threshold to detect the target, and obtain a binary image, including the following steps:
[0007] S11: Denoising infrared images:
[0008] The acquired infrared image Perform denoising to obtain the denoised image , the denoising is Gaussian smoothing, specifically:
[0009] ;
[0010] in, For each pixel position Centered The set of pixel positions within the range; To be included in The pixel position in ;
[0011] , is the variance of the Gaussian kernel;
[0012] For infrared images At pixel position The pixel value at ; The denoised image At pixel position The pixel value at ;
[0013] S12: Calculate local background parameters:
[0014] Based on the denoised image Calculate local background parameters, where the local background parameter estimation includes the local background mean and the local background variance; at each pixel position , calculate the local background mean in its neighborhood and the local background standard deviation ;
[0015] S13: Calculate an adaptive threshold and use the adaptive threshold to perform target detection;
[0016] S2: Determine the initialization window size range for each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio;
[0017] S3: construct a multi-scale filter for each target pixel position based on the optimal window size;
[0018] S4: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image to obtain a filtered image;
[0019] S5: Perform contrast adjustment on the filtered image to obtain an enhanced image.
[0020] As a further improvement method of the present invention:
[0021] Optionally, the step S13 includes the following steps:
[0022] S131: Calculate the adaptive threshold:
[0023] According to the local background parameters, calculate each pixel position Adaptive threshold , specifically:
[0024] ;
[0025] in, is the adjustment coefficient;
[0026] S132: Target detection:
[0027] By comparing the denoised images The pixel value of each pixel position and the corresponding adaptive threshold generate the target detection result, which is a binary image , specifically:
[0028] ;
[0029] in, For binary images At pixel position The pixel value at .
[0030] Optionally, in step S2, according to the binarized image Determine the initialization window size range for each target pixel and select the optimal window size by calculating the signal-to-noise ratio, including:
[0031] S21: Extract binary image Each target pixel position in and initialize the window size range:
[0032] According to the binary image Extract the set of all detected target pixel locations in the image , specifically:
[0033] ;
[0034] in, is the set of labeled pixel positions Middle pixel positions, is the serial number; For binary images At pixel position The pixel value at ;
[0035] For each target pixel position Set the initial window size range ,in, is the number of initial window sizes, each window size Represents a side length of The square area of ;
[0036] S22: Calculate the statistical characteristics of the signal and noise in the window and calculate the signal-to-noise ratio to determine the optimal window size.
[0037] Optionally, the step S22 includes the following steps:
[0038] S221: Calculate the statistical characteristics of the signal and noise in the window:
[0039] For each target pixel position And the corresponding window size , calculate the signal mean within the window and background noise standard deviation , specifically:
[0040] ;
[0041] in, For Centered The set of pixel positions within the range; is the pixel position set The number of pixel positions in ; The denoised image At pixel position The pixel value at ;
[0042] ;
[0043] S222: Calculate the signal-to-noise ratio and determine the optimal window size:
[0044] For each target pixel position , based on each window size The signal mean and background noise standard deviation , calculate the signal-to-noise ratio of the window, specifically:
[0045] ;
[0046] in, is the target pixel position by is the signal-to-noise ratio of the window;
[0047] The optimal window is selected based on the signal-to-noise ratio, specifically:
[0048] ;
[0049] in, Returns Reaching the maximum .
[0050] Optionally, in step S3, constructing a multi-scale filter for each target pixel position based on the optimal window size includes:
[0051] Based on the optimal window size for each target pixel position determined in step S2, a set of multi-scale filters is constructed for each target pixel position, and the size and shape of the filter are adjusted according to the optimal window size, specifically:
[0052] ;
[0053] in, At each target pixel position The filter at
[0054] For is the set of pixel positions within the center optimal window;
[0055] is the position of each target pixel To the pixel position in its neighborhood The Euclidean distance of .
[0056] Optionally, in step S4, using the constructed multiscale filter to perform multiscale filtering on each target pixel position in the denoised image to obtain a filtered image includes:
[0057] The denoised image is filtered using the constructed multi-scale filter. The pixel value of each target pixel position in is filtered to obtain the filtered image , specifically:
[0058] ;
[0059] in, For the filtered image at each target pixel position The pixel value at ; the filtered image The pixel value at the non-target pixel position is consistent with the pixel value at the same position in the denoised image; The denoised image At pixel position The pixel value at .
[0060] Optionally, in step S5, contrast adjustment is performed on the filtered image to obtain an enhanced image, including:
[0061] Normalize the filtered image to obtain the normalized image ;
[0062] For the normalized image Each pixel position in The pixel values are gamma corrected to obtain the corrected image , specifically:
[0063] ;
[0064] in, The corrected image At pixel position The pixel value at ; The normalized image At pixel position The pixel value at ; is the gamma correction coefficient;
[0065] Mapping the rectified image back to the original pixel value range obtains the enhanced image.
[0066] The present invention also discloses an infrared weak target enhancement system based on an adaptive window, comprising:
[0067] Preprocessing module: denoise the acquired infrared image and calculate the local background parameters, and use adaptive thresholds for target detection;
[0068] Adaptive window calculation module: Determine the initialization window size range of each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio;
[0069] Multi-scale filter construction module: constructs a multi-scale filter for each target pixel position based on the optimal window size;
[0070] Filtering module: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image;
[0071] Adjustment module: adjust the contrast of the filtered image.
[0072] Beneficial Effects
[0073] The present invention can effectively improve the detection accuracy of infrared weak targets by introducing adaptive thresholds and multi-scale filters. The adaptive threshold is calculated according to the local background characteristics of each pixel, so that it can adapt to the changes of different backgrounds and reduce missed detection and false detection. At the same time, the multi-scale filter can filter according to the optimal window size of the target pixel to enhance the contrast and visibility of the weak target. This method greatly improves the robustness of detecting weak targets under complex background and noise conditions, has strong adaptability, and can effectively identify weak targets in various complex environments.
[0074] The present invention further adjusts the contrast of the image by normalizing and gamma correcting the filtered image, making the faint target more prominent. Normalization ensures that the grayscale value of the image is distributed within an appropriate range, effectively avoiding the loss of image details due to excessively high or low brightness. Gamma correction can enhance the contrast of faint targets, making the dark details in the image richer, thereby obtaining better visual effects. This method can significantly improve the visual quality of the image, enhance the image details, and facilitate subsequent image analysis and target recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 A schematic flow chart of an infrared weak target enhancement method based on an adaptive window according to an embodiment of the present invention;
[0076] Figure 2 An infrared image input diagram according to an embodiment of the present invention;
[0077] Figure 3 This is a diagram of infrared image enhancement results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0078] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0079] Embodiment 1: A method for enhancing infrared weak targets based on adaptive windows, such as Figure 1 As shown, the following steps are included:
[0080] S1: De-noise the acquired infrared image and calculate the local background parameters, use the adaptive threshold to detect the target, and obtain a binary image.
[0081] S11: Denoising infrared images:
[0082] The acquired infrared image Perform denoising to obtain the denoised image , the denoising is Gaussian smoothing, specifically:
[0083] ;
[0084] in, For each pixel position Centered The set of pixel positions within the range; To be included in The pixel position in ;
[0085] , is the variance of the Gaussian kernel, which is ;
[0086] For infrared images At pixel position The pixel value at ; The denoised image At pixel position The pixel value at ;
[0087] S12: Calculate local background parameters:
[0088] Based on the denoised image Calculate local background parameters, where the local background parameter estimation includes the local background mean and the local background variance; at each pixel position , calculate the local background mean in its neighborhood , specifically:
[0089] ;
[0090] in, is the pixel position set The number of pixel positions in ; The denoised image At pixel position At the same time, the local background standard deviation in the neighborhood is calculated , specifically:
[0091] ;
[0092] S13: Calculate an adaptive threshold and use the adaptive threshold to perform target detection;
[0093] S131: Calculate the adaptive threshold:
[0094] According to the local background parameters, calculate each pixel position Adaptive threshold , specifically:
[0095] ;
[0096] in, is the adjustment coefficient, which is 2 in this embodiment.
[0097] S132: Target detection:
[0098] By comparing the denoised images The pixel value of each pixel position and the corresponding adaptive threshold generate the target detection result, which is a binary image , specifically:
[0099] ;
[0100] in, For binary images At pixel position The pixel value at .
[0101] By using an adaptive thresholding method, this step can dynamically adjust the detection threshold based on the local background features of the image. The calculation of the local background mean and standard deviation ensures that the detection threshold at each pixel position is based on the specific background conditions of its neighborhood, rather than using a global fixed threshold.
[0102] Gaussian smoothing denoising can effectively reduce high-frequency noise in images while retaining low-frequency information of target edges, which is especially suitable for weak target detection in infrared images. The denoised image can show the details of weak targets more clearly, and the adaptive threshold further enhances the contrast of weak targets.
[0103] S2: Determine the initialization window size range for each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio;
[0104] S21: Extract binary image Each target pixel position in and initialize the window size range:
[0105] According to the binary image Extract the set of all detected target pixel locations in the image , specifically:
[0106] ;
[0107] in, is the set of labeled pixel positions Middle pixel positions, is the serial number; For binary images At pixel position The pixel value at ;
[0108] For each target pixel position Set the initial window size range ,in, is the number of initial window sizes, each window size Represents a side length of The square area of In this embodiment , , , , ;
[0109] S22: Calculate the statistical characteristics of the signal and noise in the window and calculate the signal-to-noise ratio to determine the optimal window size.
[0110] S221: Calculate the statistical characteristics of the signal and noise in the window:
[0111] For each target pixel position And the corresponding window size , calculate the signal mean within the window and background noise standard deviation , specifically:
[0112] ;
[0113] in, For Centered The set of pixel positions within the range; is the pixel position set The number of pixel positions in ; The denoised image At pixel position The pixel value at ;
[0114] ;
[0115] S222: Calculate the signal-to-noise ratio and determine the optimal window size:
[0116] For each target pixel position , based on each window size The signal mean and background noise standard deviation , calculate the signal-to-noise ratio of the window, specifically:
[0117] ;
[0118] in, is the target pixel position by is the signal-to-noise ratio of the window;
[0119] The optimal window is selected based on the signal-to-noise ratio, specifically:
[0120] ;
[0121] in, Returns Reaching the maximum .
[0122] By calculating the signal-to-noise ratio to select the optimal window size, this step can adaptively determine the optimal window size for each target pixel. Windows of different sizes can capture target and background features of different scales. By selecting the window with the highest signal-to-noise ratio, it is ensured that the detection of each pixel is performed within the window range that best suits its features.
[0123] By calculating the signal mean and background noise standard deviation of different window sizes, this step can find the window size that maximizes the signal-to-noise ratio. The optimization of the signal-to-noise ratio helps to enhance the recognizability of faint targets under low-contrast conditions, making the target more prominent against a complex background.
[0124] S3: construct a multi-scale filter for each target pixel position based on the optimal window size;
[0125] Based on the optimal window size for each target pixel position determined in step S2, a set of multi-scale filters is constructed for each target pixel position, and the size and shape of the filter are adjusted according to the optimal window size, specifically:
[0126] ;
[0127] in, At each target pixel position The filter at
[0128] For is the set of pixel positions within the center optimal window;
[0129] is the position of each target pixel To the pixel position in its neighborhood The Euclidean distance of .
[0130] By constructing a multi-scale filter based on the optimal window size, it can adapt to targets of different sizes and shapes. This method allows the filter at each target pixel position to be dynamically adjusted according to its corresponding optimal window size, so that the scale of the filter is more closely matched to the target features, thereby improving the accuracy of target detection. Especially in scenes with targets of different scales, this method can effectively identify and separate targets of various scales, ensuring the comprehensiveness and accuracy of detection.
[0131] S4: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image to obtain a filtered image;
[0132] The denoised image is filtered using the constructed multi-scale filter. The pixel value of each target pixel position in is filtered to obtain the filtered image , specifically:
[0133] ;
[0134] in, For the filtered image at each target pixel position The pixel value at ; the filtered image The pixel value at the non-target pixel position is consistent with the pixel value at the same position in the denoised image; The denoised image At pixel position The pixel value at .
[0135] This step uses a multi-scale filter to filter each target pixel position. By weighted summing the pixel value of the target pixel position with the pixel values in its neighborhood, this step can highlight the target signal while smoothing non-target pixels. As a result, the target area in the filtered image will be clearer and the contrast between the target signal and the background will be significantly enhanced.
[0136] S5: Perform contrast adjustment on the filtered image to obtain an enhanced image.
[0137] Normalize the filtered image to obtain the normalized image , specifically:
[0138] ;
[0139] in, The normalized image At pixel position The pixel value at ; The filtered image At pixel position The pixel value at ; and The filtered images are Minimum and maximum pixel values;
[0140] For the normalized image Each pixel position in The pixel values are gamma corrected to obtain the corrected image , specifically:
[0141] ;
[0142] in, The corrected image At pixel position The pixel value at ; The normalized image At pixel position The pixel value at ; is the gamma correction coefficient, which is 1.1 in this embodiment.
[0143] Mapping the corrected image back to the original pixel value range obtains the enhanced image, such as Figure 3 As shown, specifically:
[0144] ;
[0145] in, For the enhanced image At pixel position The pixel value at .
[0146] By adjusting the contrast of the filtered image, this step can significantly improve the contrast between the target and the background in the image. Contrast enhancement makes the difference between the dark and bright parts of the image more obvious, thereby highlighting important details and structures in the image.
[0147] Embodiment 2: The present invention also discloses an infrared weak target enhancement system based on an adaptive window, comprising the following five modules:
[0148] Preprocessing module: denoise the acquired infrared image and calculate the local background parameters, and use adaptive thresholds for target detection;
[0149] Adaptive window calculation module: Determine the initialization window size range of each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio;
[0150] Multi-scale filter construction module: constructs a multi-scale filter for each target pixel position based on the optimal window size;
[0151] Filtering module: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image;
[0152] Adjustment module: adjust the contrast of the filtered image.
[0153] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0155] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An infrared weak target enhancement method based on adaptive window, characterized in that: The following steps are involved: S1: Denoise the acquired infrared image and calculate the local background parameters, use the adaptive threshold to detect the target, and obtain a binary image, including the following steps: S11: Denoising infrared images: The acquired infrared image Perform denoising to obtain the denoised image , the denoising is Gaussian smoothing, specifically: ; in, For each pixel position Centered The set of pixel positions within the range; To be included in The pixel position in ; , is the variance of the Gaussian kernel; For infrared images At pixel position The pixel value at ; The denoised image At pixel position The pixel value at ; S12: Calculate local background parameters: Based on the denoised image Calculate local background parameters, wherein the local background parameter estimation includes the local background mean and the local background variance; at each pixel position , calculate the local background mean in its neighborhood and the local background standard deviation ; S13: Calculate an adaptive threshold and use the adaptive threshold to perform target detection; S2: Determine the initialization window size range for each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio; S3: construct a multi-scale filter for each target pixel position based on the optimal window size; S4: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image to obtain a filtered image; S5: Perform contrast adjustment on the filtered image to obtain an enhanced image.
2. The infrared weak target enhancement method based on adaptive window according to claim 1 is characterized in that: The step S13 includes the following steps: S131: Calculate the adaptive threshold: According to the local background parameters, calculate each pixel position Adaptive threshold , specifically: ; in, is the adjustment coefficient; S132: Target detection: By comparing the denoised images The pixel value of each pixel position and the corresponding adaptive threshold generate the target detection result, which is a binary image , specifically: ; in, For binary images At pixel position The pixel value at .
3. The infrared weak target enhancement method based on adaptive window according to claim 1 is characterized in that: The step S2 includes the following steps: S21: Extract binary image Each target pixel position in and initialize the window size range: According to the binary image Extract the set of all detected target pixel locations in the image , specifically: ; in, is the set of labeled pixel positions Middle pixel positions, is the serial number; For binary images At pixel position The pixel value at ; For each target pixel position Set the initial window size range ,in, is the number of initial window sizes, each window size Represents a side length of The square area of ; S22: Calculate the statistical characteristics of the signal and noise in the window and calculate the signal-to-noise ratio to determine the optimal window size.
4. The infrared weak target enhancement method based on adaptive window according to claim 3 is characterized in that: The step S22 includes the following steps: S221: Calculate the statistical characteristics of the signal and noise in the window: For each target pixel position And the corresponding window size , calculate the signal mean within the window and background noise standard deviation , specifically: ; in, For Centered The set of pixel positions within the range; is the pixel position set The number of pixel positions in ; The denoised image At pixel position The pixel value at ; ; S222: Calculate the signal-to-noise ratio and determine the optimal window size: For each target pixel position , based on each window size The signal mean and background noise standard deviation , calculate the signal-to-noise ratio of the window, specifically: ; in, is the target pixel position by is the signal-to-noise ratio of the window; The optimal window is selected based on the signal-to-noise ratio, specifically: ; in, Returns Reaching the maximum .
5. The infrared weak target enhancement method based on adaptive window according to claim 3 is characterized in that: The step S3 includes the following steps: Based on the optimal window size for each target pixel position determined in step S2, a set of multi-scale filters is constructed for each target pixel position, and the size and shape of the filter are adjusted according to the optimal window size, specifically: ; in, At each target pixel position The filter at For is the set of pixel positions within the center optimal window; is the position of each target pixel To the pixel position in its neighborhood The Euclidean distance of .
6. The infrared weak target enhancement method based on adaptive window according to claim 5 is characterized in that: The step S4 includes the following steps: The denoised image is filtered using the constructed multi-scale filter. The pixel value of each target pixel position in is filtered to obtain the filtered image , specifically: ; in, For the filtered image at each target pixel position The pixel value at ; the filtered image The pixel value at the non-target pixel position is consistent with the pixel value at the same position in the denoised image; The denoised image At pixel position The pixel value at .
7. The infrared weak target enhancement method based on adaptive window according to claim 6 is characterized in that: The step S5 includes the following steps: Normalize the filtered image to obtain the normalized image ; For the normalized image Each pixel position in The pixel values are gamma corrected to obtain the corrected image , specifically: ; in, The corrected image At pixel position The pixel value at ; The normalized image At pixel position The pixel value at ; is the gamma correction coefficient; Mapping the rectified image back to the original pixel value range obtains the enhanced image.
8. An infrared weak target enhancement system based on adaptive window, characterized in that: include: Preprocessing module: denoise the acquired infrared image and calculate the local background parameters, and use adaptive thresholds for target detection; Adaptive window calculation module: Determine the initialization window size range of each target pixel based on the binary image, and select the optimal window size by calculating the signal-to-noise ratio; Multi-scale filter construction module: constructs a multi-scale filter for each target pixel position based on the optimal window size; Filtering module: Use the constructed multi-scale filter to perform multi-scale filtering on each target pixel position in the denoised image; Adjustment module: adjust the contrast of the filtered image; To realize an infrared weak target enhancement method based on an adaptive window as described in any one of claims 1-7.
Citation Information
Patent Citations
Low-illumination image / video enhancement method based on self-adaptive multiple-dimensioned filtering
CN104112253A
Infrared weak and small target detection algorithm adopting local feature contrast
CN113516187A