A Near-Infrared Image Dehazing Method Based on Bright Area Clustering Optimization

By using a bright area clustering optimization method, and employing a Gaussian pyramid and atmospheric scattering imaging model for near-infrared image dehazing, the problems of local high-brightness interference and insufficient transmittance estimation are solved, achieving high-quality image restoration results.

CN121837083BActive Publication Date: 2026-06-30NINGBO UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NINGBO UNIV
Filing Date
2026-03-06
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing near-infrared imaging dehazing methods suffer from problems such as localized high-brightness interference, insufficient transmittance estimation accuracy, and inadequate edge preservation in complex fog fields, making it difficult to achieve high-quality image restoration.

Method used

A method based on bright area clustering optimization is adopted. By constructing a Gaussian pyramid, bright areas are extracted at multiple scales. Combined with an atmospheric scattering imaging model, atmospheric light values ​​are calculated and transmittance is optimized, ultimately achieving image restoration.

Benefits of technology

It effectively suppresses local bright interference, improves transmittance estimation accuracy and edge preservation capability, and achieves high-quality image restoration under complex fog conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837083B_ABST
    Figure CN121837083B_ABST
Patent Text Reader

Abstract

This invention discloses a near-infrared image dehazing method based on bright area clustering optimization. The method is characterized by first acquiring a hazy near-infrared image, then constructing an image dehazing model and building a Gaussian pyramid for the hazy near-infrared image. Candidate bright area binary masks are extracted and refined at each scale, and after mapping and fusion, a baseline candidate bright area binary mask and scale persistence features are obtained. Next, feature extraction and cluster analysis are performed on the baseline candidate bright area binary mask, and a physical consistency cost function is constructed based on an atmospheric scattering model for verification, obtaining a global atmospheric light estimate. Then, the global atmospheric light estimate is used for normalization and adaptive dark channel extraction and fusion to obtain an initial transmittance distribution, which is then refined and constrained to obtain an optimized transmittance distribution. Finally, the dehazed image is reconstructed based on the atmospheric scattering model. The advantages are improved transmittance estimation accuracy and edge preservation capability, achieving high-quality restoration of hazy near-infrared images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for dehazing a single image under near-infrared imaging conditions, and in particular to a near-infrared image dehazing method based on bright area clustering optimization. Background Technology

[0002] Near-infrared imaging offers a promising approach to addressing air quality degradation caused by fog. Due to its longer wavelength, near-infrared light is scattered less by suspended particulate matter in the air than visible light. This gives near-infrared cameras stronger penetration capabilities in low-visibility environments such as fog and haze, enabling them to acquire relatively clear scene images. Numerous domestic and international studies have also indicated that incorporating the near-infrared band helps to see through details in smoky or foggy scenes. However, near-infrared imaging is not entirely unaffected by the atmosphere. In dense fog, near-infrared imaging also suffers from blurred details and reduced contrast. Therefore, even after obtaining preliminarily enhanced foggy images using near-infrared sensors, further defogging and enhancement processing is necessary to fully realize the advantages of near-infrared imaging in adverse weather conditions.

[0003] To improve the quality of near-infrared imaging in foggy conditions, researchers have proposed numerous dehazing methods, mainly falling into three categories: image enhancement-based dehazing, image fusion-based dehazing, and image restoration-based dehazing. Image enhancement-based dehazing methods do not need to consider the specific mechanisms of image quality degradation; they primarily improve clarity and overall appearance by adjusting visual elements such as brightness, contrast, and detail. However, due to the lack of physical mechanisms and degradation models, they can only highlight certain information to a limited extent, leading to certain limitations. Image fusion-based dehazing methods integrate beneficial information from different channels or sources to form higher-quality images. These methods have advantages when multi-source information is sufficient and registration is accurate, but they require high consistency in synchronous acquisition, spatial registration, and imaging conditions. Image restoration-based dehazing methods are based on the physical mechanisms of optical imaging. They first establish a degradation model of the foggy image, then invert and compensate for the degradation process to obtain a clear, dehazed near-infrared image. However, in real-world scenarios, localized strong bright light and reflective materials can easily cause deviations in atmospheric light estimation, and fixed-scale strategies struggle to simultaneously address weakly textured regions and structural boundaries. In summary, although defogging methods based on atmospheric physical models have achieved some success, they still have limitations such as atmospheric light estimation mismatch, transmittance estimation bias, and sensitivity to noise. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a near-infrared image dehazing method based on bright area clustering optimization that can effectively suppress local bright interference, improve transmittance estimation accuracy and edge preservation capability, and achieve high-quality restoration of near-infrared images under complex fog conditions.

[0005] The technical solution adopted by this invention to solve the above-mentioned technical problems is as follows: a near-infrared image dehazing method based on bright area clustering optimization, specifically including the following steps:

[0006] Step 1: Obtain a hazy near-infrared image from the hazy near-infrared image dataset;

[0007] Step 2: Construct an image dehazing model, including a candidate bright area localization module, an atmospheric light value calculation module, an initial transmittance estimation module, a transmittance optimization module, and an image restoration module based on an atmospheric scattering imaging model. The hazy near-infrared image is input into the candidate bright area localization module, which constructs a Gaussian pyramid image set based on the hazy near-infrared image. The Gaussian pyramid image set includes both original and non-original scales. Bright area extraction is performed on each scale of the image in the Gaussian pyramid image set to obtain a refined candidate bright area binary mask for each scale. Each refined candidate bright area binary mask at a non-original scale is then mapped to the original scale to obtain a mapped binary mask corresponding to each non-original scale. The refined candidate bright area binary mask at the original scale is directly used as the original scale binary mask. The proportion of each pixel in the hazy near-infrared image appearing in all non-original scale mapped binary masks and the original scale binary mask is statistically analyzed and defined as the scale persistence of each pixel in the hazy near-infrared image. Morphological dilation is performed on the original scale binary mask to obtain the baseline candidate bright area binary mask.

[0008] Step 3: The atmospheric light value calculation module extracts features from the baseline candidate bright area binary mask to obtain feature vectors including brightness value, local standard deviation, gradient magnitude, normalized vertical position and scale persistence. Then, cluster analysis is performed on the above feature vectors, and a physical consistency cost function is constructed based on the atmospheric scattering imaging model for verification to obtain the global atmospheric light estimate.

[0009] Step 4: The initial transmittance estimation module normalizes the hazy near-infrared image using the global atmospheric light estimate, and performs window-adaptive dark channel extraction and fusion based on local standard deviation to obtain the initial transmittance distribution.

[0010] Step 5: The transmittance optimization module refines and constrains the initial transmittance distribution to obtain the optimized transmittance distribution;

[0011] Step 6: The image restoration module reconstructs the foggy near-infrared image based on the atmospheric scattering imaging model, using the optimized transmittance distribution and global atmospheric light estimation value, to obtain the defogging near-infrared image.

[0012] Compared with the prior art, the advantages of the present invention are as follows:

[0013] (1) The present invention uses a candidate bright area localization module to construct a Gaussian pyramid based on a foggy near-infrared image to extract bright areas at multiple scales. The original scale binary mask is morphologically dilated to obtain a baseline candidate bright area binary mask. At the same time, the proportion of each pixel in the foggy near-infrared image in all non-original scale corresponding mapped binary masks and original scale binary masks is statistically analyzed and defined as the scale persistence of each pixel in the foggy near-infrared image. This can effectively suppress local high brightness interference and provide more sufficient and consistent candidate information across scales for atmospheric light estimation. The atmospheric light value calculation module performs feature extraction and cluster analysis on the pixels in the baseline candidate bright area binary mask and verifies it in combination with the physical consistency cost function based on the atmospheric scattering model to obtain a more stable and reliable global atmospheric light estimate, reducing the impact of atmospheric light misestimation on the defogging result.

