Monocular camera visibility estimation method and device
By combining a monocular camera with an SVM classifier and a deep network model, daytime and nighttime scenes are distinguished. Visibility is estimated using atmospheric scattering parameters and illuminance information, which solves the problems of inaccurate depth estimation and high cost in existing methods, and achieves high-precision and low-cost visibility estimation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-10
AI Technical Summary
Existing visibility estimation methods are inaccurate in depth estimation under complex road conditions and variable weather conditions, and do not make full use of depth information, resulting in transmittance estimation deviating from reality. Furthermore, multi-view estimation methods are costly and have poor scalability.
A monocular camera combined with a support vector machine (SVM) classifier and a deep network model was used to distinguish between daytime and nighttime scenes. Visibility was estimated using atmospheric scattering parameters and illuminance information, and transmittance was calculated using depth information. Visibility was then estimated using the Koschmieder formula and a simplified illuminance model.
It achieves high-precision visibility estimation in various road scenarios and different weather conditions, reducing equipment costs and improving the accuracy and adaptability of the estimation.
Smart Images

Figure CN121639626A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and apparatus for estimating visibility using a monocular camera. Background Technology
[0002] With the development of intelligent monitoring systems for highways, environmental perception technology based on video images is playing an increasingly important role in ensuring traffic safety. Visibility, as a key indicator for measuring the impact of weather conditions on road traffic, is crucial for early warning and traffic control during severe weather. In recent years, image analysis-based visibility estimation methods have gradually attracted attention, especially given the widespread deployment of road video surveillance systems. How to fully utilize monocular video image resources to effectively infer visibility levels from images has become a research direction with practical application value.
[0003] For images, visibility information is closely related to atmospheric transmittance. Due to the scattering effect of suspended particles in the air, the image brightness of distant targets is significantly affected, resulting in decreased image contrast and scene blur. According to atmospheric scattering models, each pixel in an image can be composed of a direct transmittance term and an atmospheric light term, where transmittance reflects the degree of attenuation experienced by light as it travels from the target to the camera, and is directly related to scene depth and aerosol concentration. Therefore, estimating transmittance is of great significance for recovering a clear image and deducing the visibility level of the current environment.
[0004] In practical applications, transmittance estimation often relies on depth information from the scene. Traditional methods typically approximate depth estimation by introducing specific prior assumptions or by utilizing the geometric relationships of fixed structures within the scene. Meanwhile, some methods also depend on the fusion of information from multiple cameras, stereo vision, or other multi-view systems to obtain more accurate depth information. This further clarifies the transmittance of different regions within the image scene, ultimately leading to a comprehensive assessment of overall visibility information.
[0005] However, existing visibility estimation methods cannot meet the requirements under complex road conditions and variable weather conditions, mainly due to the following problems:
[0006] 1) Inaccurate depth estimation and incomplete application. Due to the complex structure and environment of the scene, monocular estimation methods based on prior knowledge and fixed facilities have significant errors. The depth estimation accuracy near the horizon or in distant areas decreases significantly, resulting in deviations in the overall spatial structure reconstruction. Multi-view estimation methods require the support of many complex devices and the fusion of multi-source information, which is costly and has poor scalability for complex scenes.
[0007] 2) The impact of depth information on transmittance estimation is not fully considered. Most existing visibility estimation methods only consider modeling the degree of light attenuation caused by transmission in the image to establish depth information. These methods have poor adaptability to different weather conditions and cannot dynamically respond to changes in aerosol concentration, scattering intensity, and other factors, resulting in transmittance estimations that deviate from reality. Furthermore, the utilization rate of depth information is insufficient, failing to provide a deeper level of scene modeling. Summary of the Invention
[0008] To address some problems with existing visibility estimation methods for highway scenes, this invention proposes a monocular camera visibility estimation method, which includes: first, classifying the original image using a support vector machine (SVM) classifier to distinguish whether the current highway scene is daytime or nighttime; then, segmenting the image and extracting atmospheric scattering parameters based on prior knowledge; next, extracting the depth map of the original image using a deep network model; and further, selecting the corresponding visibility estimation model for daytime and nighttime, and combining atmospheric light and transmittance to calculate the estimated visibility value.
[0009] Specifically, it includes:
[0010] The monocular camera visibility estimation method of the present invention utilizes a depth network model to extract the depth map of the original image as auxiliary information for scene structure. Different models are used for estimation based on the differences in daytime and nighttime visibility. During the day, the transmittance coefficient is selected as the basis for visibility estimation; at night, local grayscale is used as illuminance information to evaluate visibility. Depth information is applied as a weighted average of the two evaluation indicators across the entire image, achieving comprehensive utilization of the entire image information.
[0011] To achieve accurate estimation of scene depth information, the monocular camera visibility estimation method of this invention employs a deep network model. This model possesses global modeling capabilities, effectively capturing long-range dependencies and spatial hierarchical features in images, and achieving high-precision monocular depth prediction under various road scenes and weather conditions. By performing multi-scale encoding and contextual feature aggregation on the input image, combined with positional encoding and attention mechanisms, this model can extract more stable and structurally consistent depth information, providing a reliable geometric basis for subsequent structural supplementation of transmittance information.
[0012] According to one aspect of the present invention, a method for estimating visibility using a monocular camera is provided, characterized by comprising the following steps:
[0013] A) Divide day and night into day and night, including analyzing weather conditions using an SVM classifier and using weather conditions to determine the current day and night situation;
[0014] B) Extract scene feature maps, including determining the extraction method based on the current scene. For daytime scenes, atmospheric scattering parameters are estimated, including determining global atmospheric light by sorting each channel and obtaining transmittance by guided filtering and color ellipsoid prior. For nighttime scenes, local grayscale is estimated as an illuminance map.
[0015] C) Generate depth maps, including estimating depth maps based on deep network models and linearly normalizing the processing results;
[0016] D) Visibility estimation is performed. For daytime scenes, the overall visibility is calculated using the Koschmieder formula, combined with local transmission and depth maps. For nighttime scenes, the depth map and illuminance map are applied to a simplified illuminance model to calculate visibility, yielding the final visibility estimation result.
[0017] in:
[0018] Step B) includes:
[0019] B1) For daytime scenes, the RGB visible light image is divided into three channels. The grayscale values of each channel are sorted by brightness, and the top α% of grayscale values are selected as the atmospheric light value for each channel, where α is 0.1.
[0020] B2) By segmenting the image into blocks, the ellipsoidal color prior value is obtained using the ellipsoidal color prior, including:
[0021] x of each channel pixel i =[x r ,x g ,x b ] T Processing using atmospheric light values:
[0022]
[0023] Where A r A g A b These represent the atmospheric light values for the corresponding channels, x and x. r ,x g ,x b These represent the original pixel values,
[0024] Extract the prior values of ellipsoidal color for each local region as follows:
[0025]
[0026] Where Ω i Let x represent the ellipsoidal region formed by local pixels in the RGB space under prior knowledge. c This represents the vertical distance from the processed pixel to the corresponding coordinate plane.
[0027] B3) Further obtain the smoothed transmission map using prior knowledge, including:
[0028] The transmittance of each local region is further calculated as follows:
[0029] t i =1-βθ i ,
[0030] Where θ i Let represent the prior value of the ellipsoidal color for the i-th local block, and set β to 0.95.
[0031] The obtained transmission image is further subjected to guided filtering to obtain a smooth transmission image.
[0032] B4) For nighttime scenes, convert the RGB visible light image to a grayscale image and normalize it to obtain an illuminance map.
[0033] Step C) includes:
[0034] C1) Input the image into the trained deep network model and output the corresponding depth map.
[0035] C2) Perform linear normalization on the single-channel depth map, that is, linearly stretch all pixel values according to their minimum and maximum values, so that it maps to the standard image dynamic range of [0,1].
[0036] Step D) includes:
[0037] D1) For daytime scenes, local information is integrated using the Koschmieder formula, and global visibility is estimated in reverse, including:
[0038] Based on the obtained depth map and atmospheric scattering parameters, the transmission coefficient map is calculated as follows:
[0039]
[0040] Where d represents the depth map and t represents the smoothed transmission map.
[0041] Extreme values were removed from the obtained transmittance graph, and the average of the top γ% of transmittance results was calculated, with γ set to 95. Global visibility was then calculated.
[0042]
[0043] Where ε represents the minimum visible transmittance, which is taken as 0.02 according to the standard. This represents the average transmittance coefficient, where d0 is the original calibration maximum visible distance.
[0044] D2) For nighttime scenes, global visibility is estimated using depth and illuminance maps, calculated as follows:
[0045]
[0046] Where V represents the estimated illuminance map, d represents the estimated depth map, and k is the illuminance coefficient, set to 25. This indicates that the results are averaged.
[0047] According to another aspect of the present invention, a monocular camera visibility estimation device is provided. Attached Figure Description
[0048] Figure 1 This is a diagram of the deep network model structure used for depth estimation according to the present invention.
[0049] Figures 2(a) and 2(b) are visible light images and monocular depth estimation images of a daytime highway scene according to the present invention.
[0050] Figures 3(a) and 3(b) are visible light images and monocular depth estimation images of a nighttime highway scene according to the present invention.
[0051] Figures 4(a) to 4(f) This is a schematic diagram of visibility estimation results for different daytime and nighttime scenarios according to the present invention.
[0052] Figure 5 This is a schematic diagram of the construction of a rule-guided monocular camera visibility estimation device according to an embodiment of the present invention.
[0053] Figure 6 This is a flowchart of a monocular camera visibility estimation method according to an embodiment of the present invention. Detailed Implementation
[0054] Figure 6 The diagram shown is a flowchart of a monocular camera visibility estimation method according to an embodiment of the present invention. The method includes the following steps:
[0055] A) Determine whether the current scene is daytime or nighttime using an SVM classifier;
[0056] B) Extract scene feature maps, including determining the extraction method based on the current scene. For daytime scenes, atmospheric light and transmission maps are obtained based on the prior ellipsoid color, and for nighttime scenes, illuminance maps are extracted based on grayscale information.
[0057] C) Estimate the depth map based on the deep network model and then perform linear normalization on the processing results;
[0058] D) Perform visibility estimation, including calculating overall visibility by combining local transmission and depth maps for daytime scenes, and calculating visibility by combining depth maps and illuminance maps for nighttime scenes, to obtain the final visibility estimation result.
[0059] Step A) includes dividing the scene into daytime and nighttime modes.
[0060] This invention uses an SVM classifier to classify daytime and nighttime scenes. Due to differences in lighting conditions and imaging characteristics, daytime images typically have high brightness and rich color information, making them suitable for color prior and transmittance estimation methods; while nighttime images, limited by low illumination and other factors, exhibit significantly different image features, making them more suitable for illumination-based estimation methods. Therefore, different visibility estimation schemes need to be applied to different scenes.
[0061] SVM classifiers can be used for classification or regression tasks. By finding a hyperplane that maximizes the separation of different classes in the training data, they can determine which side of the hyperplane a new data point falls on, thus completing the classification. Therefore, an SVM classifier can be trained on existing day and night highway images to learn the differences between images in different scenes, thereby determining the scene of a new highway image.
[0062] Step B) includes scene feature map extraction.
[0063] For images identified as daytime scenes, the RGB visible light image is first split into three channels, and the grayscale image of each channel is extracted. For each channel, the grayscale values are sorted in ascending order, and the top α% of bright pixel grayscale values in the sorted results are selected as candidate regions, where α is set to 0.1. Within this region, pixels with greater depth are further filtered to avoid interference from local strong reflection areas. Finally, the atmospheric light values of the R, G, and B channels are determined, denoted as A. r A g A b .
[0064] The pixel vector x of the input image i =[x r ,x g ,x b ] T Normalize the atmospheric light values of the corresponding channels to obtain the normalized vectors:
[0065]
[0066] The normalized image is divided into local blocks. For each local region Ω i Based on the color ellipsoid prior, calculate the local prior value θ for this region. i The calculation method is as follows:
[0067]
[0068] Where x c This represents the value of a pixel in channel c after normalization, which is the vertical distance from the processed pixel to the plane corresponding to the RGB coordinate axes. This value reflects the degree to which the pixel color shifts towards atmospheric light, exhibiting color compression characteristics in foggy images.
[0069] Using the θ calculated above i Based on the prior relationships in the atmospheric scattering model, the transmittance of each local region is calculated:
[0070] t i =1-βθ i ,
[0071] Where β is an empirical parameter, set to 0.95. After obtaining the preliminary transmissivity map, guided filtering is used to smooth the transmissivity map while preserving its edges, thereby improving the spatial consistency and structural preservation of the transmissivity map and obtaining the final smooth transmissivity map.
[0072] For images identified as nighttime scenes, the RGB images are converted to grayscale images and normalized to obtain an illumination map in the range of 0 to 1.
[0073] Step C) includes depth map generation.
[0074] The RGB image size is adjusted to the input size of the training model and fed into a pre-trained depth estimation network. This model employs a hierarchical structure based on visual perception features, possesses cross-scale context modeling capabilities, and incorporates a global attention mechanism to enhance the understanding of long-distance structures in images. The network uses an encoder-decoder architecture to extract features and reconstruct spatial structures from images, enabling it to output single-channel depth maps with structural continuity and edge accuracy even in complex scenes. The model structure is as follows: Figure 1 As shown. The model parameters were trained end-to-end on multiple types of natural image datasets, exhibiting good generalization performance and applicable to depth prediction tasks under various weather, lighting, and road conditions. Figures 2(a) and 2(b) show the original image and depth map estimation results during the day, respectively, while Figures 3(a) and 3(b) show the original image and depth map estimation results at night, respectively.
[0075] The single-channel depth map output above is then linearly normalized. Specifically, all pixel values in the image are scaled according to the linear relationship between their minimum and maximum values, mapping the original depth values to the standard image dynamic range of [0,1]. The normalization calculation formula is as follows:
[0076]
[0077] Where maxd and mind represent the maximum and minimum values in the original depth map, respectively.
[0078] Step D) includes visibility estimation.
[0079] For images identified as daytime scenes, the transmission coefficient is calculated based on the Koschmieder atmospheric transport model, combining the depth map d obtained in step C and the smoothed transmission map t obtained in step B. The specific formula is as follows:
[0080]
[0081] Where σ represents the transmission coefficient composition map estimated from the image, d is the corresponding depth map, and t is the transmission map.
[0082] To improve the overall stability and resistance to abnormal interference, extreme values of the transmittance coefficient map σ were removed, retaining only the effective transmittance coefficient data of the first γ% of pixels. γ was set to 95, and this data was averaged to obtain the global average transmittance coefficient.
[0083] Based on the inverse form of the Koschmieder formula, the final daytime global visibility P can be calculated using the following formula:
[0084]
[0085] Where ε is the minimum visible transmittance, which is set to 0.02 according to the standard, and d0 is the maximum visible distance constant set during system calibration.
[0086] For images identified as nighttime scenes, considering that image illuminance features dominate image degradation characteristics, a joint estimation of nighttime visibility using illuminance and depth maps is introduced. Let the illuminance map be V and the depth map be d; the calculation formula is as follows:
[0087]
[0088] Where k is the empirical illuminance adjustment coefficient, set to 25. The product result is averaged over the image region and used to estimate the global visibility value in nighttime scenes. Figures 4(a), 4(c), and 4(e) show the visibility estimation results for three different daytime environments; Figures 4(b), 4(d), and 4(f) show the visibility estimation results for three different nighttime scenes.
[0089] According to a further aspect of the invention, such as Figure 5 As shown, a rule-guided monocular camera visibility estimation device is provided, which includes the following parts:
[0090] The hardware module includes: acquiring video data through external acquisition devices such as cameras, and storing and processing the data through memory and processor; the corresponding software modules are: sensing module, processing module, and feedback module.
Claims
1. A monocular camera visibility estimation method, characterized by The method comprises the following steps: A) performing day-night division, comprising analyzing the weather condition by an SVM classifier, and determining the current day-night condition by using the weather condition; B) extracting a scene feature map; C) generating a depth map, comprising estimating the depth map based on a depth network model, and performing linear normalization on the processing result; D) performing visibility estimation, comprising: for a daytime scene, calculating the overall visibility by Koschmieder formula in combination with local transmission and the depth map, for a nighttime scene, applying the depth map and the illumination map to a simple illumination model to calculate the visibility, and obtaining a final visibility estimation result, wherein: the step B) comprises: B1) for a daytime scene, dividing the RGB visible light image into three channels, performing brightness sorting on the gray scale of each channel, and selecting the top a% of the gray scale values as the atmospheric light value of each channel, B2) obtaining ellipsoidal color prior values by block processing of the image, comprising: Channel pixels x i = [x r ,x g ,x b ] T Process with atmospheric light values: where A r , A g , A b , A r , A g , A b represent the original pixel values, respectively, extracting the ellipsoidal color prior values of each local block in the following manner: where Ω i represents the ellipsoid region formed by local pixels in RGB space under prior knowledge, x c represents the vertical distance from the corresponding processed pixel point to the corresponding coordinate plane, B3) further obtaining a smooth transmission map by prior knowledge, comprising: further obtaining the transmittance of each local region in the following manner: t i = 1 - βθ i , where θ i represents the ellipsoidal color prior value of the ith local block, and β is a coefficient. further performing guided filtering on the obtained transmission map to obtain a smooth transmission map, B4) for a nighttime scene, converting the RGB visible light image into a gray scale image and performing normalization to obtain an illumination map, the step C) comprises: C1) inputting the image into a trained depth network model to output a corresponding depth map, C2) performing linear normalization on the single-channel depth map, that is, linearly stretching all pixel values according to their minimum and maximum values to map them to the standard image dynamic range of [0, 1], the step D) comprises: D1) for a daytime scene, integrating local information by Koschmieder formula and inversely estimating the global visibility, comprising: calculating the transmission coefficient map according to the obtained depth map and atmospheric scattering parameters, and the calculation method is: wherein d represents the depth map, and t represents the smooth transmission map, where ε represents the minimum visible transmittance, where <τ> represents the average transmittance and d0is the original calibrated farthest visible distance, performing extreme value exclusion on the obtained transmission coefficient map, taking the top γ% of the transmission coefficient results, averaging them, and calculating the global visibility: where V denotes the estimated illumination map, d denotes the estimated depth map, k is the illumination coefficient, set to 25, denotes averaging the results.
2. The monocular camera visibility estimation method of claim 1, wherein D2) for a nighttime scene, estimating the global visibility by using the depth map and the illumination map, and the calculation method is:
3. The monocular camera visibility estimation method of claim 1, wherein α is set to 0.
1.
4. The monocular camera visibility estimation method of claim 1, wherein β is set to 0.
95.
5. The monocular camera visibility estimation method of claim 1, wherein γ is set to 95.
6. The monocular camera visibility estimation method of claim 1, wherein ε is set to 0.
02. k is set to 25.
8. A monocular camera visibility estimation apparatus characterized by 7. A computer readable storage medium storing a computer executable program, which can enable a processor to perform the rule-guided monocular camera visibility estimation method according to any one of claims 1-6. comprising: PA) a part of performing day-night division, for analyzing the weather condition by an SVM classifier, and determining the current day-night condition by using the weather condition; PB) a part of extracting a scene feature map; PC) a part of generating a depth map, for estimating the depth map based on a depth network model, and performing linear normalization on the processing result; PD) a part of performing visibility estimation, for performing the following operations: For daytime scene, the overall visibility is calculated by Koschmieder formula, combined with local transmission and depth map, For nighttime scene, the depth map and illumination map are applied to the simple illumination model to calculate the visibility, and the final visibility estimation result is obtained, Wherein: The part PB) comprises a part for performing the following operations: B1) For daytime scene, the RGB visible light image is divided into three channels, the gray scale of each channel is sorted by brightness, and the top a% of gray scale values are selected as the atmospheric light value of each channel, B2) The ellipsoidal color prior value is obtained by using ellipsoidal color prior on the image block processing, including: The channel pixels x i = [x r , x g , x b ] T are processed using the atmospheric light value: where A r ,A g ,A b represent the atmospheric light values of the corresponding channels, respectively, x r ,x g ,x b represent the original pixel values, respectively, The ellipsoidal color prior value of each local block is extracted in the following way: where Ω i represents the ellipsoid region formed by local pixels in RGB space under prior knowledge, x c represents the vertical distance from the corresponding processed pixel point to the corresponding coordinate plane, B3) The smooth transmission map is further obtained by prior knowledge, including: The transmission rate of each local area is further calculated in the following way: t i = 1 - βθ i , where θ i represents the ellipsoidal color prior value of the ith local block, and β is a coefficient. The obtained transmission map is further guided filtering to obtain a smooth transmission map, B4) For nighttime scene, the RGB visible light image is converted into a gray scale image and normalized to obtain an illumination map, Part PC) comprises a part for performing the following operations: C1) The image is input into the trained depth network model, and the corresponding depth map is output, C2) The single-channel depth map is linearly normalized, that is, all pixel values are linearly stretched according to their minimum and maximum values, so as to map them to the standard image dynamic range of [0, 1], and the part PD) comprises a part for performing the following operations: D1) For daytime scene, the local information is integrated by Koschmieder formula, and the global visibility is inversely estimated, including: According to the obtained depth map and atmospheric scattering parameters, the transmission coefficient map is calculated, and the calculation method is: Wherein d represents the depth map, and t represents the smooth transmission map, The obtained transmission coefficient map is subjected to extreme value exclusion, the top g% of transmission coefficient results are taken to calculate the global visibility: where ε represents the minimum visible transmittance, where <τ> represents the average transmittance and d0is the original calibrated farthest visible distance, D2) For nighttime scene, the global visibility is estimated by using the depth map and the illumination map, and the calculation method is: where V denotes the estimated illumination map, d denotes the estimated depth map, k is the illumination coefficient, set to 25, denotes the averaging of the results.
9. The monocular camera visibility estimation apparatus of claim 8, wherein: Alpha is set to 0.1, Beta is set to 0.95, Gamma is set to 95, Epsilon is set to 0.02, K is set to 25.