A Physical Model and Prior Constraints for Image Dehazing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-11
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]本发明提供一种物理模型与先验约束的图像去雾方法,解决相关技术中高速公路监控场景下非均匀雾浓度导致不同区域去雾质量需求相互冲突、无法对不同景深层和语义区域施加差异化去雾处理的技术问题
通过将雾浓度分布图作为辅助输入送入单目深度估计网络,使网络能够区分因目标距离近与因雾浓度大导致的亮度升高,修正了雾天条件下远处物体的深度低估偏差,从而得到准确的景深层划分掩码;同时利用雾浓度分布图对原始图像进行粗去雾预处理,解决了语义分割网络在重度雾天条件下中远景目标识别精度下降的问题,保证了后续各步骤所依赖的语义信息的可靠性;
Smart Images

Figure CN122222874B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation image processing technology, and more specifically, to an image dehazing method based on a physical model and prior constraints. Background Technology
[0002] In intelligent traffic monitoring systems for highways, the image quality captured by cameras in foggy conditions is severely degraded, directly impacting the accuracy of downstream tasks such as vehicle recognition, license plate detection, and traffic incident monitoring. Existing image dehazing methods are mainly divided into two categories: physical model-based methods and end-to-end methods based on deep learning.
[0003] Traditional methods based on physical models (such as dark channel prior) assume uniform global atmospheric light. In highway scenes, the sky region accounts for about 30% and has the heaviest fog concentration. Dark channel prior systematically overestimates atmospheric light values in the sky region, resulting in reduced overall image transmittance and noise amplification after defogging of nearby vehicles. While end-to-end defogging methods based on deep learning can handle non-uniform fog, their output is a black box result, making it impossible to differentiate the quality control for different downstream tasks such as license plate recognition and event detection. Furthermore, they exhibit poor generalization under fog patterns outside the training distribution, such as patchy fog and radial fog.
[0004] The main problem with existing technologies is that the fog concentration varies greatly in different areas within the same frame of an image in highway monitoring scenarios. License plate recognition requires local high-frequency texture details, while traffic event detection requires the outline structure of distant vehicles. The defogging quality requirements of these two types of tasks conflict with each other. Existing methods cannot apply differentiated defogging processing to different areas within the same frame of an image, resulting in over-defogging of nearby vehicles or insufficient defogging of distant targets. Summary of the Invention
[0005] This invention provides an image dehazing method based on physical models and prior constraints, which solves the technical problem in related technologies where non-uniform fog concentration in highway monitoring scenarios leads to conflicting dehazing quality requirements in different areas and makes it impossible to apply differentiated dehazing processing to different depth layers and semantic regions.
[0006] This invention provides an image dehazing method based on a physical model and prior constraints, comprising the following steps: S1, acquire the original foggy image; correct the foggy depth estimation bias with the fog concentration distribution map, and obtain the depth layer segmentation mask and fog concentration distribution map through monocular depth estimation network and depth clustering analysis; S2, use the depth layer segmentation mask and fog density distribution map to perform coarse dehazing preprocessing on the original foggy image to improve semantic segmentation accuracy and obtain semantic label map and target priority mask; S3. Based on the semantic label map and the depth layer segmentation mask, extract the differential prior response layer by layer according to the optical physical characteristics of each semantic region to obtain the multi-prior feature tensor and the prior response map of each depth layer. S4 inputs multiple prior feature tensors and target priority masks into a dual-branch lightweight convolutional network, and jointly predicts prior fusion weight vectors and spatial adaptive fusion weight maps through a target attention mechanism; S5, based on the prior fusion weight vector and fusion weight map, the prior responses of each depth layer are weighted and integrated. Through the parameter estimation of the hierarchical physical model and the guided filtering optimization, the local atmospheric light value and fine transmittance map of each depth layer are obtained. S6 uses a detailed transmittance map and local atmospheric light values at each depth of field to perform layered atmospheric scattering inverse operations to recover scene radiation. Combined with color correction, contrast enhancement, and target detail enhancement post-processing, a clear dehazed image is obtained.
[0007] In a preferred embodiment, S1 includes: The original foggy image is processed by a dark channel prior method to calculate the local window minimum and then filtered by the minimum value to obtain a normalized fog concentration distribution map. The fog concentration distribution map is used as an auxiliary channel and stitched with the original RGB image to form a four-channel data and fed into a monocular depth estimation network. This allows the network to distinguish between the increase in brightness caused by the close distance of the target and the increase in brightness caused by the high fog concentration during the feature extraction stage, thus correcting the underestimation of the depth of distant objects under foggy conditions. The depth prediction map output by the network is normalized by quantiles, and then the normalized depth values are divided into multiple depth layers by a clustering algorithm to generate the corresponding depth layer partitioning mask.
[0008] In a preferred embodiment, S2 includes: The fog concentration distribution map is reused, and the RGB mean value of the pixel with the highest brightness in the original foggy day image is taken as the global atmospheric light estimate. The value of each pixel in the fog concentration distribution map is multiplied by a preset adjustment coefficient and then the product is subtracted from 1 to obtain the transmittance estimate of the corresponding pixel, thus constructing a global transmittance estimate map. The original foggy image is globally dehazed according to the inverse operation formula of the atmospheric scattering model to obtain a coarse dehazed image. The coarse dehazed image is then used as the input of a semantic segmentation network for scene semantic parsing to obtain a semantic label map.
[0009] In a preferred embodiment, S2 further includes: Vehicle and pedestrian masks are extracted from the semantic label map. The vehicle and pedestrian masks are then combined with the near-field mask and the mid-near-field mask by performing a logical AND operation to obtain the key target area mask. Connectivity analysis is performed on the key target region mask. For each connected component, a position weight and a size weight are calculated. The position weight is obtained by inverting the normalized distance from the centroid of the connected component to the image center. The size weight is obtained by the normalized ratio of the area of the connected component pixels to the total number of pixels in the image. The position weight and the size weight are multiplied and normalized to obtain the target priority mask.
[0010] In a preferred embodiment, S3 includes: For road areas, a dark channel prior is used to extract fog concentration response; for vehicle areas, a maximum reflectance prior is used to extract reflectance response; for sky areas, color constancy constraints are used to extract color deviation response; and for vegetation areas, a green channel prior is used to extract channel difference response. Four types of prior response maps are extracted for each depth layer and stacked according to the channel dimension. The prior feature maps of each depth layer are further stacked to form the multi-prior feature tensor, and the prior response maps of each depth layer are output at the same time.
[0011] In a preferred embodiment, S4 includes: The dual-branch lightweight convolutional network includes a prior fusion weight prediction branch and a dehazing intensity weight prediction branch. The prior fusion weight prediction branch performs global average pooling on the deepest features of the encoder and then maps them to a K×4-dimensional vector through a fully connected layer. The four weight values of each depth layer are normalized by Softmax to obtain the prior fusion weight vector. The dehazing intensity weight prediction branch restores the spatial resolution through the decoder and outputs the dehazing intensity weight map after Sigmoid constraint; the target attention mechanism uses the target priority mask as attention weight to spatially weight the features of the last layer of the decoder, so that the key target area location is predicted with a higher dehazing intensity weight value.
[0012] In a preferred embodiment, S4 further includes: The spatial adaptive fusion weight map is a multi-channel image, with each channel corresponding to a combination of a depth layer and a prior type. For a pixel position in depth layer k, its fusion weight under prior type p is equal to the prior fusion weight value of the corresponding depth layer multiplied by the dehazing intensity weight value of the corresponding position, thus achieving joint optimization of prior selection at the depth layer level and intensity adjustment at the pixel level.
[0013] In a preferred embodiment, S5 includes: For each depth layer, the local atmospheric light value is estimated. The average RGB value of the pixels in the corresponding depth layer with a preset proportion of brightness ranking is taken as the first candidate value, and the average RGB value of the pixels in the sky region in the corresponding depth layer is taken as the second candidate value. The local atmospheric light value is obtained by weighting the two candidate values according to the average value of the fused prior response map. Calculate the mean value of the fog concentration distribution map across the entire map, subtract the mean value of the entire map from 1 to obtain the approximate value of the global average transmittance, take the mean value of the entire depth map across the entire map as the approximate value of the global average propagation distance, and derive the atmospheric scattering coefficient by dividing the natural logarithm of the negative approximate value of the global average transmittance by the approximate value of the global average propagation distance. For each depth layer, the average depth value of all pixels in the corresponding layer is taken as the representative depth. The adjustment coefficient of the corresponding depth layer is equal to 1 minus the power of the negative atmospheric scattering coefficient multiplied by the representative depth. The transmittance value of each pixel is equal to 1 minus the fusion prior response value of that pixel multiplied by the adjustment coefficient of the depth layer to which it belongs.
[0014] In a preferred embodiment, S5 further includes: The transmittance maps of each depth layer are independently estimated and then processed to achieve smooth transition between layers. The initial fusion weight is determined by the reciprocal of the difference between the normalized depth value of the pixel and the depth value of the cluster center of the adjacent depth layer. The initial fusion weight is multiplied by the edge weight obtained based on edge detection and then normalized. The transmittance values of the adjacent depth layers are then summed according to the weight. The transmittance map is modulated according to the defogging intensity weight map. The modulated transmittance value is equal to the defogging intensity weight multiplied by the original transmittance value plus 1 minus the defogging intensity weight, and the transmittance value is limited to above a preset lower threshold to obtain a fine transmittance map.
[0015] In a preferred embodiment, S6 includes: For each pixel, the depth layer is determined by dividing the mask according to the depth layer. The corresponding value is taken from the local atmospheric light value of each depth layer. The fog-free image is restored pixel by pixel by combining the fine transmittance map and the inverse calculation formula of the atmospheric scattering model. The key target areas are enhanced with a non-sharpening masking method. The enhancement coefficient is determined by the target priority mask. The higher the priority of the target area, the larger the enhancement coefficient is applied.
[0016] The beneficial effects of this invention are as follows: By using the fog density distribution map as an auxiliary input to the monocular depth estimation network, the network can distinguish between the increase in brightness caused by the close distance of the target and that caused by the high fog density, thus correcting the underestimation of the depth of distant objects under foggy conditions and obtaining an accurate depth layer segmentation mask. At the same time, the fog density distribution map is used to perform coarse dehazing preprocessing on the original image, which solves the problem of decreased accuracy of semantic segmentation network in mid-to-far target recognition under heavy fog conditions and ensures the reliability of the semantic information on which subsequent steps depend. By combining a dual-branch lightweight convolutional network with a target attention mechanism, and jointly predicting the prior fusion weights at the depth level and the dehazing intensity weights at the pixel level, differentiated dehazing processing for different depth levels and different semantic regions is achieved. Based on the parameter estimation of the hierarchical physical model, the local atmospheric light value and fine transmittance map of each depth level are obtained, and the detail enhancement driven by the target priority mask enables the key target area to retain detailed information such as license plate texture while fully dehazing, thus meeting the multi-task dehazing quality requirements in highway monitoring scenarios. Attached Figure Description
[0017] Figure 1 This is a flowchart of an image dehazing method based on a physical model and prior constraints according to the present invention; Figure 2 This invention provides a flowchart of an image dehazing method based on a physical model and prior constraints. Figure 1 ; Figure 3 This invention provides a flowchart of an image dehazing method based on a physical model and prior constraints. Figure 2 . Detailed Implementation
[0018] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, some features described in the examples may be combined in other examples.
[0019] At least one embodiment of the present invention discloses an image dehazing method based on a physical model and prior constraints, such as... Figures 1 to 3 As shown, it includes the following steps: S1, acquire the original foggy image; correct the foggy depth estimation bias with the fog concentration distribution map, and obtain the depth layer segmentation mask and fog concentration distribution map through monocular depth estimation network and depth clustering analysis; The system receives raw foggy images from highway surveillance cameras as input. These images have a resolution of 1920×1080 pixels and are in RGB three-channel color format. Since fog can interfere with depth estimation, the image needs to be preprocessed to extract fog concentration distribution information before depth estimation. A dark channel prior method is used to perform preliminary analysis of the input image, calculating the minimum values of the RGB three channels within a local window to obtain the dark channel image. Minimum filtering, a morphological operation, is then applied to the dark channel image, with the window size set to 15×15 pixels, to obtain a coarse fog concentration distribution estimate. This fog concentration distribution map reflects the relative intensity of fog concentration in different areas of the image; higher values indicate greater fog concentration in that area. The fog concentration distribution map is then normalized and mapped to a numerical range of 0 to 1, serving as auxiliary input information for the depth estimation network.
[0020] A monocular depth estimation network was constructed, employing an encoder-decoder architecture. In foggy conditions, distant objects are brighter due to atmospheric scattering, causing the monocular depth estimation network to misclassify them as nearby high-reflectivity objects, resulting in a systematic depth underestimation bias; that is, the denser the fog, the smaller the depth estimate.
[0021] In one embodiment of the present invention, to correct this bias, a fog concentration distribution map is fed into the network as an auxiliary input along with the original RGB image. This allows the network to distinguish between two fundamentally different situations during the feature extraction stage: "high pixel brightness is due to the target being close" and "high pixel brightness is due to high fog concentration at that location." This proactively corrects the depth estimation results in areas with high fog concentration, preventing the misclassification of dense fog areas as foreground objects. The encoder uses MobileNetV3-Large as the backbone feature extraction network. This network achieves a lightweight design through depthwise separable convolutions and linear bottleneck layers, reducing computational complexity while maintaining feature extraction capabilities. The encoder extracts multi-scale feature representations from the input four-channel data, which includes the original three RGB channels and a single channel for fog concentration distribution. The encoder outputs four feature maps at different scales, with resolutions of 1 / 8, 1 / 16, 1 / 32, and 1 / 64 of the original image, respectively. The decoder employs a feature pyramid structure, gradually restoring the spatial resolution of the feature maps through upsampling operations and skip connections. In each decoding stage, the upsampled high-level features are concatenated with the corresponding scale features from the encoder, and then feature fusion is performed through convolutional layers. The decoder's final output is a single-channel depth prediction map with the same resolution as the input image.
[0022] To enhance the robustness of depth estimation, a multi-scale consistency constraint mechanism is introduced into the depth estimation network. This mechanism downsamples the four-channel input data (a concatenation of the original three RGB channels and a single channel representing fog concentration distribution) at different ratios, inputting each downsampled signal into the depth estimation network to obtain depth prediction results at multiple scales. These prediction results are then uniformly upsampled to the original resolution for consistency comparison. The absolute difference between the prediction results at different scales is calculated, and pixel locations with differences exceeding a set threshold are marked; these locations are considered unstable regions in depth estimation. Median filtering is used to correct these unstable regions, and interpolation is performed using depth values from surrounding stable regions. After consistency correction, a stable depth estimation map is obtained.
[0023] The depth estimation map is normalized using quantile normalization. The 5th and 95th percentiles of the depth values are calculated, and depth values between these two quantiles are linearly mapped to the range of 0 to 1. Depth values less than the 5th percentile are set to 0, and depth values greater than the 95th percentile are set to 1. In the normalized depth map, values closer to 0 indicate that the pixel is closer to the camera, and values closer to 1 indicate that the pixel is farther away from the camera.
[0024] Depth layers are segmented based on normalized depth maps. K-means clustering is used to hierarchically cluster depth values, with K set to 4, corresponding to four depth ranges: near-field, mid-near-field, mid-far-field, and far-field. The K-means clustering algorithm iteratively optimizes the process, dividing depth values into K clusters, each corresponding to a depth layer. During clustering, K cluster centers are initialized, and the depth value of each pixel is assigned to the nearest cluster center. The cluster center is then updated to the average of all depth values within that cluster, and this assignment and update process is repeated until the cluster centers converge. After clustering, K binary masks are generated based on the clustering results. Each mask identifies the pixel position of a depth layer, with pixels belonging to that layer set to 1 and others set to 0. To avoid hard boundaries between depth layers, each depth layer mask is Gaussian blurred with a blur radius of 5 pixels, resulting in smooth transitions between layers. The output includes the results data of normalized depth map, K depth layer partitioning masks and normalized fog density distribution map, in which the normalized fog density distribution map will be reused in subsequent steps for coarse dehazing preprocessing before semantic segmentation.
[0025] S2, use the depth layer segmentation mask and fog density distribution map to perform coarse dehazing preprocessing on the original foggy image to improve semantic segmentation accuracy and obtain semantic label map and target priority mask; The input consists of the original foggy image, the K depth layer segmentation masks output by S1, and the normalized fog density distribution map. Since the segmentation accuracy of semantic segmentation networks on foggy images decreases with increasing fog density, in dense fog with a visibility of 200 meters, mid-to-far-field vehicles appear as gray blocks, making it difficult for the network to distinguish them from roads or the background. If semantic segmentation is performed directly on the original foggy image, segmentation errors will propagate to all subsequent steps, leading to error accumulation. Therefore, a lightweight coarse dehazing preprocessing step is introduced before semantic segmentation to improve the quality of the input image for semantic segmentation.
[0026] In one embodiment of the present invention, the coarse dehazing step reuses the normalized fog concentration distribution map output in S1. The RGB mean of the top 0.1% of the brightest pixels in the original image is taken as the global atmospheric light estimate. The value of each pixel in the normalized fog concentration distribution map is multiplied by an adjustment coefficient, and then the product is subtracted from 1 to obtain the transmittance estimate of the corresponding pixel, thus constructing a global transmittance estimation map. The default value of the adjustment coefficient is 0.95. This step ensures that areas with higher fog concentrations correspond to lower transmittance, which conforms to the physical laws of atmospheric scattering. Then, a fast global dehazing is performed on the original image according to the inverse operation formula of the atmospheric scattering model to obtain the coarse dehazing image. This step does not pursue a fine dehazing effect, but only needs to restore sufficient semantic discernibility. The entire process is a pure matrix operation, taking approximately 1 to 2 milliseconds at a 1920×1080 resolution, with minimal impact on the total processing time. Subsequent semantic segmentation uses the coarse dehazing image as input, rather than the original foggy image, thereby improving the semantic segmentation accuracy of mid-to-far-field areas and ensuring the reliability of the mask for key target areas.
[0027] A lightweight semantic segmentation network is constructed based on the DeepLabV3+ architecture, using MobileNetV3-Large as the feature extraction backbone and a coarsely dehazed image as input. The DeepLabV3+ architecture comprises two main parts: an encoder and a decoder. The encoder uses dilated convolutional pyramid pooling modules to extract multi-scale semantic features, while the decoder restores spatial resolution through upsampling and feature fusion. The output of the semantic segmentation network is a multi-channel semantic prediction result, where the number of channels equals the number of semantic categories. In this embodiment, the semantic categories include seven categories: roads, vehicles, pedestrians, sky, vegetation, buildings, and others.
[0028] The encoder's MobileNetV3 backbone extracts hierarchical feature representations from the input RGB image, enhancing feature representation capabilities through an inverse residual structure and a squeezed-excitation attention module. The feature maps output from the backbone are input to a dilated spatial pyramid pooling module, which employs parallel dilated convolutional branches with different dilation rates (6, 12, and 18), each capturing contextual information across different receptive fields. The output features from each branch and the global average pooling features are concatenated channel-wise and fused through convolutional layers to obtain encoded features rich in multi-scale semantic information. The decoder upsamples the encoded features by four times and concatenates them with low-level features from the shallow layers of the backbone, which contain rich spatial detail. The concatenated features are then fused and refined through convolutional layers, finally upsampled to the original image resolution to obtain dense pixel-level semantic prediction results.
[0029] The semantic prediction results are post-processed by calculating the probability distribution of each pixel belonging to each semantic category using the Softmax function, and selecting the category with the highest probability as the semantic label for that pixel. A semantic label map is generated, which is a single-channel integer image where the pixel value represents the semantic category number at the corresponding location. To improve the boundary accuracy of semantic segmentation, a Conditional Random Field (CRF) is used for post-processing optimization. The CRF establishes pairwise potential functions between pixels and utilizes color similarity and spatial proximity constraints to smoothly optimize the semantic labels, making neighboring pixels of similar colors tend to have the same semantic label while maintaining the clarity of the target boundary. The optimization process of the CRF is solved iteratively using a mean-field approximation algorithm, with the number of iterations set to 5.
[0030] Binary segmentation masks for each semantic category are extracted from the semantic label map. Vehicle and pedestrian masks are generated separately, with pixel values corresponding to the semantic category set to 1 and other positions set to 0. Combined with the depth-of-field segmentation mask, vehicle and pedestrian regions located within the near-field and mid-near-field layers are extracted as key target regions. The extraction of key target regions is achieved through logical AND operations on the masks. The vehicle mask is ANDed with the near-field mask and the mid-near-field mask respectively to obtain the near-field vehicle mask and the mid-near-field vehicle mask. A similar operation is performed on the pedestrian mask. All key target masks are then merged using a logical OR operation to obtain a unified mask map of the key target regions.
[0031] A depth-semantic joint label map is constructed. This map is a two-channel image; the first channel records the depth layer number of each pixel, and the second channel records the semantic category number. The joint label map provides a fine-grained basis for subsequent region adaptive processing. For key target regions, a target priority mask is generated. This mask is a floating-point number with a value range of 0 to 1.
[0032] In one embodiment of the present invention, the calculation steps of the target priority mask are as follows: Connected component analysis is performed on the key target region mask to extract the connected components of each independent target; the Euclidean distance between the centroid coordinates and the image center coordinates of each connected component is calculated, and this distance is normalized by dividing it by the length of the image diagonal. Then, the normalized distance value is subtracted from 1 to obtain the position weight of the target; the closer the centroid is to the image center, the greater the position weight; the pixel area of each connected component is calculated, and the area is normalized by dividing it by the total number of pixels in the image to obtain the size weight of the target; the position weight and size weight are multiplied to obtain the original priority score of the target, and all pixels within the same connected component are assigned the same original priority score; the original priority scores of all targets in the image are normalized so that the sum of the priority weights of all target regions is 1, resulting in the final target priority mask. This calculation method ensures that large vehicles (vehicles traveling directly ahead) in the image center region receive the highest priority, while small targets at the edges receive lower priority, which meets the actual need in highway monitoring scenarios to prioritize defogging quality for vehicles traveling directly ahead. Output semantic label map, vehicle mask, pedestrian mask, key target area mask, depth-semantic joint label map, and target priority mask.
[0033] S3. Based on the semantic label map and the depth layer segmentation mask, extract the differential prior response layer by layer according to the optical physical characteristics of each semantic region to obtain the multi-prior feature tensor and the prior response map of each depth layer. In one embodiment of the present invention, differentiated prior extraction methods are designed for four main semantic regions: roads, vehicles, sky, and vegetation. Road regions typically exhibit darker color features and flatter textures, making them suitable for using dark channel priors to estimate fog concentration. Vehicle regions have rich color and texture information, and vehicle surfaces typically have high reflectivity, making them suitable for using maximum reflectivity priors. Sky regions are typical areas where dark channel priors fail, as these regions have high brightness and relatively uniform color, making them suitable for using color constancy constraints. Vegetation regions have obvious green channel response characteristics, making them suitable for using green channel priors.
[0034] Dark channel prior responses are extracted for road regions. The pixel locations of road regions are determined based on the semantic label map, and dark channel calculations are performed on the road regions of the original image. Dark channel calculation consists of two steps: first, the minimum value of the RGB channels is calculated at each pixel location to obtain the minimum channel image. The formula is to take the minimum value of the R, G, and B channels for each pixel. Then, a local window minimum filtering is applied to the minimum channel image. The window size is set to 15×15 pixels, and the minimum value within the window is taken as the dark channel value of the center pixel of that window. The dark channel value reflects the fog density intensity of the region; a larger dark channel value indicates a higher fog density. The dark channel response map of the road region is normalized and mapped to the range of 0 to 1.
[0035] The maximum reflectance a priori response is extracted for the vehicle region. The reflectance of a vehicle surface is typically high in fog-free conditions, but decreases due to atmospheric scattering in foggy conditions. The pixel locations of the vehicle region are determined based on the semantic tag map, and the maximum reflectance is calculated for the vehicle region in the original image. The maximum value of the RGB three channels is calculated at each pixel location, resulting in the maximum value channel image. A local window maximum filtering is applied to the maximum value channel image, with a window size of 11×11 pixels. The maximum value within the window is taken as the maximum reflectance response value of the center pixel of that window. The reciprocal of the maximum reflectance response value reflects the fog concentration; a lower response value indicates a higher fog concentration. The maximum reflectance response map of the vehicle region is then normalized.
[0036] Color constrained responses for the sky region are extracted. Under ideal, fog-free conditions, the sky region should exhibit a blue hue; under foggy conditions, atmospheric scattering causes it to appear whitish. Pixel locations in the sky region are determined based on the semantic tag map, and color deviation is calculated using the gray-world assumption. The gray-world assumption posits that the average value of each color channel in the image should be close to the grayscale value. The average values of the RGB channels in the sky region are calculated, denoted as R-mean, G-mean, and B-mean, respectively. The overall average value is calculated as the mean of the RGB channel averages. The deviation of each channel is calculated using the formula: channel average minus the absolute value of the overall average. For each pixel in the sky region, the deviation of its RGB channel values from the corresponding channel averages is calculated, and the sum of the squares of the three channel deviations is taken as the color deviation response value for that pixel. A larger color deviation indicates that the pixel's color deviates more from the ideal sky color, reflecting a higher fog concentration. The color deviation response map of the sky region is then normalized.
[0037] Prior responses for the green channel are extracted from vegetated areas. In fog-free conditions, the green channel values in vegetated areas are higher than those of the red and blue channels, but the differences between channels decrease in foggy conditions. The pixel locations of vegetated areas are determined based on the semantic label map, and the difference features between the green channel and other channels are calculated for the vegetated areas of the original image. The differences between the green channel values and the red channel values, and between the green channel values and the blue channel values, are calculated, and the average of these two differences is used as the prior response value for the green channel. A smaller response value indicates a smaller difference between channels and a higher fog concentration. The prior response map of the green channel in the vegetated area is normalized and inverted to ensure a positive correlation between the response value and the fog concentration.
[0038] For each depth layer, the four types of prior responses are extracted. Based on the depth layer partitioning mask, the original image and semantic label map are divided into K depth layer sub-images. For each depth layer sub-image, four types of prior response maps are extracted using the method described above: dark channel for road areas, maximum reflectivity for vehicle areas, color deviation for sky areas, and green channel for vegetation areas. Each depth layer yields four prior response maps, and a total of 4K prior response maps are obtained across K depth layers. The four prior response maps of the same depth layer are stacked along the channel dimension to form the four-channel prior feature map of that layer. For buildings and "other" category areas, due to the diverse surface materials of buildings (glass curtain walls, concrete, metal structures, etc.) and their vastly different optical properties, no single prior is universally applicable, and forcibly applying any single prior will introduce incorrect constraints. The "other" category, as a catch-all category, has uncertain optical properties and is also unsuitable for using a fixed prior. Therefore, the prior response values for these two categories are set to 0, and the subsequent adaptive weight prediction network adaptively determines the dehazing intensity based on local features, rather than relying on prior constraints. The prior feature maps of K depth layers are further stacked to form a high-dimensional multi-prior feature tensor, with dimensions of image height × image width × 4K channels. Simultaneously, a hierarchical set of prior response maps is output, containing independent response maps for each class of prior at each depth layer, used for subsequent hierarchical weighted fusion. The output includes the multi-prior feature tensor and the prior response maps for each semantic category at each depth layer.
[0039] S4 inputs multiple prior feature tensors and target priority masks into a dual-branch lightweight convolutional network, and jointly predicts prior fusion weight vectors and spatial adaptive fusion weight maps through a target attention mechanism; The system receives the original foggy image, normalized depth map, semantic label map, multiple prior feature tensors, key target region masks, and target priority masks as input. An adaptive weight prediction network is designed, aiming to learn how to dynamically select and fuse multiple prior constraints and adjust the defogging intensity for different regions under varying fog density distributions and scene semantic structures. The network employs a lightweight architecture, reducing computational complexity through depthwise separable convolutions and bottleneck layers while ensuring real-time processing capabilities.
[0040] The network input consists of concatenated multi-channel features. The semantic label map is one-hot encoded before being input into the network, converting the single-channel integer label map into a 7-channel semantic feature map. Each channel corresponds to a binary mask for a semantic category, avoiding the introduction of the category number's numerical value into the convolution operation. The original RGB three-channel image, the normalized depth single-channel image, the 7-channel semantic feature map, and the 4K-channel tensor of multiple prior features are concatenated according to channel dimensions to form a 3+1+7+4K-channel input tensor.
[0041] In one embodiment of the present invention, in order to enhance the network's ability to perceive fog concentration, the global average fog concentration index of the original image is calculated. The average dark channel value of the entire image is calculated using the dark channel prior method as the fog concentration index. This scalar value is encoded into a fog concentration embedding vector through a fully connected layer. The fog concentration embedding vector is extended to the spatial dimension through a broadcast operation and concatenated with the input tensor through channels, so that the network can explicitly perceive the overall fog concentration level of the current image.
[0042] The network employs an encoder structure to extract multi-scale features. The encoder comprises four downsampling stages, each using depthwise separable convolutions with a stride of 2 for downsampling, resulting in 32, 64, 128, and 256 feature channels respectively. Each stage includes two inverse residual bottleneck modules, each employing a structure of 1×1 convolution for channel expansion, 3×3 depthwise convolution for spatial feature extraction, and 1×1 convolution for channel compression. After channel compression, a squeeze-excited attention module is introduced, acquiring global channel information through global average pooling, learning the inter-channel dependencies through two fully connected layers, generating channel attention weights, and performing weighted calibration on the feature channels. The encoder outputs feature maps at four different scales, capturing hierarchical feature representations from local details to global semantics.
[0043] The network is designed with two independent prediction branches, one for predicting prior fusion weights and the other for predicting dehazing intensity weights. The first branch is the prior fusion weight prediction branch, which performs global average pooling on the deepest features output by the encoder to obtain the feature vector.
[0044] In one embodiment of the invention, the feature vector undergoes a nonlinear transformation through two fully connected layers. The first fully connected layer maps the feature vector to 256 dimensions and activates it using ReLU. The second fully connected layer maps the 256-dimensional feature vector to K×4 dimensions, outputting fusion weights for the four prior categories corresponding to each of the K depth layers. The four weight values for each depth layer are normalized using the Softmax function to ensure that the sum of the prior weights within the same depth layer is 1. The prior fusion weight vector reflects which types of prior constraints should be emphasized in different depth layers. Through training, the network learns a fusion strategy: the near-field layer should emphasize vehicle reflection priors, the mid-field layer should balance multiple priors, and the far-field layer should emphasize dark channel priors.
[0045] The second branch is the dehazing intensity weight prediction branch, which uses a decoder structure to recover spatial resolution from the multi-scale features of the encoder. The decoder contains four upsampling stages, each performing a 2x upsampling through bilinear interpolation, then concatenating it with features of the corresponding scale from the encoder via skip connections, and finally fusing features through convolutional layers. The decoder progressively restores the feature map to the original image resolution, ultimately outputting a single-channel dehazing intensity weight map. The value range of the dehazing intensity weight map is constrained between 0 and 1 by the sigmoid activation function; a larger weight value indicates a stronger dehazing process should be applied at that location, while a smaller weight value indicates a more conservative dehazing approach to avoid noise amplification.
[0046] To enhance the dehazing effect in key target areas, a target attention mechanism is introduced during the generation of the dehazing intensity weight map. In one embodiment of the invention, the key target area mask and target priority mask output from the previous step are received. The target priority mask is used as an attention weight to spatially weight the feature map of the last layer of the decoder. The feature values at the key target area locations are amplified, causing the network to predict higher dehazing intensity weight values at these locations. Through this mechanism, the network learns that dehazing quality should be prioritized for important target areas such as vehicles and pedestrians, while the dehazing intensity can be reduced for secondary areas such as the sky and distant scenery to save computational resources and avoid artifacts.
[0047] The outputs of the two branches are combined to generate a spatially adaptive fusion weight map. The fusion weight map is a multi-channel image, with each channel corresponding to a combination of depth layer and prior type.
[0048] In one embodiment of the present invention, based on the prior fusion weight vector and the dehazing intensity weight map, the fusion weight coefficient of each pixel position under each prior constraint is calculated: for a pixel position at depth layer k, its fusion weight under prior type p is calculated as the prior fusion weight value corresponding to that depth layer multiplied by the dehazing intensity weight value at that position. Through this decomposition method, joint optimization of prior selection at the depth layer level and intensity adjustment at the pixel level is achieved. The prior fusion weight vector, the dehazing intensity weight map, and the spatial adaptive fusion weight map are output.
[0049] In one embodiment of the present invention, the adaptive weight prediction network is trained in a supervised manner. The training data is constructed based on a synthetic fog dataset. Fog images are synthesized using an atmospheric scattering model on the KITTI outdoor driving dataset and additionally collected clear-sky images of highway monitoring scenes (with corresponding depth information obtained from roadside LiDAR). During synthesis, the true depth map corresponding to each image is retained, and a pixel-level transmittance ground truth map is calculated according to the atmospheric scattering equation. The default value of the atmospheric scattering coefficient β is 0.1, and during synthesis, β is randomly sampled within the range of 0.05 to 0.3 to cover different fog concentration conditions. The KITTI dataset represents an outdoor driving scene, which has a high similarity to the highway monitoring scene in terms of viewpoint and scene content. The clear-sky images of the highway monitoring scene further narrow the domain gap between the training data and the actual application scenario, improving the network's generalization performance under the fixed camera viewpoint on highways. The network's loss function consists of three terms: the first is the transmittance prediction loss, which calculates the L1 loss between the network's predicted transmittance map and the actual transmittance map used in synthesis, directly supervising the network's ability to estimate physical parameters; the second is the dehazing reconstruction loss, which substitutes the predicted transmittance map and estimated atmospheric light values into the inverse formula of the atmospheric scattering model to recover the dehazed image, and calculates the perceptual loss based on VGG-16 features between the recovered image and the clear original image, constraining the visual quality of the dehazing result; the third is the prior consistency loss, which constrains the predicted prior fusion weights to maintain consistency with the statistical distribution of the prior response maps of each depth layer, preventing the network from ignoring prior information and degenerating into a purely data-driven end-to-end dehazing. The weight coefficients of the three losses are 1.0, 0.5, and 0.2, respectively. The network is trained using the Adam optimizer, with a default initial learning rate of 0.0001, a default number of training epochs of 100, and a default batch size of 4.
[0050] S5, based on the prior fusion weight vector and fusion weight map, the prior responses of each depth layer are weighted and integrated. Through the parameter estimation of the hierarchical physical model and the guided filtering optimization, the local atmospheric light value and fine transmittance map of each depth layer are obtained. The system receives multiple prior feature tensors, prior response maps for each depth level, depth level partitioning masks, prior fusion weight vectors, and spatially adaptive fusion weight maps as input. For each depth level k, independent physical model parameter estimation is performed. Four prior weight values corresponding to that depth level are extracted from the prior fusion weight vector: road dark channel weight, vehicle reflectivity weight, sky color weight, and vegetation green channel weight. Four prior response maps for each depth level are extracted from the prior response map set: road area dark channel response map, vehicle area reflectivity response map, sky area color response map, and vegetation area green channel response map.
[0051] A weighted fusion of the four prior response maps for the depth layer is performed. For each pixel location, the product of the four prior response values at that location and the corresponding prior weight value is calculated, and the four product results are added together to obtain the fused prior response value for that pixel. Since only the corresponding type of prior response value is non-zero in different semantic regions, the fusion process actually selects the corresponding prior response based on the semantic category of the pixel and modulates it according to the prior weights of the depth layer. The resulting fused prior response map for the depth layer integrates the prior information of different semantic regions and the prior preferences of the depth layer.
[0052] The local atmospheric light value of the depth layer is estimated based on the fused prior response map. The atmospheric light value represents the ambient light intensity at infinity and is an important parameter in the physical model. In one embodiment of the present invention, a multi-candidate value scheme is used for estimation: several pixels with the highest brightness in the depth layer are extracted as candidates; the brightness value of each pixel in the original image within the mask range of the depth layer is calculated; the brightness value is calculated by weighted average of the RGB three-channel values; the brightness values are sorted in descending order; the first 1% of pixel positions after sorting are selected; the RGB mean of these pixel positions in the original image is calculated as the first candidate atmospheric light value; pixels in the sky region of the depth layer are extracted; the sky pixel positions are determined according to the intersection of the semantic label map and the depth layer mask; the RGB mean of the pixels in the sky region is calculated as the second candidate atmospheric light value; the average value of the fused prior response map of the depth layer is calculated; the two candidate atmospheric light values are weighted and averaged according to the prior response intensity as the candidate weight to obtain the local atmospheric light value Ak of the depth layer, which is a vector containing the RGB three components.
[0053] The initial transmittance map of this depth layer is estimated based on the fusion of the prior response map and local atmospheric light values. Transmittance represents the proportion of light that is not scattered when propagating in the atmosphere and is a core parameter of the atmospheric scattering model. According to the physical laws of atmospheric scattering, transmittance and propagation distance satisfy an exponential decay relationship, that is, transmittance equals the natural constant e raised to the power of negative β, where β is the atmospheric scattering coefficient and d is the propagation distance.
[0054] In one embodiment of the present invention, the atmospheric scattering coefficient β is estimated from the normalized fog concentration distribution map output by S1. The specific steps are as follows: calculate the mean of the normalized fog concentration distribution map for the entire map, denoted as dc_mean, which reflects the average fog concentration intensity of the entire map; since fog concentration and transmittance are inversely correlated, the approximate value of the global average transmittance t_mean is equal to 1 minus dc_mean; then take the mean of the normalized depth map of the entire map d_mean as the approximate average propagation distance of the entire map; finally, calculate the value of β by dividing the natural logarithm of the negative t_mean by d_mean. When t_mean approaches 1 (light fog), β approaches 0, and when t_mean approaches 0 (heavy fog), β takes a larger positive value, which is consistent with the physical meaning of the atmospheric scattering coefficient. For depth layer k, its adjustment coefficient ωk is calculated as follows: The mean depth value of all pixels within the depth layer is taken as the representative depth dk_mean. Then, 1 is subtracted from the power of dk_mean multiplied by negative β, i.e., ωk equals 1 minus the result of dk_mean multiplied by negative β. The physical meaning of this adjustment coefficient is the theoretical fog concentration of depth layer k under current weather conditions. The near-field layer represents a smaller depth, hence ωk is smaller; the far-field layer represents a larger depth, hence ωk is larger. The coefficient automatically adjusts with weather conditions (β value). In light fog, the coefficients of each layer differ little; in heavy fog, the coefficient of the far-field layer increases significantly. Based on the fusion prior response map, the transmittance estimation formula is: the transmittance value of each pixel within the depth layer equals 1 minus the fusion prior response value of that pixel multiplied by the adjustment coefficient ωk. The transmittance value range is constrained between 0 and 1; the closer the value is to 1, the lower the fog concentration at that location; the closer the value is to 0, the higher the fog concentration.
[0055] The initial transmittance map is optimized to eliminate noise and block artifacts. A guided filtering method is used to smooth the edges of the transmittance map. Guided filtering is an edge-preserving filtering algorithm that can smooth noise while retaining the edge structure of the image. The original foggy image is used as the guide map, and the initial transmittance map is used as input for guided filtering. The window radius of the guided filter is set to 40 pixels, and the regularization parameter is set to an adaptive value, dynamically adjusted according to the local variance of the guide map. A larger regularization parameter is used in textured areas to preserve edges, and a smaller regularization parameter is used in flat areas to achieve sufficient smoothing. The output of the guided filter is the optimized transmittance map, which eliminates noise and discontinuities in the initial estimate while maintaining sharp object edges.
[0056] The above parameter estimation process is performed on K depth layers respectively, resulting in K local atmospheric light values and K optimized transmittance maps. Since each depth layer is estimated independently, visual artifacts may exist at the interlayer boundaries due to parameter discontinuities. To eliminate interlayer boundary artifacts, the transmittance maps of each depth layer are smoothed. In one embodiment of the invention, an edge-aware adaptive fusion strategy is adopted: Canny edge detection is performed on the original image to extract the binary edge map, and the edge intensity is normalized to the range of 0 to 1 as the edge weight map; for the boundary region between adjacent depth layers k and k+1, the absolute value of the difference between the normalized depth value of the pixel and the cluster center depth value of depth layer k, and the absolute value of the difference between the normalized depth value of the pixel and the cluster center depth value of depth layer k+1 are calculated. The reciprocals of the two differences are normalized to obtain the initial fusion weight based on depth distance; then the initial fusion weight is multiplied by the edge weight of the pixel position. In the position where there is a strong edge, the edge weight is close to 1 to keep the fusion weight clear, and in the flat area, the edge weight is close to 0 to make the fusion weight tend to be smooth; the fusion weight is normalized so that the sum of the weights of two adjacent layers is 1, and the transmittance values of adjacent depth layers are weighted and summed according to the weight. The above fusion process is performed sequentially on all adjacent depth layers to obtain a global smooth transmittance map, which achieves a natural transition between depth layers while maintaining the sharpness of object edges.
[0057] The transmittance map is modulated based on the dehazing intensity weight map. In one embodiment of the invention, the dehazing intensity weight map reflects the dehazing intensity to be applied to different regions, and regions with lower weight values should be dehazed conservatively. For each pixel in the transmittance map, its transmittance value is interpolated to 1, and the interpolation ratio is determined by the dehazing intensity weight. The modulated transmittance value is calculated as the result of multiplying the dehazing intensity weight by the original transmittance value, adding 1 and subtracting the dehazing intensity weight. In this way, the transmittance value is increased in positions with lower dehazing intensity weight, thereby weakening the dehazing effect. For key target areas, since the dehazing intensity weight is higher, the transmittance remains at a lower value to ensure sufficient dehazing. For background and distant areas, the transmittance is appropriately increased to avoid noise amplification caused by excessive dehazing.
[0058] The modulated transmittance map is subjected to minimum value constraint processing, limiting the transmittance values to above a set lower threshold. The lower threshold is set to 0.1 to avoid division by zero and excessive noise amplification during the inverse operation of the atmospheric scattering model due to excessively low transmittance. For pixels with transmittance below the lower threshold, their transmittance values are set to the lower threshold. The output includes a set of local atmospheric light values for each depth layer and a refined transmittance map that has undergone optimization, smoothing, modulation, and constraint processing.
[0059] S6 uses a fine transmittance map and local atmospheric light values at each depth of field to perform layered atmospheric scattering inverse operation to recover scene radiation. Combined with color correction, contrast enhancement and target detail enhancement post-processing, a clear dehazed image is obtained. The system receives the original foggy image, a detailed transmittance map, local atmospheric light value sets for each depth layer, depth layer segmentation masks, key target region masks, and target priority masks as input. It then recovers the scene radiance of the fog-free image using the inverse operation formula of the atmospheric scattering physical model. The atmospheric scattering model describes the formation process of a foggy image; the formula is: foggy image equals scene radiance multiplied by transmittance plus atmospheric light multiplied by 1 minus transmittance. Here, scene radiance represents the true scene brightness under fog-free conditions, transmittance represents the proportion of light that is not scattered, and atmospheric light represents the ambient light intensity. The inverse operation formula, obtained through algebraic transformation, yields scene radiance equals the foggy image minus atmospheric light divided by transmittance plus atmospheric light.
[0060] The inverse operation is performed on each pixel location of the image. In one embodiment of the invention, the depth layer number to which the pixel belongs is determined based on its location. The depth layer partitioning mask is used to determine which of the K depth layers the pixel belongs to. The local atmospheric light value Ak (an RGB three-channel vector) corresponding to the depth layer is extracted from the local atmospheric light value set of each depth layer. The transmittance value t of the pixel location is extracted from the fine transmittance map. The RGB value I of the pixel location is extracted from the original foggy image. For each color channel c, the fog-free value Jc is calculated: Jc equals the fog value Ic of that channel minus the atmospheric light value Akc of that channel in that depth layer, divided by the transmittance t, plus the atmospheric light value Akc. Since the transmittance has exceeded the lower threshold constraint, the division operation will not result in division by zero. The calculated fog-free values are truncated, with values less than 0 set to 0 and values greater than 255 set to 255 to ensure that the pixel values are within the valid range. The inverse operation is performed on all pixels to obtain a preliminarily restored fog-free image.
[0061] Color correction is performed on the initially restored haze-free image to eliminate potential color cast issues. During the dehazing process, errors in atmospheric light estimation and transmittance estimation may cause an overall color shift in the restored image. A gray-world algorithm is used for white balance adjustment, assuming that the average values of all color channels in the image should be equal. The global average values of the RGB channels of the haze-free image are calculated, namely the average values of the R, G, and B channels. The mean of these three channel averages is used as a reference grayscale value. A scaling factor for each channel is calculated using the formula: reference grayscale value divided by the average value of that channel. For each pixel in the haze-free image, its RGB channel values are multiplied by the corresponding scaling factor to obtain the color-corrected image. The corrected pixel values are truncated to ensure they fall within the range of 0 to 255.
[0062] Contrast enhancement is performed on the color-corrected image to improve visual quality. While dehazing eliminates haze, the image may still suffer from low contrast. A contrast-limited adaptive histogram equalization algorithm is used for contrast enhancement, which avoids noise amplification due to over-enhancement. The image is divided into several small blocks, each 8×8 pixels in size. Histogram equalization is performed on each block individually, but the contrast enhancement is limited. The histogram for each block is calculated, and the number of pixels exceeding a certain threshold is reduced, with the reduced pixels evenly distributed across other gray levels. The threshold is adaptively determined based on the standard deviation of the block; a larger threshold is used for textured areas with a larger standard deviation, and a smaller threshold is used for flat areas with a smaller standard deviation. The cumulative distribution function is calculated and gray-level mapping is performed on the limited histogram to obtain the enhancement result for that block. Bilinear interpolation is then applied to fuse the enhancement results of all blocks to eliminate block boundary artifacts, resulting in a globally contrast-enhanced image.
[0063] Detail enhancement processing is performed on key target regions. Vehicle and pedestrian regions are extracted based on the key target region mask, and edge-preserving detail enhancement algorithms are applied to these regions. A non-sharpening masking method is used for detail enhancement. A Gaussian blur is applied to the image to obtain a smoothed version. Then, the difference between the original image and the smoothed image is calculated to obtain the detail layer, which is added to the original image according to the enhancement coefficient. In one embodiment of the invention, the enhancement coefficient is determined based on the target priority mask. Higher priority targets use larger enhancement coefficients, thus enhancing the details such as license plate characters and textures of large vehicles directly in front, while the enhancement of small edge targets is relatively smaller, achieving differentiated detail enhancement that matches the importance of the targets. After detail enhancement, the texture of vehicles, license plate characters, and the outlines of pedestrians are improved, which is beneficial for subsequent recognition tasks.
[0064] The image boundaries and depth-of-field transition regions are smoothed. In one embodiment of the invention, the depth-of-field boundary regions are determined as follows: a logical XOR operation is performed on the binary masks of adjacent depth-of-field layers to obtain a boundary position map between adjacent depth-of-field layers. Then, a morphological dilation operation is performed on the boundary position map, with a default dilation radius of 10 pixels, to obtain a depth-of-field boundary region mask. A bilateral filter is applied to the area covered by the depth-of-field boundary region mask. The bilateral filter can smooth noise while maintaining edge clarity. The spatial domain standard deviation is set to 5, and the value domain standard deviation is adaptively determined based on local variance. The areas not covered by the depth-of-field boundary region mask remain unchanged. This method directly applies smoothing to known artifact source locations (boundaries where depth-of-field parameters are discontinuous), avoiding erroneous smoothing of texture-rich areas (such as license plates and road markings), resulting in a final dehazed image. A clear dehazed image is output as the final processing result.
[0065] In one embodiment of the present invention, applied to the field of intelligent transportation highway monitoring, the application effect of the technical solution is illustrated by taking the image processing in foggy weather in a real monitoring scenario as an example.
[0066] High-definition cameras with a resolution of 1920×1080 were deployed at a highway monitoring point for real-time surveillance. One morning, dense fog reduced visibility to approximately 200 meters, severely degrading the quality of the surveillance images. Several frames of images taken in the foggy weather were collected as test data to verify the processing effectiveness of the method proposed in this invention.
[0067] Tables 1 and 2 show examples of some of the data obtained during the testing process: Table 1. Examples of Depth-of-Field Layering Results
[0068] Table 2, Examples of semantic segmentation results
[0069] During processing, the system automatically identified 12 vehicles in the image, with 3 located in the near-field layer, 6 in the mid-near-field layer, and 3 in the mid-far-field layer. For the vehicle areas in the mid-near-field layer, the system automatically increased the defogging intensity weight to 0.9 to ensure that license plate information was fully restored. For the sky area in the far-field layer, the system decreased the defogging intensity weight to 0.5 to avoid excessive noise amplification.
[0070] After processing using the method of this invention, the detailed textures of near-field vehicles in the dehazed image are preserved, the license plate characters of mid-field vehicles are clearly discernible, the outline features of distant vehicles are restored, and no obvious color cast appears in the sky area, resulting in a natural overall visual effect. Regarding processing time, experiments were conducted on a server equipped with an NVIDIA Tesla T4 GPU (16GB VRAM), using the TensorRT 8.0 inference framework and FP16 precision quantization. The processing time for a single 1920×1080 image was 28 milliseconds, meeting the real-time processing requirement of 30 frames per second. After deployment on a roadside edge computing device (NVIDIA Jetson AGX Xavier) with INT8 quantization, the processing time for a single frame was approximately 45 milliseconds, meeting the processing requirement of 20 frames per second, and is suitable for practical deployment scenarios of roadside embedded devices.
[0071] Through testing with the vehicle recognition module at the back end of the monitoring system, the accuracy of vehicle detection and license plate recognition in the defogging image was improved, verifying the effectiveness of the method of the present invention in practical applications.
[0072] The above description is only a specific embodiment of the present invention. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art based on the technical solution of the present invention should be included within the protection scope of the present invention.
[0073] The embodiments of the present invention have been described above. However, the embodiments are not limited to the specific implementation methods described above. The specific implementation methods described above are merely illustrative and not restrictive. Those skilled in the art can make more equivalent embodiments under the guidance of the present embodiments, and all of them are within the protection scope of the present embodiments.
Claims
1. An image dehazing method based on a physical model and prior constraints, characterized in that, Includes the following steps: S1, acquire the original foggy image; correct the foggy depth estimation bias with the fog concentration distribution map, and obtain the depth layer segmentation mask and fog concentration distribution map through monocular depth estimation network and depth clustering analysis; S2, use the depth layer segmentation mask and fog density distribution map to perform coarse dehazing preprocessing on the original foggy image to improve semantic segmentation accuracy and obtain semantic label map and target priority mask; S3, based on the semantic label map and depth layer segmentation mask, extracts differentiated prior responses hierarchically for the optical and physical characteristics of each semantic region, obtaining multiple prior feature tensors and prior response maps for each depth layer; including: For road areas, a dark channel prior is used to extract fog concentration response; for vehicle areas, a maximum reflectance prior is used to extract reflectance response; for sky areas, color constancy constraints are used to extract color deviation response; and for vegetation areas, a green channel prior is used to extract channel difference response. Four types of prior response maps are extracted for each depth layer and stacked according to the channel dimension. The prior feature maps of each depth layer are further stacked to form the multi-prior feature tensor, and the prior response maps of each depth layer are output. S4 inputs multiple prior feature tensors and a target priority mask into a dual-branch lightweight convolutional network, and jointly predicts the prior fusion weight vector and the spatial adaptive fusion weight map through a target attention mechanism; including: The dual-branch lightweight convolutional network includes a prior fusion weight prediction branch and a dehazing intensity weight prediction branch. The prior fusion weight prediction branch performs global average pooling on the deepest features of the encoder and then maps them to a K×4-dimensional vector through a fully connected layer. The four weight values of each depth layer are normalized by Softmax to obtain the prior fusion weight vector. The dehazing intensity weight prediction branch restores the spatial resolution through the decoder and outputs the dehazing intensity weight map after Sigmoid constraint; the target attention mechanism uses the target priority mask as attention weight to spatially weight the features of the last layer of the decoder, so that the key target region location is predicted with a higher dehazing intensity weight value. S5, based on the prior fusion weight vector and fusion weight map, performs weighted integration of the prior responses of each depth layer, and obtains the local atmospheric light values and fine transmittance maps of each depth layer through hierarchical physical model parameter estimation and guided filtering optimization; including: For each depth layer, the local atmospheric light value is estimated. The average RGB value of the pixels in the corresponding depth layer with a preset proportion of brightness ranking is taken as the first candidate value, and the average RGB value of the pixels in the sky region in the corresponding depth layer is taken as the second candidate value. The local atmospheric light value is obtained by weighting the two candidate values according to the average value of the fused prior response map. Calculate the mean value of the fog concentration distribution map across the entire map, subtract the mean value of the entire map from 1 to obtain the approximate value of the global average transmittance, take the mean value of the entire depth map across the entire map as the approximate value of the global average propagation distance, and derive the atmospheric scattering coefficient by dividing the natural logarithm of the negative approximate value of the global average transmittance by the approximate value of the global average propagation distance. For each depth layer, the average depth value of all pixels in the corresponding layer is taken as the representative depth. The adjustment coefficient of the corresponding depth layer is equal to 1 minus the power of the atmospheric scattering coefficient multiplied by the representative depth, with the natural constant e as the base and the negative as the exponent. The transmittance value of each pixel is equal to 1 minus the fusion prior response value of that pixel multiplied by the adjustment coefficient of the depth layer to which it belongs. Also includes: The transmittance maps of each depth layer are independently estimated and then processed to achieve smooth transition between layers. The initial fusion weight is determined by the reciprocal of the difference between the normalized depth value of the pixel and the depth value of the cluster center of the adjacent depth layer. The initial fusion weight is multiplied by the edge weight obtained based on edge detection and then normalized. The transmittance values of the adjacent depth layers are then summed according to the weight. The transmittance map is modulated according to the defogging intensity weight map. The modulated transmittance value is equal to the defogging intensity weight multiplied by the original transmittance value plus 1 minus the defogging intensity weight, and the transmittance value is limited to above a preset lower threshold to obtain a fine transmittance map. S6 uses a detailed transmittance map and local atmospheric light values at each depth of field to perform layered atmospheric scattering inverse operations to recover scene radiation. Combined with color correction, contrast enhancement, and target detail enhancement post-processing, a clear dehazed image is obtained.
2. The image dehazing method based on a physical model and prior constraints according to claim 1, characterized in that, S1 includes: The original foggy image is processed by a dark channel prior method to calculate the local window minimum and then filtered by the minimum value to obtain a normalized fog concentration distribution map. The fog concentration distribution map is used as an auxiliary channel and stitched with the original RGB image to form a four-channel data and fed into a monocular depth estimation network. This allows the network to distinguish between the increase in brightness caused by the close distance of the target and the increase in brightness caused by the high fog concentration during the feature extraction stage, thus correcting the underestimation of the depth of distant objects under foggy conditions. The depth prediction map output by the network is normalized by quantiles, and then the normalized depth values are divided into multiple depth layers by a clustering algorithm to generate the corresponding depth layer partitioning mask.
3. The image dehazing method based on a physical model and prior constraints according to claim 1, characterized in that, S2 includes: The fog concentration distribution map is reused, and the RGB mean value of the pixel with the highest brightness in the original foggy day image is taken as the global atmospheric light estimate. The value of each pixel in the fog concentration distribution map is multiplied by a preset adjustment coefficient and then the product is subtracted from 1 to obtain the transmittance estimate of the corresponding pixel, thus constructing a global transmittance estimate map. The original foggy image is globally dehazed according to the inverse operation formula of the atmospheric scattering model to obtain a coarse dehazed image. The coarse dehazed image is then used as the input of a semantic segmentation network for scene semantic parsing to obtain a semantic label map.
4. The image dehazing method based on a physical model and prior constraints according to claim 1, characterized in that, S2 further includes: Vehicle and pedestrian masks are extracted from the semantic label map. The vehicle and pedestrian masks are then combined with the near-field mask and the mid-near-field mask by performing a logical AND operation to obtain the key target area mask. Connectivity analysis is performed on the key target region mask. For each connected component, a position weight and a size weight are calculated. The position weight is obtained by inverting the normalized distance from the centroid of the connected component to the image center. The size weight is obtained by the normalized ratio of the area of the connected component pixels to the total number of pixels in the image. The position weight and the size weight are multiplied and normalized to obtain the target priority mask.
5. The image dehazing method based on a physical model and prior constraints according to claim 1, characterized in that, S4 further includes: The spatial adaptive fusion weight map is a multi-channel image, with each channel corresponding to a combination of a depth layer and a prior type. For a pixel position in depth layer k, its fusion weight under prior type p is equal to the prior fusion weight value of the corresponding depth layer multiplied by the dehazing intensity weight value of the corresponding position, thus achieving joint optimization of prior selection at the depth layer level and intensity adjustment at the pixel level.
6. The image dehazing method based on a physical model and prior constraints according to claim 1, characterized in that, S6 includes: For each pixel, the depth layer is determined by dividing the mask according to the depth layer. The corresponding value is taken from the local atmospheric light value of each depth layer. The fog-free image is restored pixel by pixel by combining the fine transmittance map and the inverse calculation formula of the atmospheric scattering model. The key target areas are enhanced with a non-sharpening masking method. The enhancement coefficient is determined by the target priority mask. The higher the priority of the target area, the larger the enhancement coefficient is applied.
Citation Information
Patent Citations
Depth end-to-end image defogging method based on physical constraint
CN120823118A
Density perception image defogging method combined with physical prior
CN121837076A