[0014] (2) The initial transmittance estimation module normalizes the image using the global atmospheric light estimate and then performs window-adaptive dark channel extraction and fusion based on local standard deviation. This preserves the details in textured areas and suppresses noise in flat areas, improving the robustness and edge preservation of transmittance estimation. The transmittance optimization module refines and constrains the initial transmittance distribution, effectively reducing noise and unreasonable values, and avoiding excessive darkening artifacts in the sky or distant areas. Finally, the image restoration module uses the optimized transmittance distribution and the global atmospheric light estimate based on the atmospheric scattering model to reconstruct the image, achieving a good balance between fog removal, structural sharpness, and visual naturalness in the dehazing result.

[0015] (3) This invention is designed for single-channel near-infrared images with fog. It does not rely on color information and can complete the defogging process using only brightness and structural features. It has good adaptability and stability in various fog concentrations and complex reflection scenarios.

[0016] Preferably, the specific process of step 2 is as follows:

[0017] Step 2-1: The candidate bright area localization module includes a multi-scale bright area extraction module, an opening operation unit, a connected component analysis unit, and a candidate bright area generation unit. The multi-scale bright area extraction module constructs a Gaussian pyramid for the near-infrared image with fog, and obtains a Gaussian pyramid image set containing the original scale image and the L-level downsampled scale image, where L is a preset positive integer and satisfies 2≤L≤5.

[0018] Step 2-2: The multi-scale bright area extraction module sorts the pixel brightness values ​​of the images at each scale in the Gaussian pyramid image set and marks the pixels in the top N% as initial bright area candidate pixels. The initial binary mask for that scale is formed by all the initial bright area candidate pixels at that scale, where N% is a preset percentage, 0.5≤N≤1.5.

[0019] Steps 2-3: The opening unit performs a morphological opening operation on the initial binary mask at each scale to remove small noise points and smooth the region boundaries, thus obtaining the binary mask after the opening operation.

[0020] Steps 2-4: The connected component analysis unit performs connected component analysis on the binary mask after the opening operation and obtains the pixel area of ​​each connected region. Then, it filters out all connected regions whose pixel area is less than a preset area threshold. All the remaining connected regions after filtering are used as the refined candidate bright area binary mask for this scale. The preset area threshold is: the total number of pixels in the image at this scale × M%, 0.04≤M≤0.06.

[0021] Steps 2-5: The candidate bright area generation unit maps the refined candidate bright area binary mask of each non-original scale to the original scale, obtaining the mapped binary mask corresponding to each non-original scale; the refined candidate bright area binary mask of the original scale is directly used as the original scale binary mask, and all mapped binary masks corresponding to non-original scales and the original scale binary masks are aligned with each other. The occurrence ratio of each pixel in the hazy near-infrared image in all mapped binary masks and original scale binary masks corresponding to all non-original scales is counted and defined as the scale persistence of each pixel in the hazy near-infrared image; the original scale binary mask is morphologically dilated to obtain the baseline candidate bright area binary mask. A dehazing framework based on an atmospheric scattering imaging model is constructed, which includes atmospheric light estimation, transmittance estimation, and image restoration. The input image is decomposed into multiple scales using a Gaussian pyramid, and refined candidate bright area binary masks are extracted at each scale. The original scale binary mask is morphologically dilated to obtain the baseline candidate bright area binary mask. The proportion of each pixel in the hazy near-infrared image in all non-original scale corresponding mapped binary masks and the original scale binary mask is statistically analyzed and defined as the scale persistence of each pixel in the hazy near-infrared image, providing more sufficient and consistent candidate information across scales for atmospheric light estimation.

[0022] Preferably, the specific process of step 3 is as follows:

[0023] Step 3-1: The atmospheric light value calculation module includes a feature extraction unit, a K-means clustering unit, an atmospheric light candidate value generation unit, a candidate transmittance generation unit, and a global atmospheric light estimation unit. The feature extraction unit performs feature extraction on each pixel within the binary mask of the baseline candidate bright area to obtain the feature vector of the pixel, including the brightness value, local standard deviation, gradient magnitude, normalized vertical position, and scale persistence.

[0024] Step 3-2: The K-means clustering unit uses the K-means clustering algorithm to cluster the above feature vectors according to the preset number of clusters K to obtain K clusters. The value of K ranges from 3 to 5.

[0025] Step 3-3: The atmospheric light candidate value generation unit obtains the mean statistics for each cluster, including: the mean brightness value of the cluster, the mean local standard deviation of the cluster, the mean gradient magnitude of the cluster, the mean normalized vertical position of the cluster, and the mean scale persistence of the cluster. The unit calculates a comprehensive score based on the linear weighted combination of the above five mean statistics. Then, according to the preset elimination criteria, the clusters belonging to the edge of the region are eliminated, and the remaining clusters are defined as candidate bright area clusters. A binary mask is generated based on the pixels in the candidate bright area clusters and morphological dilation is performed to obtain the candidate atmospheric light region binary mask.

[0026] Obtain the brightness statistics within each candidate bright area cluster: When the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is greater than 5, the brightness statistics include the lowest brightness value among the top 0.1% of the brightest pixels, the average brightness value among the top 0.1% of the brightest pixels, the lowest brightness value among the top 0.5% of the brightest pixels, and the highest brightness value. These four values ​​are used as candidate atmospheric light values ​​respectively.

[0027] When the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is less than or equal to 5, the brightness statistics include the lowest brightness value among the top 5 brightest pixels, the average brightness value among the top 5 brightest pixels, and the lowest and highest brightness values ​​among the top 25 brightest pixels. These four values ​​are used as candidate values ​​for atmospheric light.

[0028] Steps 3-4: For each atmospheric light candidate value, the candidate transmittance generation unit first normalizes the near-infrared image with fog using the atmospheric light candidate value to obtain a first normalized image. Then, it calculates the basic dark channel response on the first normalized image and obtains the candidate transmittance distribution based on the basic dark channel response through a preset mapping relationship. The candidate transmittance distribution = 1 - preset first parameter × basic dark channel response, where the value range of the preset first parameter is 0.88~0.97.

[0029] Steps 3-5: Construct a physical consistency cost function in the global atmospheric light estimation unit. The physical consistency cost function is a weighted sum of the first penalty term, the second penalty term, and the third penalty term. The first penalty term is used to measure the consistency of the candidate transmittance distribution within the binary mask of the candidate atmospheric light region that generates the candidate atmospheric light value. The second penalty term is used to penalize the degree to which the candidate transmittance distribution exceeds the preset physical feasible interval [0, 1] in the entire map. The third penalty term is used to penalize the spatial distribution non-smoothness of the candidate transmittance distribution in the entire map. Select the atmospheric light candidate value that minimizes the function value of the physical consistency cost function as the global atmospheric light estimate. Feature extraction and K-means clustering are performed on pixels within the baseline candidate bright area binary mask. Clusters with high mean brightness, low local standard deviation, low gradient magnitude, low normalized vertical position, and strong scale persistence are preferentially selected as candidate bright area clusters to generate candidate atmospheric light region binary masks and extract multiple atmospheric light candidate values. Based on this, a physical consistency cost function is constructed for verification, which effectively suppresses strong foreground reflection and local high brightness interference, and obtains more reliable global atmospheric light estimates, thereby reducing the impact of atmospheric light misestimation on the dehazing results.

[0030] Preferably, the specific process of step 4 is as follows:

[0031] Step 4-1: The initial transmittance estimation module includes a normalization unit, a dark channel calculation unit, an adaptive fusion unit, and a transmittance calculation unit. The normalization unit normalizes the hazy near-infrared image using the global atmospheric light estimate to obtain the second normalized image.

[0032] Step 4-2: In the dark channel calculation unit, set a first square window with a first window size and a second square window with a second window size. The size of the first window is between 5×5 and 9×9, and the length of one side is odd. The size of the second window is between 15×15 and 27×27, and the length of one side is odd. The length of one side of the second window is three times the length of one side of the first window. Perform local minimum operation on the second normalized image with the first square window to obtain the small-scale dark channel response. Perform local minimum operation on the second normalized image with the second square window to obtain the large-scale dark channel response.

[0033] Step 4-3: The adaptive fusion unit calculates the spatial adaptive weight for each pixel of the foggy near-infrared image based on the local standard deviation map and the gradient magnitude map of the foggy near-infrared image. The spatial adaptive weight is positively correlated with the local standard deviation of the corresponding pixel and negatively correlated with the gradient magnitude of the corresponding pixel. The value range of the spatial adaptive weight is [0, 1].

[0034] Step 4-4: The adaptive fusion unit uses spatial adaptive weights to perform weighted fusion of the small-scale dark channel response and the large-scale dark channel response to obtain the adaptive dark channel response;

[0035] Steps 4-5: The transmittance calculation unit obtains the initial transmittance distribution based on the adaptive dark channel response and an adaptive parameter related to the local standard deviation map of the hazy near-infrared image. The initial transmittance distribution = 1 - adaptive parameter × adaptive dark channel response. The adaptive parameter is dynamically determined according to the following process: First, the local standard deviation map of the hazy near-infrared image is globally normalized to the [0, 1] interval to obtain the normalized local standard deviation map; then, it is dynamically adjusted within the preset adaptive parameter range through linear interpolation to obtain the adaptive parameter corresponding to each pixel of the hazy near-infrared image. The estimated global atmospheric light value is used to normalize the hazy near-infrared image to eliminate brightness scale differences. The small-scale dark channel response and the large-scale dark channel response are fused by spatial adaptive weighting to obtain the adaptive dark channel response. The initial transmittance distribution is calculated by combining the adaptive parameter based on the local standard deviation, so as to achieve a balance between preserving the details in the texture area and the noise resistance stability in the flat area.

[0036] Preferably, the specific process of step 4-3 is as follows:

[0037] Step 4-3-1: The adaptive fusion unit acquires the local standard deviation map and gradient magnitude map of the hazy near-infrared image;

[0038] Step 4-3-2: The adaptive fusion unit linearly maps the local standard deviation of each pixel in the near-infrared image with fog to the preset local standard deviation interval [0.02, 0.08] and clips it to the interval [0, 1] to obtain the initial weight of each pixel;

[0039] Step 4-3-3: The adaptive fusion unit normalizes the maximum value of the gradient magnitude map of the near-infrared image with fog to obtain a normalized gradient magnitude map, and applies gradient suppression correction based on the normalized gradient magnitude map to the initial weight of each pixel. Then, it is cropped to the [0, 1] interval to obtain the spatial adaptive weight of each pixel.

[0040] Preferably, the specific process of step 5 is as follows:

[0041] Step 5-1: The transmittance optimization module includes a guided filtering unit, a global constraint unit, a region protection unit, and an optimized transmittance acquisition unit. The guided filtering unit smooths the hazy near-infrared image to obtain a smoothed image. Then, using the smoothed image as the guide image, a guided filtering operation is performed on the initial transmittance distribution to obtain a refined intermediate transmittance distribution. The regularization term in the guided filtering operation is a preset value, and the range of the regularization term is 8×10. -5~12×10 -5 ;

[0042] Step 5-2: The global constraint unit applies a global constraint to the intermediate transmittance distribution, limiting the value of the intermediate transmittance distribution to a preset range [0.05, 0.99], thereby obtaining the basic refined transmittance distribution;

[0043] Step 5-3: The area protection unit acquires the global brightness distribution of the near-infrared image with fog, sets the 90th percentile of the global brightness distribution of the near-infrared image with fog as the high brightness quantile threshold, and sets the 20th percentile of the gradient magnitude map of the near-infrared image with fog as the low gradient quantile threshold.

[0044] All pixels with brightness higher than the high brightness quantile threshold and gradient magnitude lower than the low gradient quantile threshold are identified as high brightness flat region binary masks, and morphological opening operations are performed on the high brightness flat region binary masks to obtain the high brightness flat region binary masks after the opening operation.

[0045] Step 5-4: The transmittance acquisition unit optimizes the transmittance distribution for each pixel within the binary mask of the bright, flat region after the opening operation. The larger of the base refined transmittance and the preset protection threshold is used as the optimized transmittance for each pixel within the binary mask of the bright, flat region after the opening operation, thus obtaining the optimized transmittance distribution. The preset protection threshold ranges from 0.25 to 0.35. Guided filtering refinement, global constraints, and lower limit constraints for the bright, flat region are then applied sequentially to the initial transmittance distribution to obtain the optimized transmittance distribution. This effectively reduces noise and unreasonable values, avoiding excessive darkening artifacts in the sky or distant areas. Attached Figure Description

[0046] Figure 1 This is a flowchart and processing effect diagram of the method of the present invention;

[0047] Figure 2 These are three sets of defogging experiment results simulated at different fog concentrations according to the present invention;

[0048] Figure 3 This is a simulation comparison experiment result diagram of the present invention with other traditional methods;

[0049] Figure 4 This is an objective evaluation index diagram showing the simulation comparison experiment between this invention and other traditional methods;

[0050] Figure 5 This is a diagram showing the experimental results of comparing the present invention with other traditional methods;

[0051] Figure 6 This is an objective evaluation index chart comparing the present invention with other traditional methods in a real-world comparative experiment. Detailed Implementation

[0052] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0053] Example: A near-infrared image dehazing method based on bright area clustering optimization, such as... Figure 1 As shown, the specific steps include:

[0054] Step 1: Obtain a hazy near-infrared image from the hazy near-infrared image dataset;

[0055] Step 2: Construct an image dehazing model, including a candidate bright area localization module, an atmospheric light value calculation module, an initial transmittance estimation module, a transmittance optimization module, and an image restoration module based on an atmospheric scattering imaging model. The hazy near-infrared image is input into the candidate bright area localization module, which constructs a Gaussian pyramid image set based on the hazy near-infrared image. The Gaussian pyramid image set includes both original and non-original scales. Bright area extraction is performed on each scale of the image in the Gaussian pyramid image set to obtain a refined candidate bright area binary mask for each scale. Each refined candidate bright area binary mask at a non-original scale is then mapped to the original scale to obtain a mapped binary mask corresponding to each non-original scale. The refined candidate bright area binary mask at the original scale is directly used as the original scale binary mask. The proportion of each pixel in the hazy near-infrared image appearing in all non-original scale mapped binary masks and the original scale binary mask is statistically analyzed and defined as the scale persistence of each pixel in the hazy near-infrared image. Morphological dilation is performed on the original scale binary mask to obtain the baseline candidate bright area binary mask.

[0056] The specific process of step 2 is as follows:

[0057] Step 2-1: The candidate bright area localization module includes a multi-scale bright area extraction module, an opening operation unit, a connected component analysis unit, and a candidate bright area generation unit. The multi-scale bright area extraction module constructs a Gaussian pyramid for the near-infrared image with fog, and obtains a Gaussian pyramid image set containing the original scale image and the L-level downsampled scale image, where L is a preset positive integer and satisfies 2≤L≤5.

[0058] Step 2-2: The multi-scale bright area extraction module sorts the pixel brightness values ​​of the images at each scale in the Gaussian pyramid image set and marks the pixels that are in the top N% as initial bright area candidate pixels. The initial binary mask for that scale is formed by all the initial bright area candidate pixels. Here, N% is a preset percentage, 0.5≤N≤1.5. In this embodiment, N=1.

[0059] Steps 2-3: The opening unit performs a morphological opening operation on the initial binary mask at each scale to remove small noise points and smooth the region boundaries, thus obtaining the binary mask after the opening operation.

[0060] Steps 2-4: The connected component analysis unit performs connected component analysis on the binary mask after the opening operation and obtains the pixel area of ​​each connected region. Then, it filters out all connected regions whose pixel area is less than a preset area threshold. All the remaining connected regions after filtering are used as the refined candidate bright area binary mask for this scale. The preset area threshold is: the total number of pixels in the image at this scale × M%, 0.04≤M≤0.06. In this embodiment, M=0.05.

[0061] Steps 2-5: The candidate bright area generation unit maps the refined candidate bright area binary mask of each non-original scale to the original scale, obtaining the mapped binary mask corresponding to each non-original scale; the refined candidate bright area binary mask of the original scale is directly used as the original scale binary mask, and all mapped binary masks corresponding to non-original scales and the original scale binary masks are aligned with each other. The occurrence ratio of each pixel in the hazy near-infrared image in all mapped binary masks and original scale binary masks corresponding to all non-original scales is counted and defined as the scale persistence of each pixel in the hazy near-infrared image; the original scale binary mask is morphologically dilated to obtain the baseline candidate bright area binary mask to appropriately expand the candidate region.

[0062] Step 3: The atmospheric light value calculation module extracts features from the baseline candidate bright area binary mask, obtaining feature vectors including brightness value, local standard deviation, gradient magnitude, normalized vertical position, and scale persistence. Then, cluster analysis is performed on these feature vectors, and a physical consistency cost function is constructed based on the atmospheric scattering imaging model for verification, yielding the global atmospheric light estimate. The specific process is as follows:

[0063] Step 3-1: The atmospheric light value calculation module includes a feature extraction unit, a K-means clustering unit, an atmospheric light candidate value generation unit, a candidate transmittance generation unit, and a global atmospheric light estimation unit. The feature extraction unit performs feature extraction on each pixel within the binary mask of the baseline candidate bright area to obtain the feature vector of the pixel, including brightness value, local standard deviation, gradient magnitude, normalized vertical position, and scale persistence.

[0064] Step 3-2: The K-means clustering unit uses the K-means clustering algorithm to cluster the above feature vectors according to the preset number of clusters K to obtain K clusters. The value of K ranges from 3 to 5. In this embodiment, K=3.

[0065] Step 3-3-1: The atmospheric light candidate value generation unit acquires the mean statistics for each cluster, including: the mean brightness value of the cluster, the mean local standard deviation of the cluster, the mean gradient magnitude of the cluster, the mean normalized vertical position of the cluster, and the mean scale persistence of the cluster. A comprehensive score is then calculated based on a linear weighted combination of these five mean statistics. The mean brightness value of the cluster is the average of the brightness values ​​of all pixels within the cluster; the mean local standard deviation of the cluster... The mean standard deviation is the mean of the local standard deviation map calculated using a 7×7 local window on the hazy near-infrared image within the cluster; the mean gradient magnitude of the cluster is the mean of the gradient magnitude map calculated using the Sobel operator on the hazy near-infrared image within the cluster; the mean normalized vertical position of the cluster is the mean of the ordinate of each pixel within the cluster after normalization according to the height of the hazy near-infrared image; the mean scale persistence of the cluster is the mean of the scale persistence within the cluster. Next, clusters belonging to the edge of the region are removed according to the preset removal conditions. The remaining clusters are defined as candidate bright area clusters. A binary mask is generated based on the pixels in the candidate bright area clusters and morphological dilation is performed to obtain the candidate atmospheric light region binary mask. The brightness statistics in each candidate bright area cluster are obtained: when the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is greater than 5, the brightness statistics include the lowest brightness value, the average brightness value, and the lowest and highest brightness value in the top 0.1% of the brightest pixels, and the lowest and highest brightness values ​​in the top 0.5% of the brightest pixels. These four values ​​are used as atmospheric light candidate values. When the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is less than or equal to 5, the brightness statistics include the lowest brightness value, the average brightness value, and the lowest and highest brightness value in the top 5 brightest pixels, and the lowest and highest brightness values ​​in the top 25 brightest pixels. These four values ​​are used as atmospheric light candidate values.

[0066] Step 3-3-2: Calculate the overall score of the clusters. The overall score is a linear weighted combination of the above mean statistics. The overall score of the k-th cluster is denoted as Score. k , , 1≤k≤K, where, This represents the mean brightness value of the k-th cluster. This represents the mean of the local standard deviations of the k-th cluster. This represents the mean gradient magnitude of the k-th cluster. This represents the mean of the scale persistence of the k-th cluster. This represents the normalized vertical position mean of the k-th cluster. Step 3-3-3: If a cluster meets any of the following preset elimination conditions, then the cluster is eliminated: Condition 1, the average gradient magnitude of the cluster is greater than 0.08; Condition 2, the average local standard deviation of the cluster is greater than 0.1; Condition 3, the average scale persistence of the cluster is less than 0.3; If there are more than two clusters that do not meet any of the above three conditions, the two clusters with the highest comprehensive scores are selected as candidate bright area clusters, sorted from highest to lowest; If there is only one cluster that does not meet any of the above three conditions, then the cluster that was not eliminated is selected as a candidate bright area cluster; If all clusters are eliminated, then only the two clusters with the highest comprehensive scores are selected as candidate bright area clusters, sorted from highest to lowest.

[0067] Steps 3-4: For each atmospheric light candidate value, the candidate transmittance generation unit first normalizes the hazy near-infrared image using that atmospheric light candidate value to obtain a first normalized image. Then, it obtains the basic dark channel response on the first normalized image, and then obtains the candidate transmittance distribution based on the basic dark channel response through a preset mapping relationship. The candidate transmittance distribution = 1 - preset first parameter × basic dark channel response, where the value range of the preset first parameter is 0.88~0.97. The specific process is as follows:

[0068] Step 3-4-1: Normalize the near-infrared image with fog using atmospheric light candidate values ​​to obtain a first normalized image; on the first normalized image, obtain the basic dark channel response through morphological erosion operation. The window of the morphological erosion operation is a preset C×C pixel square structuring element, where C is a preset odd number, and in this embodiment C=7.

[0069] Step 3-4-2: Obtain candidate transmittance distribution: Candidate transmittance distribution = 1 - preset first parameter × basic dark channel response. In this embodiment, the value of the preset first parameter is 0.95.

[0070] Steps 3-5: Construct a physical consistency cost function in the global atmospheric light estimation unit. The physical consistency cost function is a weighted sum of the first penalty term, the second penalty term, and the third penalty term. The first penalty term measures the consistency of the candidate transmittance distribution within the binary mask of the candidate atmospheric light region that generates the candidate atmospheric light value. The second penalty term penalizes the degree to which the candidate transmittance distribution exceeds the preset physical feasible interval [0, 1] across the entire map. The third penalty term penalizes the spatial distribution non-smoothness of the candidate transmittance distribution across the entire map. Select the atmospheric light candidate value that minimizes the function value of the physical consistency cost function as the global atmospheric light estimate. The specific process is as follows:

[0071] Step 3-5-1: Construct a physical consistency cost function J(Ai) in the global atmospheric light estimation unit, J(Ai) = λ1×J1(Ai) + λ2×J2(Ai) + λ3×J3(Ai), where:

[0072] J1(Ai) is the variance of the candidate transmittance distribution within the binary mask of the candidate air light region where the candidate atmospheric light value Ai is generated;

[0073] J2(Ai) represents the proportion of pixels whose candidate transmittance exceeds the preset physical feasible range [0, 1] in the entire area of ​​a near-infrared image with fog.

[0074] J3(Ai) is the total variation of the image obtained after cropping the candidate transmittance distribution to the preset physical feasible interval [0, 1]. The total variation of the image is calculated using the anisotropic total variation formula based on discrete first-order difference.

[0075] λ1, λ2, and λ3 are preset weighting coefficients. In this embodiment, λ1=1, λ2=0.5, and λ3=0.2.

[0076] Step 3-5-2: Select the atmospheric light candidate value that minimizes the value of the physical consistency cost function J(Ai) as the global atmospheric light estimate.

[0077] Step 4: The initial transmittance estimation module normalizes the hazy near-infrared image using global atmospheric light estimates and performs window-adaptive dark channel extraction and fusion based on local standard deviation to obtain the initial transmittance distribution; the specific process is as follows:

[0078] Step 4-1: The initial transmittance estimation module includes a normalization unit, a dark channel calculation unit, an adaptive fusion unit, and a transmittance calculation unit. The normalization unit normalizes the near-infrared image with fog using the global atmospheric light estimate to obtain the second normalized image.

[0079] Step 4-2: In the dark channel calculation unit, set a first square window with a first window size and a second square window with a second window size. The first window size ranges from 5×5 to 9×9 and the length of one side is odd. The second window size ranges from 15×15 to 27×27 and the length of one side is odd. The length of one side of the second window size is 3 times the length of one side of the first window size. Perform local minimum operation on the second normalized image with the first square window to obtain the small-scale dark channel response. Perform local minimum operation on the second normalized image with the second square window to obtain the large-scale dark channel response.

[0080] Step 4-3: The adaptive fusion unit calculates a spatial adaptive weight for each pixel of the hazy near-infrared image based on the local standard deviation map and the gradient magnitude map of the hazy near-infrared image. The spatial adaptive weight is positively correlated with the local standard deviation of the corresponding pixel and negatively correlated with the gradient magnitude of the corresponding pixel. The value range of the spatial adaptive weight is [0, 1]. The specific process is as follows:

[0081] Step 4-3-1: The adaptive fusion unit acquires the local standard deviation map and gradient magnitude map of the hazy near-infrared image.

[0082] Step 4-3-2: The adaptive fusion unit linearly maps the local standard deviation of each pixel in the near-infrared image with fog to the preset local standard deviation interval [0.02, 0.08] and clips it to the interval [0, 1] to obtain the initial weight of each pixel.

[0083] Step 4-3-3: The adaptive fusion unit normalizes the maximum value of the gradient magnitude map of the hazy near-infrared image to obtain a normalized gradient magnitude map. Then, it applies gradient suppression correction based on the normalized gradient magnitude map to the initial weights of each pixel in the hazy near-infrared image. Subsequently, it crops the pixel to the [0, 1] interval to obtain the spatial adaptive weights of each pixel in the hazy near-infrared image. The spatial adaptive weight of the x-th pixel in the hazy near-infrared image is defined as α(x), where α(x) = clip(α0(x) × (1 - 0.5G)). n (x)), 0, 1), 1≤x≤X, where X represents the total number of pixels in the near-infrared image with fog, clip represents the clip function sign, α0(x) represents the initial weight of the x-th pixel, and G n (x) represents the normalized gradient magnitude of the x-th pixel.

[0084] Step 4-4: The adaptive fusion unit uses spatial adaptive weights to perform weighted fusion of the small-scale dark channel response and the large-scale dark channel response to obtain the adaptive dark channel response. Here, the adaptive dark channel response of the x-th pixel of the near-infrared image with fog is defined as D(x), D(x)=α(x)×D_s(x)+(1-α(x))×D_l(x), where D_s(x) represents the small-scale dark channel response of the x-th pixel of the near-infrared image with fog, and D_l(x) represents the large-scale dark channel response of the x-th pixel of the near-infrared image with fog.

[0085] Steps 4-5: The transmittance calculation unit obtains the initial transmittance distribution based on the adaptive dark channel response and an adaptive parameter related to the local standard deviation map of the hazy near-infrared image. The initial transmittance distribution = 1 - adaptive parameter × adaptive dark channel response. The adaptive parameter is dynamically determined according to the following process: First, the local standard deviation map of the hazy near-infrared image is globally normalized to the [0, 1] interval to obtain the normalized local standard deviation map. Then, through linear interpolation, it is dynamically adjusted within the preset adaptive parameter range to obtain the adaptive parameter corresponding to each pixel of the hazy near-infrared image. The adaptive parameter corresponding to the x-th pixel of the hazy near-infrared image is defined as ω(x), ω(x) = ω_min + σ_norm(x) × (ω_max - ω_min), where ω_min = 0.82 and ω_max = 0.96. Therefore, the value of ω(x) approaches 0.82 in flat regions and approaches 0.96 in high-texture regions, achieving adaptive adjustment.

[0086] Step 5: The transmittance optimization module refines and constrains the initial transmittance distribution to obtain the optimized transmittance distribution. The specific process is as follows:

[0087] Step 5-1: The transmittance optimization module includes a guided filtering unit, a global constraint unit, a region protection unit, and an optimized transmittance acquisition unit. The guided filtering unit smooths the hazy near-infrared image to obtain a smoothed image. Then, using the smoothed image as the guide image, a guided filtering operation is performed on the initial transmittance distribution to obtain a refined intermediate transmittance distribution. The regularization term in the guided filtering operation is a preset value, and the range of the regularization term is 8×10. -5 ~12×10 -5 It maintains the edge structure while smoothing the internal region.

[0088] Step 5-2: The global constraint unit applies a global constraint to the intermediate transmittance distribution, limiting the value of the intermediate transmittance distribution to a preset range [0.05, 0.99], thereby obtaining the basic refined transmittance distribution.

[0089] Step 5-3: The area protection unit acquires the global brightness distribution of the near-infrared image with fog, sets the 90th percentile of the global brightness distribution of the near-infrared image with fog as the high brightness quantile threshold, and sets the 20th percentile of the gradient magnitude map of the near-infrared image with fog as the low gradient quantile threshold.

[0090] All pixels with brightness higher than the high brightness quantile threshold and gradient magnitude lower than the low gradient quantile threshold are identified as high-brightness flat region binary masks. Morphological opening operations are then performed on the high-brightness flat region binary masks using 5×5 square structuring elements to obtain the opened high-brightness flat region binary masks, effectively removing small noise.

[0091] Step 5-4: The optimized transmittance acquisition unit takes the larger of the basic refined transmittance of each pixel in the binary mask of the high-brightness flat region after the opening operation and the preset protection threshold as the optimized transmittance of each pixel in the binary mask of the high-brightness flat region after the opening operation, thereby obtaining the optimized transmittance distribution. The preset protection threshold ranges from 0.25 to 0.35.

[0092] Step 6: The image restoration module reconstructs the foggy near-infrared image based on the atmospheric scattering imaging model, using the optimized transmittance distribution and global atmospheric light estimation value, to obtain the defogging near-infrared image.

[0093] This embodiment uses the atmospheric scattering imaging model as its physical basis. It constructs an atmospheric light estimation branch consisting of a candidate bright area localization module and an atmospheric light value calculation module, and a transmittance estimation branch consisting of an initial transmittance estimation module and a transmittance optimization module, based on two key parameters: global atmospheric light estimation value and transmittance distribution. Through dual-branch collaborative optimization, high-precision dehazing of near-infrared images with fog under complex fog fields is achieved.

[0094] In the atmospheric light estimation branch, the candidate bright area localization module constructs a Gaussian pyramid from the near-infrared image with fog, performs multi-scale bright area extraction and fusion, and generates a baseline candidate bright area binary mask and scale persistence. Based on this, the atmospheric light value calculation module performs feature clustering and physical consistency verification, effectively suppresses local high brightness interference, and obtains stable and reliable global atmospheric light estimates.

[0095] In the transmittance estimation branch, the initial transmittance estimation module normalizes the hazy near-infrared image using the global atmospheric light estimate, and then obtains an initial transmittance distribution with strong dehazing in textured areas and mild dehazing in flat areas by adaptive weighted fusion of small-scale dark channel responses and large-scale dark channel responses, combined with adaptive parameters based on local standard deviation. The transmittance optimization module refines the initial transmittance distribution with guided filtering and applies a lower limit constraint to the bright flat areas to obtain an optimized transmittance distribution that is spatially continuous and edge-preserving.

[0096] Finally, the image restoration module substitutes the optimized transmittance distribution and the global atmospheric light estimate into the atmospheric scattering model for inverse transformation to reconstruct the dehazed near-infrared image.

[0097] Figure 1In the diagram, C1 represents the near-infrared image with fog, C2 represents the grayscale image corresponding to the initial transmittance distribution, C3 represents the grayscale image corresponding to the basic refined transmittance distribution, C4 represents the baseline candidate bright area binary mask, C5 represents the candidate atmospheric light area binary mask, C6 represents the near-infrared image after dehazing, C7 represents the near-infrared image after detail enhancement, C8 represents the near-infrared image after further dehazing, S1 represents the adaptive dark channel response, S2 represents the guided filtering operation and global constraint operation, S3 represents the Gaussian pyramid processing, S4 represents K-means clustering, S5 represents normalization, S6 represents the inverse transformation of the atmospheric scattering imaging model, S7 represents the detail enhancement processing, S8 represents the brightness correction processing, Z1 represents the transmittance estimation branch, and Z2 represents the atmospheric light estimation branch. The inverse transform of the atmospheric scattering imaging model is based on the atmospheric scattering imaging model. It reconstructs a hazy near-infrared image using an optimized transmittance distribution and a global atmospheric light estimate, resulting in a dehazed near-infrared image. Specifically, the difference between the pixel values ​​of the hazy near-infrared image and the global atmospheric light estimate is calculated. The larger of the optimized transmittance and a preset lower limit of transmittance is then used as the denominator for normalization. This is then added to the global atmospheric light estimate to obtain the dehazed near-infrared image. The preset lower limit of transmittance prevents the optimized transmittance in the denominator from being too small, ensuring numerical stability and a natural-looking dehazed near-infrared image. Detail enhancement and brightness correction are further conventional optimization dehazing methods for the dehazed near-infrared image obtained using the method described in this embodiment.

[0098] In the simulation verification phase, this embodiment constructs a multi-level fog near-infrared image dataset based on an atmospheric scattering model. First, a depth map matching the layout of roads, buildings, etc., is generated based on scene geometry or existing depth estimation results to describe the spatial distance from the viewpoint to each pixel. Then, a natural texture generation method based on Berlin noise is introduced to construct a fog density field, which is combined with the depth map to obtain a spatially non-uniform scattering coefficient distribution. Finally, combined with an adaptively selected global atmospheric light estimate, the corresponding foggy near-infrared image is synthesized by substituting it into the atmospheric scattering model.

[0099] To cover different visibility conditions, such as Figure 2 As shown, this embodiment sets up four scenarios: light fog, medium fog, heavy fog, and extreme heavy fog. The medium extinction coefficient β corresponding to the four scenarios is randomly selected within the ranges of 0.8~1.6, 1.8~2.8, 3.2~4.6, and 5.2~6.8, respectively. The global atmospheric light estimate is selected within the range of 0.55~0.85 to simulate different background brightness and environmental lighting conditions. Under each fog level, multiple fog images are generated by combining the same defogging near-infrared image with different medium extinction coefficients β, global atmospheric light estimates, and fog textures, forming three sets of defogging experimental results for different fog concentrations. Figure 2In this document, the dehazed image refers to the image obtained after dehazing using the method described in this embodiment. The first and second rows of images are the results of the first group of dehazing experiments, where the extinction coefficient β of different media corresponds only to the columns in the first and second rows of images. The third and fourth rows of images are the results of the second group of dehazing experiments, where the extinction coefficient β of different media corresponds only to the columns in the third and fourth rows of images. The fifth and sixth rows of images are the results of the third group of dehazing experiments, where the extinction coefficient β of different media corresponds only to the columns in the fifth and sixth rows of images.

[0100] Table 1 below shows the objective evaluation indicators of the defogging experiments simulated using the method of this embodiment for different fog concentrations.

[0101] Table 1

[0102]

[0103] As shown in Table 1, the method of the present invention achieves stable and significant performance improvements under different fog concentration simulation conditions. After processing, the residual fog index decreased from 0.296–0.560 to 0.068–0.199, indicating that fog interference in the image was effectively suppressed. The contrast index increased from 7.124–14.336 to 53.089–100.618, indicating a significant enhancement in image detail and contrast; the sharpness index increased from 0.377–0.441 to 0.503–0.541, further demonstrating improved image sharpness and edge discernibility. Even under high fog concentration conditions, the method of this embodiment still maintains good defogging effect, demonstrating strong stability and comprehensive enhancement capabilities. The method described in this embodiment can stably reduce residual fog and restore scene structure in scenes ranging from light fog to extreme heavy fog. Taking the residual fog index as an example, it shows a significant overall decrease after defogging at all levels, dropping from nearly 0.6 to approximately 0.2 under extreme heavy fog conditions, indicating that it can effectively reduce the impact of fog even in extremely poor visibility. The contrast index generally shows an order-of-magnitude improvement at different fog concentrations, with the light fog scene improving from a low contrast level to nearly 100 levels, indicating that the overall brightness and local texture details are significantly stretched. At the same time, the sharpness index and structure correlation index show a stable improvement at all fog levels, with clearer edge transitions. In summary, the method described in this embodiment can achieve a good balance between suppressing fog, enhancing contrast, and maintaining structural details under different fog concentrations and degradation levels, demonstrating strong defogging capabilities.

[0104] Figures 3-6In the diagram, 'a' represents the input near-infrared hazy image, 'b' represents the processing result using the dual-platform histogram equalization method, 'c' represents the processing result using the homomorphic filtering method, 'd' represents the processing result using the filter-fused contrast-limited adaptive histogram equalization method, 'e' represents the processing result using the dark channel prior method, 'f' represents the processing result using the gamma-corrected dark channel prior method, 'g' represents the processing result using the fast dark channel prior method, and 'h' represents the processing result using the method of this embodiment.

[0105] Figure 3 , Figure 5 In the image, each marker corresponds to the image in its respective column; Figure 4 , Figure 6 In this context, FADE represents the residual haze index, CPBD represents the sharpness index, EME represents the contrast index, E represents the information entropy index, and R represents the structural relevance index. For example... Figure 3 and Figure 4 As shown, on a simulated near-infrared foggy image dataset, the method of this embodiment is compared with traditional methods such as dual-platform histogram equalization, homomorphic filtering, contrast-limited adaptive histogram equalization with filtering fusion, dark channel prior, gamma-corrected dark channel prior, and fast dark channel prior. The results show that under the same heavy fog conditions, the method of this embodiment significantly outperforms the comparison methods in terms of residual fog intensity, further reducing the residual fog intensity from the medium-to-high level of traditional methods, and significantly reducing residual fog. The method of this embodiment also achieves higher values ​​in sharpness, contrast, information entropy, and structural relevance metrics, indicating that the method of this embodiment has strong defogging and detail recovery capabilities in heavy foggy near-infrared scenes.

[0106] On a real near-infrared hazy image dataset, the same method was selected for comparative experiments, such as... Figure 5 and Figure 6 As shown in the figure. Compared with other methods, the method in this embodiment can more effectively remove large-scale diffuse fog, and the recovered details are clearer. In terms of various objective evaluation indicators, the method in this embodiment is generally lower than the comparison algorithm in terms of residual fog perception, but higher than the comparison algorithm in terms of sharpness, contrast, and structural relevance. Moreover, the performance changes steadily under different scenarios, indicating that the method in this embodiment has good applicability in both simulated and real complex fog fields.

[0107] The method in this embodiment performs excellently in both simulated and real near-infrared images. The residual fog index is reduced from 0.36 to 0.05, and the contrast index is increased from 78 to 104. According to Table 1, the residual fog index can also be reduced from 0.56 to 0.199 in extreme heavy fog scenes. It has significant comprehensive advantages in fog suppression, detail preservation and local contrast enhancement.

Claims

1. A near-infrared image dehazing method based on bright area clustering optimization, characterized in that, Specifically, the following steps are included: Step 1: Obtain a hazy near-infrared image from the hazy near-infrared image dataset; Step 2: Construct an image dehazing model, including a candidate bright area localization module, an atmospheric light value calculation module, an initial transmittance estimation module, a transmittance optimization module, and an image restoration module based on an atmospheric scattering imaging model. Input the hazy near-infrared image into the candidate bright area localization module. The candidate bright area localization module constructs a Gaussian pyramid image set based on the hazy near-infrared image. The scale of the Gaussian pyramid image set includes both the original scale and the non-original scale. Perform bright area extraction operation on the image at each scale in the Gaussian pyramid image set to obtain a refined candidate bright area binary mask for each scale. Map each refined candidate bright area binary mask at the non-original scale to the original scale to obtain the mapped binary mask corresponding to each non-original scale. The refined candidate bright area binary mask at the original scale is directly used as the original scale binary mask. The occurrence ratio of each pixel in the hazy near-infrared image in all non-original scale corresponding mapped binary masks and the original scale binary mask is statistically analyzed and defined as the scale persistence of each pixel in the hazy near-infrared image. The original scale binary mask is morphologically dilated to obtain the baseline candidate bright area binary mask. Step 3: The atmospheric light value calculation module extracts features from the baseline candidate bright area binary mask to obtain feature vectors including brightness value, local standard deviation, gradient magnitude, normalized vertical position and scale persistence. Then, cluster analysis is performed on the above feature vectors, and a physical consistency cost function is constructed based on the atmospheric scattering imaging model for verification to obtain the global atmospheric light estimate. Step 4: The initial transmittance estimation module normalizes the hazy near-infrared image using the global atmospheric light estimate, and performs window-adaptive dark channel extraction and fusion based on local standard deviation to obtain the initial transmittance distribution. Step 5: The transmittance optimization module refines and constrains the initial transmittance distribution to obtain the optimized transmittance distribution; Step 6: The image restoration module reconstructs the foggy near-infrared image based on the atmospheric scattering imaging model, using the optimized transmittance distribution and global atmospheric light estimation value, to obtain the defogging near-infrared image.

2. The near-infrared image dehazing method based on bright area clustering optimization according to claim 1, characterized in that, The specific process of step 2 is as follows: Step 2-1: The candidate bright area localization module includes a multi-scale bright area extraction module, an opening operation unit, a connected component analysis unit, and a candidate bright area generation unit. The multi-scale bright area extraction module constructs a Gaussian pyramid for the near-infrared image with fog, and obtains a Gaussian pyramid image set containing the original scale image and the L-level downsampled scale image, where L is a preset positive integer and satisfies 2≤L≤5. Step 2-2: The multi-scale bright area extraction module sorts the pixel brightness values ​​of the images at each scale in the Gaussian pyramid image set and marks the pixels in the top N% as initial bright area candidate pixels. The initial binary mask for that scale is formed by all the initial bright area candidate pixels at that scale, where N% is a preset percentage, 0.5≤N≤1.

5. Steps 2-3: The opening unit performs a morphological opening operation on the initial binary mask at each scale to remove small noise points and smooth the region boundaries, thus obtaining the binary mask after the opening operation. Steps 2-4: The connected component analysis unit performs connected component analysis on the binary mask after the opening operation and obtains the pixel area of ​​each connected region. Then, it filters out all connected regions whose pixel area is less than a preset area threshold. All the remaining connected regions after filtering are used as the refined candidate bright area binary mask for this scale. The preset area threshold is: the total number of pixels in the image at this scale × M%, 0.04≤M≤0.

06. Steps 2-5: The candidate bright area generation unit maps the refined candidate bright area binary mask of each non-original scale to the original scale, obtaining the mapped binary mask corresponding to each non-original scale; the refined candidate bright area binary mask of the original scale is directly used as the original scale binary mask, and all mapped binary masks corresponding to non-original scales and the original scale binary masks are aligned with each other. The occurrence ratio of each pixel in the hazy near-infrared image in all mapped binary masks and original scale binary masks corresponding to all non-original scales is counted and defined as the scale persistence of each pixel in the hazy near-infrared image; the original scale binary mask is morphologically dilated to obtain the baseline candidate bright area binary mask.

3. The near-infrared image dehazing method based on bright area clustering optimization according to claim 2, characterized in that, The specific process of step 3 is as follows: Step 3-1: The atmospheric light value calculation module includes a feature extraction unit, a K-means clustering unit, an atmospheric light candidate value generation unit, a candidate transmittance generation unit, and a global atmospheric light estimation unit. The feature extraction unit performs feature extraction on each pixel within the binary mask of the baseline candidate bright area to obtain the feature vector of the pixel, including the brightness value, local standard deviation, gradient magnitude, normalized vertical position, and scale persistence. Step 3-2: The K-means clustering unit uses the K-means clustering algorithm to cluster the above feature vectors according to the preset number of clusters K to obtain K clusters. The value of K ranges from 3 to 5. Step 3-3: The atmospheric light candidate value generation unit obtains the mean statistics for each cluster, including: the mean brightness value of the cluster, the mean local standard deviation of the cluster, the mean gradient magnitude of the cluster, the mean normalized vertical position of the cluster, and the mean scale persistence of the cluster. The unit calculates a comprehensive score based on the linear weighted combination of the above five mean statistics. Then, according to the preset elimination criteria, the clusters belonging to the edge of the region are eliminated, and the remaining clusters are defined as candidate bright area clusters. A binary mask is generated based on the pixels in the candidate bright area clusters and morphological dilation is performed to obtain the candidate atmospheric light region binary mask. Obtain the brightness statistics within each candidate bright area cluster: When the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is greater than 5, the brightness statistics include the lowest brightness value among the top 0.1% of the brightest pixels, the average brightness value among the top 0.1% of the brightest pixels, the lowest brightness value among the top 0.5% of the brightest pixels, and the highest brightness value. These four values ​​are used as candidate atmospheric light values ​​respectively. When the number of the top 0.1% of the brightest pixels in each candidate bright area cluster is less than or equal to 5, the brightness statistics include the lowest brightness value among the top 5 brightest pixels, the average brightness value among the top 5 brightest pixels, and the lowest and highest brightness values ​​among the top 25 brightest pixels. These four values ​​are used as candidate values ​​for atmospheric light. Steps 3-4: For each atmospheric light candidate value, the candidate transmittance generation unit first normalizes the near-infrared image with fog using the atmospheric light candidate value to obtain a first normalized image. Then, it calculates the basic dark channel response on the first normalized image and obtains the candidate transmittance distribution based on the basic dark channel response through a preset mapping relationship. The candidate transmittance distribution = 1 - preset first parameter × basic dark channel response, where the value range of the preset first parameter is 0.88~0.

97. Steps 3-5: Construct a physical consistency cost function in the global atmospheric light estimation unit. The physical consistency cost function is a weighted sum of the first penalty term, the second penalty term, and the third penalty term. The first penalty term is used to measure the consistency of the candidate transmittance distribution within the binary mask of the candidate atmospheric light region that generates the candidate atmospheric light value. The second penalty term is used to penalize the degree to which the candidate transmittance distribution exceeds the preset physical feasible interval [0, 1] in the entire map. The third penalty term is used to penalize the spatial distribution non-smoothness of the candidate transmittance distribution in the entire map. Select the atmospheric light candidate value that minimizes the function value of the physical consistency cost function as the global atmospheric light estimate.

4. The near-infrared image dehazing method based on bright area clustering optimization according to claim 3, characterized in that, The specific process of step 4 is as follows: Step 4-1: The initial transmittance estimation module includes a normalization unit, a dark channel calculation unit, an adaptive fusion unit, and a transmittance calculation unit. The normalization unit normalizes the hazy near-infrared image using the global atmospheric light estimate to obtain the second normalized image. Step 4-2: In the dark channel calculation unit, set a first square window with a first window size and a second square window with a second window size. The size of the first window is between 5×5 and 9×9, and the length of one side is odd. The size of the second window is between 15×15 and 27×27, and the length of one side is odd. The length of one side of the second window is three times the length of one side of the first window. Perform local minimum operation on the second normalized image with the first square window to obtain the small-scale dark channel response. Perform local minimum operation on the second normalized image with the second square window to obtain the large-scale dark channel response. Step 4-3: The adaptive fusion unit calculates the spatial adaptive weight for each pixel of the foggy near-infrared image based on the local standard deviation map and the gradient magnitude map of the foggy near-infrared image. The spatial adaptive weight is positively correlated with the local standard deviation of the corresponding pixel and negatively correlated with the gradient magnitude of the corresponding pixel. The value range of the spatial adaptive weight is [0, 1]. Step 4-4: The adaptive fusion unit uses spatial adaptive weights to perform weighted fusion of the small-scale dark channel response and the large-scale dark channel response to obtain the adaptive dark channel response; Steps 4-5: The transmittance calculation unit obtains the initial transmittance distribution based on the adaptive dark channel response and an adaptive parameter related to the local standard deviation map of the hazy near-infrared image. The initial transmittance distribution = 1 - adaptive parameter × adaptive dark channel response. The adaptive parameter is dynamically determined according to the following process: First, the local standard deviation map of the hazy near-infrared image is globally normalized to the interval [0, 1] to obtain the normalized local standard deviation map; then, it is dynamically adjusted within the preset adaptive parameter interval through linear interpolation to obtain the adaptive parameter corresponding to each pixel of the hazy near-infrared image.

5. The near-infrared image dehazing method based on bright area clustering optimization according to claim 4, characterized in that, The specific process of step 4-3 is as follows: Step 4-3-1: The adaptive fusion unit acquires the local standard deviation map and gradient magnitude map of the hazy near-infrared image; Step 4-3-2: The adaptive fusion unit linearly maps the local standard deviation of each pixel in the near-infrared image with fog to the preset local standard deviation interval [0.02, 0.08] and clips it to the interval [0, 1] to obtain the initial weight of each pixel; Step 4-3-3: The adaptive fusion unit normalizes the maximum value of the gradient magnitude map of the near-infrared image with fog to obtain a normalized gradient magnitude map, and applies gradient suppression correction based on the normalized gradient magnitude map to the initial weight of each pixel. Then, it is cropped to the [0, 1] interval to obtain the spatial adaptive weight of each pixel.

6. The near-infrared image dehazing method based on bright area clustering optimization according to claim 4, characterized in that, The specific process of step 5 is as follows: Step 5-1: The transmittance optimization module includes a guided filtering unit, a global constraint unit, a region protection unit, and an optimized transmittance acquisition unit; the guided filtering unit smooths the near-infrared image with fog to obtain a smooth image, and then uses the smooth image as the guide image to perform a guided filtering operation on the initial transmittance distribution to obtain a refined intermediate transmittance distribution. The regularization term in the guided filtering operation is a preset value, and its range is 8×10. -5 ~12×10 -5 ; Step 5-2: The global constraint unit applies a global constraint to the intermediate transmittance distribution, limiting the value of the intermediate transmittance distribution to a preset range [0.05, 0.99], thereby obtaining the basic refined transmittance distribution; Step 5-3: The area protection unit acquires the global brightness distribution of the near-infrared image with fog, sets the 90th percentile of the global brightness distribution of the near-infrared image with fog as the high brightness quantile threshold, and sets the 20th percentile of the gradient magnitude map of the near-infrared image with fog as the low gradient quantile threshold. All pixels with brightness higher than the high brightness quantile threshold and gradient magnitude lower than the low gradient quantile threshold are identified as high brightness flat region binary masks, and morphological opening operations are performed on the high brightness flat region binary masks to obtain the high brightness flat region binary masks after the opening operation. Step 5-4: The optimized transmittance acquisition unit takes the larger of the basic refined transmittance of each pixel in the binary mask of the high-brightness flat region after the opening operation and the preset protection threshold as the optimized transmittance of each pixel in the binary mask of the high-brightness flat region after the opening operation, thereby obtaining the optimized transmittance distribution. The preset protection threshold ranges from 0.25 to 0.35.