Image fog detection method and system based on multi-module statistical feature fusion

This image fog detection method, which integrates multi-module statistical features, utilizes a pre-trained model to calculate fog confidence scores and dynamically adjusts driving strategies. This addresses the issue of image quality degradation in foggy weather and enhances the safety and robustness of intelligent driving systems.

CN121191121BActive Publication Date: 2026-07-24SHENZHEN SFIRM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN SFIRM TECH CO LTD
Filing Date
2025-09-28
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In intelligent driving and assisted driving systems, low visibility weather such as fog and haze leads to a decline in image quality, affecting target recognition and driving safety.

Method used

The image fog detection method based on multi-module statistical feature fusion uses a pre-set camera device to collect image data, construct a data matrix, extract feature parameters, input them into a pre-trained model to calculate fog confidence scores, and dynamically adjust driving strategies to cope with fog.

Benefits of technology

It enables rapid detection and identification of fog, reduces the risk of perception distortion, improves driving safety and system robustness, and reduces traffic safety hazards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121191121B_ABST
    Figure CN121191121B_ABST
Patent Text Reader

Abstract

The application provides an image fog detection method and system based on multi-module statistical feature fusion, and is applied to the field of visual image processing; in the process of vehicle driving, image data is collected in real time by using a preset camera, statistical characteristic parameters (range, variance and high-frequency mean) are combined with a pre-trained prediction model to calculate a fog confidence score, the existence of fog in the image is quickly detected, compared with a traditional method which depends on a single threshold value or image enhancement post-processing, fog characteristics can be identified in time in the image collection link, the problem of perception distortion caused by image quality degradation is avoided, visibility band data is constructed and is linked with a preset driving strategy of the vehicle, active safety measures such as speed adjustment, vehicle distance control and emergency braking can be realized, and thus the driving safety in a low-visibility scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visual image processing, and in particular to a method and system for detecting fog in images based on multi-module statistical feature fusion. Background Technology

[0002] In intelligent driving and assisted driving systems, onboard cameras are crucial sensors for environmental perception. However, in actual driving, vehicles frequently encounter low-visibility weather conditions such as fog and haze. Such weather reduces overall image contrast, blurs the boundaries between distant targets and backgrounds, and can even cause large areas of gray-white obscuration, making it difficult for cameras to clearly reflect road conditions. This visual degradation not only affects the accuracy of subsequent image enhancement and target recognition modules but also poses potential risks to the driver's real-time decision-making and the vehicle's automatic control. Summary of the Invention

[0003] This invention aims to solve the problem of how to quickly detect the presence of fog in the images built into a vehicle, avoid vehicle perception distortion, and reduce traffic safety hazards. It provides an image fog detection method and system based on multi-module statistical feature fusion.

[0004] The present invention employs the following technical means to solve the technical problem:

[0005] This invention provides a method for detecting image fog based on multi-module statistical feature fusion, comprising:

[0006] Based on the camera device pre-installed on the vehicle, image data of the vehicle during its driving process is collected;

[0007] Determine whether fog is detected in the image data;

[0008] If so, construct the numerical matrix corresponding to the image data, extract the feature parameters of the image data from the data matrix, input the feature parameters into the pre-trained prediction model, and calculate the fog confidence score of the data matrix. The feature parameters specifically include the range, variance, and high-frequency mean.

[0009] Determine whether the fog confidence score is higher than a preset confidence threshold;

[0010] If the visibility is higher, the visibility band data of the vehicle is constructed in real time. Based on the visibility band data, the vehicle's preset driving strategy is dynamically activated. The visibility detection standard of the vehicle preset by the prediction model is identified. Based on the visibility detection standard, the confidence threshold of the fog confidence score is adaptively reduced. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

[0011] Furthermore, the step of constructing a numerical matrix corresponding to the image data and extracting feature parameters of the image data from the data matrix further includes:

[0012] Based on the preset module types of the vehicle, data matrices of different dimensions are generated. Specifically, the module types include a contrast module, a color feature module, and an edge sharpness module. The data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix.

[0013] Determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis, and skewness;

[0014] If not, then identify all values ​​of the matrix in the data matrix, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module, wherein the backup module specifically includes dark channel and edge gradient.

[0015] Furthermore, before the step of inputting the feature parameters into the pre-trained prediction model and calculating the fog confidence score of the data matrix, the method further includes:

[0016] Based on the vehicle's preset driving time window, continuous video frames of the driving time window are collected, and corresponding current frames and neighboring frames are constructed from the continuous video frames. The current frames and neighboring frames are combined to obtain the frame sequence to be analyzed.

[0017] Determine whether a sequence of missing data is detected in the frame sequence to be analyzed;

[0018] If not, the frame sequence to be analyzed is spliced ​​together in chronological order according to the driving time window to obtain the corresponding extended feature vector. Through the extended feature vector, the cross-time dynamic evolution information of the frame sequence to be analyzed is generated. The extended feature vector specifically includes instantaneous features, statistical features and dynamic features.

[0019] Furthermore, the step of constructing the vehicle's visibility band data in real time and dynamically activating the vehicle's preset driving strategy based on the visibility band data also includes:

[0020] Based on the preset unit value of the visibility band data, the visibility band data is divided into levels to generate corresponding visibility band levels. Specifically, the visibility band levels include high visibility band, medium visibility band, low visibility band and very low visibility band.

[0021] Determine whether continuous temporal fluctuations are detected in the visibility band level;

[0022] If so, the continuous time fluctuations are stored in a preset cache queue. A preset number of visibility values ​​are selected from the cache queue. The differences between adjacent frames of the visibility values ​​are detected. Based on the differences between adjacent frames, the visibility values ​​are classified as outliers. The outliers are filtered and corrected to dynamically correct the band results of the visibility band data.

[0023] Furthermore, the step of determining whether fog is detected in the image data also includes:

[0024] Based on the image grayscale histogram of the image data, the distribution characteristics of pixel values ​​are identified from the image grayscale histogram;

[0025] Determine whether the distribution characteristics are concentrated and whether the dynamic range is narrowing;

[0026] If so, edge detection is performed on the image grayscale histogram, the number of edges of the pixel value is calculated, the dynamic changes of the pixel value are identified, and the image grayscale histogram is divided into a preset number of sub-block regions according to the dynamic changes. The contrast of each sub-block region is collected, and the statistical results of the contrast decrease are generated.

[0027] Furthermore, the step of determining whether the fog confidence score is higher than a preset confidence threshold also includes:

[0028] Based on the fog-free image dataset pre-collected by the prediction model, the target application scenarios of the fog confidence score are identified, wherein the fog-free image dataset specifically includes highways, urban roads, rural roads, parking lots, and tunnel entrances;

[0029] Determine whether the target application scenario matches the preset lighting conditions, wherein the lighting conditions specifically include sunny days, cloudy days, and nighttime;

[0030] If so, the threshold crossing frequency of the fog confidence score is collected, and the trend parameter of the fog confidence score is identified based on the threshold crossing frequency. Based on the trend parameter, the confidence detection result of the fog confidence score is output with a delay.

[0031] Furthermore, the step of acquiring image data of the vehicle during its driving process based on a pre-installed camera device on the vehicle also includes:

[0032] Based on the vehicle's preset installation position for the camera device, the image data is collected synchronously, wherein the installation position specifically includes front view, rear view, side view, and surround view.

[0033] Determine whether the image data is aligned;

[0034] If not, the frame difference information of the image data is identified by the timestamp, and the image acquisition parameters of the camera device are dynamically adjusted according to the frame difference information. The image acquisition parameters specifically include frame rate, resolution, exposure time and gain.

[0035] This invention also provides an image fog detection system based on multi-module statistical feature fusion, comprising:

[0036] The acquisition unit is used to acquire image data of the vehicle during its driving process based on a camera device pre-installed on the vehicle.

[0037] The judgment unit is used to determine whether fog is detected in the image data;

[0038] An execution unit is configured to, if so, construct a numerical matrix corresponding to the image data, extract feature parameters of the image data from the data matrix, input the feature parameters into a pre-trained prediction model, and calculate the fog confidence score of the data matrix, wherein the feature parameters specifically include range, variance, and high-frequency mean.

[0039] The second judgment unit is used to determine whether the fog confidence score is higher than a preset confidence threshold;

[0040] The second execution unit is used to construct the visibility band data of the vehicle in real time if the visibility is higher than the threshold, dynamically activate the vehicle's preset driving strategy based on the visibility band data, identify the prediction model's preset visibility detection standard for the vehicle, and adaptively reduce the confidence threshold of the fog confidence score based on the visibility detection standard. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

[0041] Furthermore, the execution unit also includes:

[0042] A generation subunit is used to generate data matrices of different dimensions based on the preset module types of the vehicle. Specifically, the module types include a contrast module, a color feature module, and an edge sharpness module, and the data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix.

[0043] The judgment subunit is used to determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis and skewness;

[0044] An execution subunit is used to identify all values ​​of the matrix in the data matrix if no, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module. The backup module specifically includes dark channel and edge gradient.

[0045] Furthermore, it also includes:

[0046] The combination unit is used to acquire continuous video frames of the driving time window based on the vehicle's preset driving time window, construct corresponding current frames and neighboring frames from the continuous video frames, and combine the current frames and neighboring frames to obtain a sequence of frames to be analyzed.

[0047] The third judgment unit is used to determine whether the frame sequence to be analyzed has detected sequence missingness;

[0048] The third execution unit is used to, if not, concatenate the frame sequence to be analyzed in chronological order according to the driving time window to obtain the corresponding extended feature vector, and generate cross-time dynamic evolution information of the frame sequence to be analyzed through the extended feature vector, wherein the extended feature vector specifically includes instantaneous features, statistical features and dynamic features.

[0049] This invention provides a method and system for detecting image fog based on multi-module statistical feature fusion, which has the following beneficial effects:

[0050] This invention achieves rapid detection of fog presence in images by using a pre-set camera device to collect image data in real time during vehicle operation. It combines statistical feature parameters (range, variance, and high-frequency mean) with a pre-trained prediction model to calculate a fog confidence score. Compared to traditional methods relying on a single threshold or image enhancement post-processing, this solution can identify fog features promptly during image acquisition, avoiding perceptual distortion caused by image quality degradation. By constructing visibility band data and linking it with the vehicle's pre-set driving strategy, active safety measures such as speed adjustment, distance control, and emergency braking can be implemented, thereby improving driving safety in low-visibility scenarios. Furthermore, this invention introduces an adaptive threshold adjustment mechanism, enabling fog detection results to adapt to different environments and driving standards, improving system robustness and real-time performance, and effectively reducing traffic safety hazards. Attached Figure Description

[0051] Figure 1 This is a flowchart illustrating an embodiment of the image fog detection method based on multi-module statistical feature fusion according to the present invention;

[0052] Figure 2This is a structural block diagram of an embodiment of the image fog detection system based on multi-module statistical feature fusion of the present invention. Detailed Implementation

[0053] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The realization of the purpose, functional features, and advantages of the invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings.

[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] Reference Appendix Figure 1 The present invention provides an image fog detection method based on multi-module statistical feature fusion, comprising:

[0056] S1: Based on the camera device pre-installed on the vehicle, collect image data of the vehicle during its driving process;

[0057] S2: Determine whether fog is detected in the image data;

[0058] S3: If so, construct the numerical matrix corresponding to the image data, extract the feature parameters of the image data from the data matrix, input the feature parameters into the pre-trained prediction model, and calculate the fog confidence score of the data matrix. The feature parameters specifically include the range, variance, and high-frequency mean.

[0059] S4: Determine whether the fog confidence score is higher than a preset confidence threshold;

[0060] S5: If the visibility is higher, then the visibility band data of the vehicle is constructed in real time. Based on the visibility band data, the vehicle's preset driving strategy is dynamically activated. The prediction model's preset visibility detection standard for the vehicle is identified. Based on the visibility detection standard, the confidence threshold of the fog confidence score is adaptively reduced. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

[0061] In this embodiment, the system uses a camera device pre-installed on the vehicle to collect image data during the vehicle's operation. The system then determines whether fog is detected in these image data to execute corresponding steps. For example, if the system determines that no fog is detected in the image data during the vehicle's operation, it considers the current driving environment to be within the normal visibility range, with no significant degradation in image clarity and contrast. The system will maintain the vehicle's current speed, distance, and autonomous driving function without imposing additional restrictions, while simultaneously marking the current environment as "fog-free" and storing the corresponding image and feature parameters for subsequent model validation. Alternatively, it can learn on its own and, under confirmed fog-free conditions, update or correct fog-free reference values ​​(such as contrast benchmarks and feature means) in the system to improve the accuracy of subsequent fog detection. For example, when the system determines that fog is detected in the image data of a vehicle in motion, it considers the current driving environment to be in an abnormal visibility range, possibly due to fog obstructing the view. The system will construct a data matrix corresponding to the image data, extract feature parameters from this data matrix, specifically including range, variance, and high-frequency mean, and input these feature parameters into a pre-trained prediction model to calculate the fog confidence score of the data matrix. The system constructs a data matrix corresponding to image data and extracts multi-dimensional statistical feature parameters (range, variance, and high-frequency mean). This allows for comprehensive capture of visual degradation phenomena caused by fog, such as reduced contrast, blurred texture, and loss of high-frequency details. Compared to methods relying on a single image metric, this approach significantly reduces the misjudgment rate due to environmental complexity, achieving higher accuracy in determining the presence or absence of fog. Furthermore, after the feature parameters are input into a pre-trained prediction model, the learned multi-scene, diverse data distribution patterns effectively fuse the correlation information between different features, avoiding instability caused by interference with a single feature. The mechanism enables the system to maintain stable performance in sunny, cloudy, and nighttime conditions, as well as various road scenarios, thereby improving the robustness and generalization ability of fog detection. Furthermore, by calculating the fog confidence score, it can achieve a dynamic quantitative assessment of the fog level, rather than just a binary "fog present / no fog" judgment. This quantitative result can provide reliable input for subsequent visibility assessment and vehicle driving strategies (such as deceleration, increasing following distance, or activating assisted braking), thereby effectively reducing perception distortion and traffic safety hazards caused by fog obstruction. The system then determines whether the fog confidence score is higher than a pre-set confidence threshold to execute the corresponding steps.For example, when the system determines that the fog confidence score is not higher than a pre-set confidence threshold, the system considers the fog features in the current image data to be insignificant, the driving environment of the vehicle is still within the normal visibility range, and the fog level is insufficient to have a substantial impact on driving safety. The system will not trigger defogging processing or additional safety intervention, and the vehicle will maintain normal speed, following distance, and path planning. At the same time, this state is marked as a "low fog / no fog" scenario, and the corresponding image and feature parameters are stored to enrich the training dataset and provide sample support for subsequent model optimization. Furthermore, if the determination results are consistently lower than the threshold multiple times, the system can update the no-fog baseline feature value to adapt to the scene characteristics under different lighting and weather conditions, thereby improving the accuracy of subsequent detection. Conversely, when the system determines that the fog confidence score is higher than a pre-set confidence threshold, the system considers the fog features in the current image data to be significant, and the driving environment of the vehicle is affected by fog. The system will construct the vehicle's visibility band data in real time and dynamically activate the vehicle's pre-set visibility band data based on different visibility band data. The system employs a pre-defined driving strategy, specifically including automatic speed reduction, increased following distance, and emergency braking. It identifies and predicts a pre-set visibility detection standard for the vehicle, adaptively lowering the confidence threshold for the fog confidence score based on this standard. The system quantifies environmental visibility by constructing real-time visibility band data, thus avoiding safety hazards caused by delayed detection or misjudgment and ensuring timely vehicle response. Simultaneously, based on the visibility band, the system dynamically activates the vehicle's pre-set driving strategies, such as automatic speed reduction, increased following distance, and emergency braking. This mechanism allows the vehicle to proactively adjust its operating state to adapt to the reduced visibility risks brought about by severe weather, significantly reducing the probability of rear-end collisions and other traffic accidents. Furthermore, by combining the visibility detection standard of the predictive model, the system can dynamically adjust the confidence threshold, maintaining flexibility and accuracy under different road, lighting, and weather conditions. Adaptive threshold lowering avoids false positives or false negatives caused by fixed thresholds, improving the system's robustness and stability in changing environments.

[0062] It should be noted that the range reflects the overall contrast level of the image, the variance reflects the dispersion of pixel distribution, and the high-frequency mean reflects the richness of detail information such as image edges and textures. When fog is detected in an image, the system triggers and calls the image defogging enhancement module. This module specifically performs physical defogging, including but not limited to camera ventilation and camera heating. The system will then enable real-time defogging processing for subsequent images and output a clear, processed image. When fog is detected, the system can dynamically switch or adjust the target detection model's strategy, for example, switching from a general high-precision model to a lightweight model optimized for severe weather and more sensitive to blurred targets, or adjusting the detection model's confidence threshold to reduce the false negative rate. When fog is detected, the system will generate a safety warning signal indicating reduced environmental visibility. This signal can be used for:

[0063] 1. In an autonomous driving system, prompt the system to implement a degraded strategy, such as suggesting that the driver take over, automatically reducing the vehicle speed, increasing the following distance, or activating the emergency braking system;

[0064] 2. In the intelligent traffic monitoring system, trigger the "severe weather" warning sign or send an abnormal road condition alarm to the traffic management center;

[0065] For vehicle systems equipped with multiple sensors (such as lidar and millimeter-wave radar), the visual fog detection results can be used to weight or calibrate other sensors. For example, in foggy conditions, the confidence weight of the radar can be increased and the weight of the optical camera can be reduced, thereby fusing the perception results at the optimal level.

[0066] Regarding the phrase "constructing a numerical matrix corresponding to the image data, extracting feature parameters of the image data from the data matrix, inputting the feature parameters into a pre-trained prediction model, and calculating the fog confidence score of the data matrix, wherein the feature parameters specifically include range, variance, and high-frequency mean," a specific example is as follows:

[0067] The following steps, with specific numerical examples, detail the complete process of "constructing a numerical matrix → extracting three types of features (range R, variance Var, high-frequency mean M_HF) → inputting into the pre-trained model → calculating the fog confidence score"; for ease of explanation, two 5×5 grayscale images are used as comparison examples: a "clear" image and a "fog / low contrast" image, to demonstrate each step of the numerical calculation from matrix to final confidence score;

[0068] Example input (5×5 grayscale matrix, pixel range 0–255)

[0069] Clear image (I_clear):

[0070] [[12,15,18,20,10],

[0071] [30,60,80,90,40],

[0072] [50,100,150,120,60],

[0073] [70,110,140,130,80],

[0074] [20,40,60,50,25]]

[0075] Foggy image (I_fog, same scene but with contrast compression):

[0076] [[60,62,64,63,61],

[0077] [65,68,70,69,66],

[0078] [67,70,72,71,68],

[0079] [66,69,71,70,67],

[0080] [64,66,68,67,65]]

[0081] (Note: The example matrix is ​​for illustrative purposes only. In actual systems, the entire high-resolution image is processed in the same way or downsampled before calculation.)

[0082] Step 1, construct the numerical matrix (preprocessing), and convert the color image to grayscale (if the source is color): the commonly used formula Y=0.299R+0.587G+0.114B, here we directly use the grayscale matrix given above, and normalize it to [0,255] or [0,1] to ensure the stability of subsequent values, and denote the resulting grayscale pixel matrix as I;

[0083] Step 2, calculate the range R (range).

[0084] Definition: R = max(I) - min(I),

[0085] For I_clear:

[0086] max=150, min=10

[0087] =150-10=140,

[0088] For I_fog:

[0089] max=72, min=60

[0090] =72-60=12,

[0091] Since the range usually decreases significantly in foggy weather, it visually reflects a decrease in contrast.

[0092] Step 3, calculate the mean and variance Var.

[0093] Use the overall variance (dividing the entire set of pixels by N):

[0094] Suppose the image has N = 25 pixels.

[0095] mean ,

[0096] variance ,

[0097] Clear image:

[0098] Pixels and: =1580,

[0099] Mean: =1580 / 25=63.2,

[0100] Sum of squared differences (i.e. The result is 43562.0.

[0101] variance: =43562.0 / 25=1742.48,

[0102] (Example of the calculation method using two differences of squares:)

[0103] For pixel 150: the deviation is 150 - 63.2 = 86.8, squared is 86.8² = 7534.24.

[0104] For pixel 10: the deviation is 10 - 63.2 = -53.2, squared to 53.22 = 2830.24. The same logic applies to the other pixels. Adding them all together gives 43562, then dividing by 25 gives the variance of 1742.48.

[0105] Foggy image:

[0106] Pixels and: =1669.0,

[0107] Mean: =1669.0 / 25=66.76,

[0108] Sum of squared differences: 248.56

[0109] variance: =248.56 / 25=9.9424,

[0110] This shows that the pixels in the fog image are concentrated and the variance is significantly reduced at this time;

[0111] Step 4, Calculate the high-frequency mean. (Taking the Sobel gradient mean as an example), high-frequency components can be measured using the average gradient magnitude (edge / texture information):

[0112] Using Sobel horizontal kernel Gx and vertical kernel Gy:

[0113] ,

[0114] ,

[0115] Convolution is performed on each pixel to obtain Gx(i,j) and G_y(i,j), with gradient magnitudes as follows:

[0116] ,

[0117] The high-frequency mean is defined as the arithmetic mean of the gradient magnitudes of all pixels:

[0118] ,

[0119] Example (calculating the 3×3 neighborhood of the center pixel to illustrate single-point calculation), center point neighborhood (clear image):

[0120] [30,60,80

[0121] 50, 100, 150

[0122] 70,110,140]

[0123] Calculate Gx (element-by-element multiplication and addition):

[0124] -1×30+0×60+1×80+-2×50+0×100+2×150+-1×70+0×110+1×140=320,

[0125] Calculate Gy:

[0126] -1×30+-2×60+-1×80+0+0+0+1×70+2×110+1×140=200,

[0127] gradient magnitude

[0128] Overall mean (example result):

[0129] Clear image (That is, the sum of the gradient magnitudes of the entire image is approximately 9001.97, which, when divided by 25, yields an average of 360.0787).

[0130] Fog map (The total value is approximately 4645.31, and the average value is approximately 185.8124).

[0131] This shows that the high-frequency energy of a clear image is significantly higher than that of a foggy image;

[0132] Step 5: Forming feature vectors and normalizing (or standardizing). The system needs to normalize the three features before feeding them into the model. Two common approaches can be used:

[0133] A. Normalize the ratio to the haze-free baseline (as used in the example), and take the haze-free reference value (which can be derived from the mean of Dataset_clear):

[0134] = =140, =1742.48, = =360.0787,

[0135] Calculate the normalized ratio:

[0136] ,

[0137] For foggy maps: =12 / 140=0.0857142857,

[0138] ,

[0139] For foggy maps: =9.9424 / 1742.48≈0.0057058905,

[0140] ,

[0141] For foggy maps: =185.8124 / 360.0787≈0.5160327281,

[0142] B. (Optional) Perform further transformations to facilitate model learning. One common transformation is to use the "attenuation amount". Because fog is manifested as these three ratios being significantly less than 1, taking 1 minus the ratio will result in a larger value for fog, which is more conducive to linear model representation;

[0143] f obtained from the foggy map:

[0144] f1=1- =1-0.0857142857=0.9142857143,

[0145] f2=1- =1-0.0057058905=0.9942941095,

[0146] f3=1- =1-0.5160327281=0.4839672719,

[0147] For a clear image, these normalized values ​​are approximately equal to 1, therefore f is close to 0. ≈[0,0,0];

[0148] Step 6: Input the pre-trained prediction model and calculate the fog confidence score (the example uses Logistic regression). To illustrate the calculation process, a simple and interpretable logistic regression model (often used as an example for probability output) is used here:

[0149] Model format:

[0150] ,

[0151] ,

[0152] Example of weight and bias (the example values ​​have been set reasonably for demonstration purposes).

[0153] w=[1.0, 1.0, 0.8], bias b=-1.2,

[0154] For foggy maps:

[0155] f = [0.9142857143, 0.9942941095, 0.4839672719] (already calculated previously);

[0156] First, calculate the linear part (dot product).

[0157] =1.0 × 0.9142857143 = 0.9142857143,

[0158] =1.0 × 0.9942941095 = 0.9942941095,

[0159] =0.8 × 0.4839672719 = 0.3871738175,

[0160] Summation plus bias:

[0161] logit=0.9142857143+0.9942941095+0.3871738175-1.2=1.0957536413,

[0162] Calculate the sigmoid (fog confidence score):

[0163] (Use a calculator / library to calculate the value).

[0164]

[0165] For a clear image: (f≈[0,0,0])

[0166] logit=1.0×0+1.0×0+0.8×0-1.2=-1.2\text{logit}=1.0*0+1.0*0+0.8*0-1.2=-1.2,

[0167] fog_confidence=σ(-1.2)≈0.23148;

[0168] In summary, the conclusion is (based on the examples) that the foggy image examples have a calculated fog_confidence of approximately 0.75, which is significantly higher than that of clear images (approximately 0.23). If the system threshold is set to 0.5, the foggy image will be judged as "fog exists", which will trigger subsequent visibility estimation and driving strategies.

[0169] It should be added that the visibility band data of the vehicle is constructed in real time, and the vehicle's preset driving strategy is dynamically activated based on the visibility band data. The prediction model's preset visibility detection standard for the vehicle is identified, and the confidence threshold of the fog confidence score is adaptively reduced according to the visibility detection standard. Specifically:

[0170] First, the fog confidence score (fog_conf, range 0–1) output by the model is received. fog_conf is mapped to an instantaneous visibility estimate, Vis_est (meters), and the visibility estimates for the most recent few moments are cached. The cached visibility is smoothed (using a moving average / weighted average or Kalman filter) to obtain the smoothed visibility, Vis_smooth. Vis_smooth is then mapped to a predefined visibility band (e.g., high / medium / low / extremely low). Based on the current band, the corresponding driving strategy is retrieved from the policy library and prepared for activation (deceleration, acceleration, etc.). (Large following distance, emergency braking, etc.) Read or identify the visibility detection standard of the prediction model for the vehicle (i.e., the minimum safe visibility Vis_required under the vehicle / scenario). If Vis_smooth does not meet the standard, the fog confidence threshold T_conf is adaptively reduced (to make the system more sensitive), and the updated threshold is compared with fog_conf to determine whether to activate the strategy. A steady-state mechanism (threshold upper and lower bounds, persistence determination, jitter suppression) is added to avoid frequent switching or false triggering. Each step will be detailed and illustrated below. Specific examples are as follows:

[0171] Step A—Mapping: From fog_conf to instantaneous visibility Vis_est

[0172] Principle and Calibration: During deployment, a dataset (Dataset_fog) with actual visibility labels is used to perform regression (e.g., linear or exponential regression) on fog_conf and the measured visibility Vis_label to obtain the linear form of the mapping function. The linear form is simple and intuitive.

[0173] Vis_est = a + b * (1 - fog_conf),

[0174] The coefficients a and b are obtained by regression fitting (based on a large number of calibrated samples).

[0175] Example (coefficients obtained from regression): Regression yields a = 20 (m) and b = 980 (m). Therefore, when fog_conf = 0.75,

[0176] Vis_est=20+980×(1-0.75)=20+980×0.25=20+245=265m,

[0177] Note: Regression coefficients should be determined by measured data; the values ​​here are examples and have engineering interpretability (fog_conf≈0→Vis_est≈1000m in fog-free conditions, and fog_conf≈1→Vis_est≈20m in complete fog).

[0178] Step B—Smoothing: Obtain Vis_smooth. The purpose is to eliminate single-frame jitter and avoid frequent strategy switching. The method chosen is sliding weighted average.

[0179] Implementation (weighted moving average example): Retain the Vis_est of the most recent N=5 frames, with weights increasing over time (the latest weight is greater):

[0180] The weight vector w = [0.10, 0.15, 0.20, 0.25, 0.30], and =1,

[0181] For example: the most recent 5 frames Vis_est=[300,280,270,260,265] (in meters, ordered from oldest to newest), then

[0182] Vis_smooth=0.10×300+0.15×280+0.20×270+0.25×260+0.30×265

[0183] Vis_smooth=30+42+54+65+79.5=270.5m

[0184] The result is Vis_smooth≈270.5 m;

[0185] Step C—Band Division: Map Vis_smooth to the visibility band.

[0186] Example threshold (configurable):

[0187] High visibility: Vis_smooth > 500 m

[0188] Medium visibility: 200 m <Vis_smooth≤500 m,

[0189] Low visibility: 50 m <Vis_smooth≤200 m,

[0190] Extremely low visibility: Vis_smooth≤50 m,

[0191] For example: Vis_smooth=270.5 m → belongs to the medium visibility band (200–500 m);

[0192] Step D—Strategy Matching and Activation Preparation

[0193] Strategy library example (tiered):

[0194] High visibility: Standard strategy (unchanged).

[0195] Medium visibility: speed reduction strategy (percentage reduction depending on severity), slightly increase following distance (multiply by 1.1–1.3).

[0196] Low visibility: Significantly reduce speed (e.g., 20%–40%), increase following distance (multiply by 1.5), and restrict automatic overtaking.

[0197] Extremely low visibility: Switch to the most conservative strategy (forced deceleration, suggested or automatic docking with a prompt for manual takeover) and allow automatic emergency braking intervention.

[0198] The above are examples; the specific values ​​are set according to the dynamics, regulations, and test results of different vehicles.

[0199] Step E—Read / identify the visibility detection criteria (Vis_required) for vehicles from the prediction model.

[0200] Explanation: Each vehicle or driving mode may have different minimum safe visibility standards (e.g., higher requirements for high-speed cruising). These standards may be defined by vehicle configuration, class, or operating strategy, or by a "recommended minimum visibility" Vis_required output by the predictive model (learned by the model or preset by the system).

[0201] Example:

[0202] The scenario is highway cruising: Vis_required = 300 m (the system determines that it is considered safe to maintain ≥ 300 m in this scenario),

[0203] The scenario is urban low speed: Vis_required = 100 m,

[0204] Obtained through vehicle speed, GPS road segment tags, road type database, or driving mode switching;

[0205] Step F - Adaptively adjust the confidence threshold T_conf,

[0206] Purpose: When the current visibility Vis_smooth is lower than Vis_required, the system should be made more sensitive (reduce the trigger threshold) to trigger the safety policy as early as possible. Conversely, when the visibility is high, the threshold can be appropriately increased to prevent false triggering.

[0207] Assume an adjustment formula (example). Let the base confidence threshold be T_base (e.g., 0.50), and define the new threshold T_conf:

[0208]

[0209] where clip(x, Tmin, Tmax) restricts x to the interval [Tmin, Tmax]. For example, Tmin = 0.2, Tmax = 0.8. If Vis_smooth < Vis_required, then Vis_smooth / Vis_required < 1 → T_conf < T_base → easier to trigger (more sensitive); if Vis_smooth is close to or higher than Vis_required, T_conf is close to or greater than T_base (subject to clip limitation), reducing the false alarm rate.

[0210] clip ensures that the threshold will not be too low to cause frequent false triggering, nor too high to be ineffective. Numerical example (continuing from the previous example):

[0211] T_base = 0.50, Tmin = 0.20, Tmax = 0.80;

[0212] Previously, Vis_smooth = 270.5 m, scenario highway Vis_required = 300 m;

[0213] Calculate T_conf = 0.50 * (270.5 / 300) = 0.50 * 0.9017 = 0.45085 → within [0.2, 0.8], no clipping required → T_conf ≈ 0.451;

[0214] Step G - Final determination and activation of driving strategy, compare and decide:

[0215] If fog_conf ≥ T_conf → trigger the corresponding driving strategy (according to the current waveband) and issue control instructions, otherwise maintain the conventional strategy or continue to monitor;

[0216] Numerical example:

[0217] Previously, fog_conf = 0.75, T_conf ≈ 0.451 → 0.75 ≥ 0.451 → trigger,

[0218] The current waveband is medium visibility → strategies such as: decelerate by 10% (calculated according to severity), increase the time headway of following vehicle by 10% (formula below), do not trigger emergency braking (only trigger in extremely low waveband or sharp decrease);

[0219] Example of action calculation:

[0220] The current speed of the vehicle V_curr = 100 km / h; the deceleration ratio is determined by "severity", and the severity can be defined as s = clamp((Vis_required - Vis_smooth) / Vis_required, 0, 1),

[0221] Here s = (300 - 270.5) / 300 ≈ 0.0983, and it is stipulated that the deceleration percentage reduction_pct = s * 0.5 (the maximum reduction is 50% limited by the system),

[0222] So reduction_pct ≈ 0.04915 ≈ 4.9% (rounding or using a preset step size), and the new speed V_new = V_curr * (1 - reduction_pct) ≈ 100 * 0.951 = 95.1 km / h,

[0223] The time headway of following vehicle TH_base = 1.2 s, and the new headway TH_new = TH_base * (1 + s) → TH_new ≈ 1.2 * 1.0983 ≈ 1.318 s,

[0224] Emergency braking: When Vis_smooth < Vis_critical (such as 50 m) and fog_conf is higher than a lower emergency threshold T_emg (such as 0.85), automatic emergency braking intervention is allowed; the current example does not meet the conditions, so emergency braking is not intervened;

[0225] Step H - Jitter suppression and persistence determination. To avoid control jitter caused by frequent switching of strategies, the following rules are adopted:

[0226] Hold time: Once the policy is triggered, it is considered to be stable only if fog_conf ≥ T_conf is continuously satisfied for at least M frames (e.g., M=3) or for t_hold seconds (e.g., 1.5s). Similarly, cancellation also requires meeting the persistence condition.

[0227] Threshold rate limiting: The change in T_conf is limited to the maximum step size per frame (e.g., ±0.05) to avoid drastic fluctuations in the threshold.

[0228] Log recording and backtracking: Triggering or deactivating event logging for offline analysis and threshold / policy optimization;

[0229] assumed:

[0230] fog_conf=0.75 (from the pre-trained model)

[0231] Regression mapping parameters a=20, b=980 → Vis_est=20+980*(1-0.75)=265 m,

[0232] The most recent 5 frames Vis_est=[300,280,270,260,265]→Vis_smooth=270.5 m (weighted average).

[0233] Band threshold: Medium visibility is 200–500 m → Current visibility is medium.

[0234] Scene recognition is high-speed → Vis_required=300 m,

[0235] T_base=0.50→T_conf=0.50*(270.5 / 300)=0.451,

[0236] Comparison: fog_conf 0.75 ≥ T_conf 0.451 → Triggering the corresponding policy for visibility.

[0237] The severity score is calculated as s = (300 - 270.5) / 300 = 0.0983.

[0238] Deceleration (example coefficient) reduction_pct=s*0.5=0.04915→V_new=100*(1-0.04915)=95.1km / h,

[0239] Following time: TH_new = 1.2 * (1 + s) = 1.318 s

[0240] Emergency braking: Vis_smooth is not less than 50m and fog_conf < 0.85, so emergency braking is not triggered.

[0241] Persistence: Continue monitoring; the policy will only be confirmed and maintained if fog_conf≥T_conf is satisfied for 3 consecutive frames.

[0242] In summary, in the example above, the system converts the fog confidence score output by the prediction model into an instantaneous visibility estimate using a mapping function pre-fitted from calibration data. It then uses a weighted moving average to obtain a smoothed visibility by retaining the estimates from the most recent N frames. This smoothed visibility is mapped to a preset visibility band, and a new confidence threshold, T_conf=clip(T_base*Vis_smooth / Vis_required,Tmin,Tmax), is adaptively calculated based on the minimum safe visibility standard (Vis_required) identified for the current vehicle scene.

[0243] When fog_conf≥T_conf and the persistence condition is met, the system dynamically activates the corresponding driving strategy from the strategy library (such as automatically reducing vehicle speed according to the severity ratio, increasing following distance, or allowing emergency braking to intervene automatically in extremely low visibility conditions), and records the event for subsequent calibration.

[0244] In this embodiment, step S3, which involves constructing a numerical matrix corresponding to the image data and extracting feature parameters of the image data from the data matrix, further includes:

[0245] S31: Based on the preset module types of the vehicle, generate data matrices of different dimensions, wherein the module types specifically include a contrast module, a color feature module, and an edge sharpness module, and the data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix;

[0246] S32: Determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis and skewness;

[0247] S33: If not, identify all values ​​of the matrix in the data matrix, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module, wherein the backup module specifically includes dark channel and edge gradient.

[0248] In this embodiment, the system generates data matrices of different dimensions based on pre-defined module types in the vehicle, specifically including a contrast module, a color feature module, and an edge sharpness module. These data matrices include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix. The system then determines whether the data matrix can extract pre-defined statistical features, specifically entropy, kurtosis, and skewness, and executes corresponding steps accordingly. For example, if the system determines that the data matrix can extract pre-defined statistical features, it considers the current image data to have sufficient distribution information and numerical fluctuation characteristics to fully reflect the degradation effect of fog on image brightness, color, and edge texture. The system then calculates the entropy from the data matrices of different dimensions. (Measures of information content and randomness), kurtosis (measures the sharpness of the distribution), and skewness (measures the skewness of the distribution) ensure that the features of each module can accurately represent the differences in the image under the influence of fog. Simultaneously, the feature vectors obtained from the contrast module, color feature module, and edge sharpness module are concatenated or weighted and fused to generate a comprehensive feature parameter set. For example, a unified vector containing entropy_brightness, entropy_color, entropy_gradient, kurtosis_brightness, etc., can be obtained. The fused statistical features are then passed as input to a pre-trained fog detection prediction model. The model calculates and outputs a fog confidence score, which serves as an important basis for determining whether fog exists in the image. For example, if the system determines that the data matrix cannot extract the pre-defined statistical features, the system will consider the current image... The data cannot reflect the degradation effect of fog on image brightness, color, and edge texture. The system identifies all values ​​in the data matrix. Based on the consistency of all values, the corresponding image region is marked as an invalid region. Invalid modules corresponding to these invalid regions are detected, and pre-set backup modules are dynamically activated. These backup modules include dark channels and edge gradients. Feature fusion and confidence weighting of the data matrix are performed using these backup modules to reduce the impact of invalid module failures. By identifying and marking invalid regions with consistent matrix values, the system avoids interrupting the entire detection chain due to the failure of a single module. This ensures the system can continuously output detection results even in complex environments, improving the stability of the detection process. By dynamically activating vehicle-preset backup modules (such as dark channels and edge gradients), the system can supplement image analysis using alternative features sensitive to fog when regular modules fail. Dark channels can effectively capture the impact of fog on image brightness distribution, while edge gradients can reflect details that are blurred. These backup features provide new dimensions for detection, thereby improving the algorithm's adaptability to diverse weather conditions. Furthermore, after the backup modules are activated, the system reasonably reduces the weight of invalid modules in the overall judgment through feature fusion and confidence weighting, avoiding the misleading effect of failed features on the results. This mechanism ensures that the final calculated fog confidence score is closer to the real environmental state, thereby improving detection accuracy and reducing the risk of misjudgment or missed detection due to feature loss.

[0249] It should be noted that, in the process of identifying all values ​​in the data matrix, marking the corresponding region image as an invalid region based on the identical results of all values, detecting invalid modules corresponding to the invalid regions, dynamically activating the vehicle's preset backup module, and performing feature fusion and confidence weighting on the data matrix through the backup module, specifically:

[0250] Identify invalid matrices (matrices that are "all identical" or have extremely low information content). For each data matrix generated by a module (brightness distribution matrix / color histogram matrix / gradient energy matrix), calculate several quality metrics, such as standard deviation (std) and entropy (Shannon entropy). If std ≤ eps (e.g., eps = 1e-6) or entropy is extremely small (e.g., entropy ≤ 0.05), the matrix is ​​considered to contain no usable statistical information (considered "invalid"). This judgment has clear statistical basis: std = 0 indicates constant pixel count, and entropy ≒ 0 indicates a uniform distribution and no information. Informative regions are marked as "invalid regions" and mapped to failed modules. The module-matrix correspondence is used to determine which module is failed (e.g., no information in the brightness matrix -> corresponding contrast / brightness module failed; no information in the gradient matrix -> edge module failed). The corresponding region is marked as an "invalid region" on the image, and the output of this module is not directly trusted subsequently. Backup modules (dark channel, backup edge, etc.) are dynamically activated, enabling alternative detection paths that do not rely on the failed matrix: for example, the dark channel. Prior edge (also known as edge operator or multi-channel edge) is used to capture brightness "filling" caused by fog; backup edge (another edge operator or multi-channel edge) is used to try to extract details even if the original edge fails.

[0251] Features are extracted from the backup module and a "fog indicator" is calculated. Features from each (primary / backup) module are mapped to a unified indicator: fogness (the higher the value, the more foggy the representation). For example:

[0252] Gradient decay → fogness = (grad_base - grad_current) / grad_base;

[0253] Color entropy decreases → fogness = (entropy_base - enropy_current) / enropy_base;

[0254] Dark channel ascent → fogness = (dark_current - dark_base) / (255 - dark_base);

[0255] The confidence level (weight) is adaptively allocated and merged, giving each module a baseline weight (set at design time, e.g., contrast 0.40, color 0.35, edge 0.25); if a module is determined to be invalid, its reliability is set to 0, and its "baseline weight" is released (freed_weight).

[0256] The freed_weight is assigned to the backup modules according to the "information reliability" of the backup modules (the reliability can be determined by the fog indicator or other quality metrics of the backup modules). Finally, the weights of all available modules (primary + backup) are normalized and the final fused fog confidence score (range 0–1) is obtained by weighted summation.

[0257] Specific examples are as follows: (Step by step, with numerical values ​​- demonstrated with small data blocks, all numerical values ​​can be reproduced),

[0258] Note: The example uses a 5x5 area to demonstrate computational details; the actual system is applied at a larger resolution but the computational logic remains the same.

[0259] 1. Input (Example): The brightness distribution matrix (contrast output) is a constant (all 5×5 are 120) → This may be caused by lens occlusion, exposure overflow, or sensor failure. The color patch (5×5×3) in the same area has color variations (used for color histogram and dark channel calculation). Another representative grayscale image (grayscale_variant) is used to calculate the gradient energy (edge ​​module output), and its value varies, so the gradient module may still be effective.

[0260] II. Determining Matrix Validity (Example Calculation): brightness_matrix: std=0.0 → Invalid (brightness is exactly the same), (meets the condition of "all matrix values ​​are the same"); gradient_energy_matrix (obtained from grayscale_variant's Sobel): std≈35.11, entropy≈0.223 → Valid; color histogram (3×4 matrix) calculates channel average entropy≈1.028 (>0.05) → Valid; (Engineering Conclusion): Brightness matrix has no information → Contrast module is invalid; edge and color modules are still usable;

[0261] 3. Activate the backup module and extract backup features.

[0262] Dark channel: For each pixel in the color patch, the minimum values ​​of R, G, and B are taken and local minimum filtering (3×3) is applied to calculate the dark channel mean; Example result: dark_mean=81.8 (pixel scale 0–255); clear reference baseline clear_dark_base≈23.12 (from clear sample);

[0263] Backup edge (multi-channel luminance Sobel): Calculate the luminance Y of the color patch, and then calculate the mean of the Sobel gradient magnitude; Example: backup_edge_mean≈107.74;

[0264] IV. Map each feature to a unified "fogness" index (example formula and value).

[0265] Main edge (gradient) fogness: grad_fog=(grad_base-grad_mean) / grad_base. The example gives grad_base≈288.95 (clear baseline), grad_mean≈107.74→grad_fog≈0.6271 (indicating significant edge decay, tending towards fog).

[0266] color_fog (color entropy decay): color_fog≈0.2234 (color entropy is about 22% lower than the sharp baseline);

[0267] dark_fog (dark channel rise): dark_fog=(dark_mean-dark_base) / (255-dark_base)≈0.2531 (dark channel rises compared to clear baseline, supporting evidence of fog);

[0268] In this example, backup_edge_fog has the same value as the main edge (because the calculation source is the same), approximately 0.6271;

[0269] V. Weight Adaptation and Fusion (Example Scheme)

[0270] Set baseline weights: contrast=0.40, color=0.35, edge=0.25; because contrast failed (reliability 0), its weight of 0.40 was released (freed_weight=0.40).

[0271] The "reliability" of the backup module is determined by its fog indicator value as a proxy (the higher the fog indicator value, the stronger and more "useful" the signal detected by the backup module). An example is using dark_fog and backup_edge_fog. The freed_weight is distributed to the backup module proportionally: the result is approximately dark≈0.1150 and backup_edge≈0.2850.

[0272] The final weights (normalized) are obtained by merging: contrast=0.00, color=0.35, edge=0.25, dark≈0.1150, backup_edge≈0.2850 (total=1.0);

[0273] VI. Final Fog Confidence (Weighted Sum)

[0274] Multiply the fogness of each module by its final weight and sum them to get the fused fog confidence score for the example: ≈0.443 (range 0–1).

[0275] Calculation details (illustrated):

[0276] 0.35*color_fog+0.25*edge_fog+0.115*dark_fog+0.285*backup_edge_fog≈0.4428;

[0277] Finally, we present the example conclusion.

[0278] Why identify "all values ​​in the matrix are the same" first? A standard deviation of zero means there are no pixel differences, and any statistical features based on distribution differences (entropy, skewness, kurtosis, local contrast) become meaningless; therefore, this area should be marked as "invalid" to avoid mistaking noise / failure signals as "foggy" features and reduce false positives or incorrect control actions.

[0279] Why activate the dark channel and backup edges? The dark channel is very sensitive to fog / haze (fog will increase the dark channel value), and it complements features based on contrast / high frequency; backup edges (edge ​​calculations at different scales or in different channels) can still extract useful information when the original edge operator fails or is affected by noise / saturation; both serve as redundancy and can significantly improve overall robustness.

[0280] Why perform weight adaptation? When the main module fails, its weight is "released" and allocated to the backup module with higher information content. This preserves the original design priority and allows the system to maintain its discriminative ability in abnormal situations, avoiding treating "no information" as confirmation. This is demonstrated in the example: the contrast module fails → its weight is allocated to dark / backup_edge, so that the final fused score still has discriminative power.

[0281] Example result interpretation (≈0.443): The fusion score is in the lower middle range of 0–1 (if the system threshold is 0.5, the strong policy will not be triggered for the time being), indicating that the backup module provides some support (both the dark channel and the edge indicator are in the direction of "fog"), but the overall evidence is not enough to force the triggering of the highest level of safety control (such as automatic emergency braking).

[0282] In this embodiment, before step S3 of inputting the feature parameters into the pre-trained prediction model and calculating the fog confidence score of the data matrix, the method further includes:

[0283] S301: Based on the vehicle's preset driving time window, acquire continuous video frames of the driving time window, construct the corresponding current frame and neighboring frames from the continuous video frames, and combine the current frame and neighboring frames to obtain the frame sequence to be analyzed;

[0284] S302: Determine whether a sequence missing is detected in the frame sequence to be analyzed;

[0285] S303: If not, the frame sequence to be analyzed is spliced ​​together in time order according to the driving time window to obtain the corresponding extended feature vector. Through the extended feature vector, the cross-time dynamic evolution information of the frame sequence to be analyzed is generated. The extended feature vector specifically includes instantaneous features, statistical features and dynamic features.

[0286] In this embodiment, the system acquires continuous video frames within a pre-set driving time window for the vehicle. It constructs the current frame and neighboring frames from these continuous video frames, combines them to obtain a sequence of frames to be analyzed, and then determines whether the sequence contains missing frames to execute corresponding steps. For example, if the system determines that the sequence contains missing frames, it considers that the lack of complete image input at certain times will affect the extraction of temporal features within the time window, thereby reducing the stability and reliability of fog detection results and failing to guarantee that the current frame and neighboring frames accurately reflect the dynamic changes in the environment. Therefore, the system uses an interpolation algorithm to generate missing frames in the time dimension to ensure the duration of the input sequence. To maintain sequence integrity, the system may repeat the previous frame, while reducing reliance on temporal features and increasing the weight of single-frame spatial features (brightness, color, edges, etc.). Backup modules (such as dark channel analysis) should be enabled to prevent model failure due to missing frames. If a fault is identified in the perception link, safe driving strategies should be triggered: reducing vehicle speed, increasing following distance, or even prompting the driver for manual intervention. For example, if the system determines that no missing frames are detected in the analyzed frame sequence, it assumes that the current frame and neighboring frames accurately reflect the dynamic changes in the environment. The system will then concatenate the analyzed frame sequence according to the driving time window to obtain the corresponding extended feature vector. The extended feature vector specifically includes instantaneous features and statistical features. By combining dynamic features with extended feature vectors, the system generates cross-time-period dynamic evolution information of the frame sequence to be analyzed. When the system determines that there are no missing frames in the frame sequence, it indicates that the video acquisition link is stable and the temporal relationship between frames is complete. This ensures that the current frame and its neighboring frames can accurately reflect the dynamic changes in the environment, such as the gradual intensification or dissipation of fog, the movement trajectory of vehicles ahead, etc. Through this continuity, the system can avoid environmental misjudgments caused by temporal interruptions, improving the authenticity and completeness of the overall perception data. At the same time, by splicing the frame sequence to be analyzed in chronological order within the time window, the resulting extended feature vector not only includes the instantaneous features of a single frame (such as brightness difference and edge sharpness) but also covers statistical features (such as multi-frame averages). The introduction of multi-dimensional features (such as variance trends and dynamic features such as temporal change rates and visibility evolution curves) can effectively weaken the impact of random anomalies in a single frame, making fog detection more stable, thereby reducing missed or false detections and improving the accuracy of confidence scores. Furthermore, by calculating the extended feature vector, the system can obtain dynamic evolution information across time periods, such as whether fog concentration continues to rise or whether environmental visibility fluctuates and weakens. This type of trend information provides advance notice for vehicle driving strategies, enabling the system not only to react to the current state but also to predict environmental changes in a short period of time. As a result, the vehicle can slow down in advance before fog worsens and gradually remove restrictions when visibility recovers, thereby achieving smoother and more intelligent safe driving control.

[0287] It should be noted that the frame sequence to be analyzed is spliced ​​together chronologically according to the driving time window to obtain the corresponding extended feature vector. The extended feature vector is then used to generate cross-time-period dynamic evolution information of the frame sequence to be analyzed, specifically:

[0288] Collect the current frame and its neighboring frames according to a preset time window (window length W) to obtain the frame sequence to be analyzed (sorted by time t=1..W).

[0289] Extract instantaneous features (e.g., range R, variance Var, high-frequency mean M_HF) for each frame in the sequence.

[0290] Based on this time series, statistical characteristics (mean, standard deviation, minimum / maximum, skewness, kurtosis, etc.) are calculated for each feature.

[0291] Calculate dynamic characteristics (first-order difference series, regression slope, mean / variance of differences, short-term autocorrelation, etc.);

[0292] The "instantaneous features (which can be spliced ​​frame by frame) + statistical features + dynamic features" are combined into an extended feature vector, which serves as a representation of "cross-time dynamic evolution information".

[0293] Based on the extended vector, the following are performed: a) trend determination (whether there is continuous deterioration); b) rate estimation (change per second / per frame); c) prediction (when a key feature will cross the safety threshold); and risk indicators and recommended measures are output accordingly.

[0294] The following calculations are performed step by step using an example of W=5 frames (for ease of time interpretation, it is assumed that the sampling / analysis frequency is 1 Hz, that is, each frame represents 1 second—any sampling rate can be used in actual systems, and the time conversion can be replaced accordingly).

[0295] Specific examples are as follows: Example data (5 frames, 1 Hz sampling).

[0296] Let the three instantaneous features extracted from each frame be:

[0297] Range R sequence (frame 1 → frame 5): 120, 110, 100, 90, 80

[0298] Var series with variance: 2000, 1800, 1600, 1400, 1200

[0299] High-frequency mean M_HF sequence: 400, 360, 320, 280, 240

[0300] The above values ​​are for demonstration purposes, indicating that all three indicators decrease over time, which is consistent with the intuitive physical phenomenon of fog thickening.

[0301] Calculate step by step (expand each item in turn).

[0302] I. Instantaneous characteristics (current frame, i.e., frame 5)

[0303] Rcurr=80,

[0304] Varcurr=1200,

[0305] MHF_curr=240,

[0306] These three items can be directly incorporated into the "current frame instantaneous part" of the extended vector;

[0307] II. Statistical characteristics (examples of calculating mean, standard deviation, min, max, skewness and kurtosis for each sequence)

[0308] Range R:

[0309] Sum: 120 + 110 + 100 + 90 + 80 = 500

[0310] Mean: μR = 500 / 5 = 100

[0311] Deviation (xi-μ): 20, 10, 0, -10, -20

[0312] Sum of squares: ,

[0313] Variance (population): VarR = 1000 / 5 = 200

[0314] Standard deviation: ,

[0315] Minimum / Maximum: min=80, max=120

[0316] Skewness: Sum of cubes is ,

[0317] Kurtosis (example calculation, uncentered): Fourth power sum = 160000 + 10000 + 0 + 10000 + 160000 = 340000.

[0318] The fourth-order mean = 340000 / 5 = 68000.

[0319] = =40000,

[0320] The ratio = 68000 / 40000 = 1.7.

[0321] Excess kurtosis = 1.7 - 3 = -1.3 (indicating a flatter distribution than the normal distribution).

[0322] Variance feature Var (for ease of explanation, Var is used as a name for a "feature sequence"):

[0323] Sum: 2000 + 1800 + 1600 + 1400 + 1200 = 8000

[0324] Mean μVar = 8000 / 5 = 1600

[0325] Deviation: 400, 200, 0, -200, -400

[0326] Variance: Sum of squares = 160000 + 40000 + 0 + 40000 + 160000 = 400000

[0327] Total variance = 400000 / 5 = 80000

[0328] Standard deviation σVar= ,

[0329] min=1200, max=2000, skewness=0 (symmetric); kurtosis is calculated in the same way as above (similar excess kurtosis can be obtained);

[0330] High-frequency mean M_HF:

[0331] Sum: 1600; Mean μHF = 320

[0332] Deviation: 80, 40, 0, -40, -80, Sum of squares = 6400 + 1600 + 0 + 1600 + 6400 = 16000, Variance = 16000 / 5 = 3200, Standard deviation = ≈56.5685, min=240, max=400, skewness=0, excess kurtosis≈-1.3 (same structure as above).

[0333] The statistical statistics (mean / standard deviation / skewness / kurtosis) constitute the "statistical characteristic components" of the extended vector, which are used to characterize the overall distribution and "scatter / tail" features of the sequence;

[0334] III. Dynamic characteristics (rates and differences, regression slope, etc.)

[0335] First-order difference (change between adjacent frames)

[0336] R-difference: 110-120=-10, 100-110=-10, 90-100=-10, 80-90=-10 → Difference sequence = [-10,-10,-10,-10], average difference = -10 (unit: per frame).

[0337] Var difference: [-200, -200, -200, -200], mean = -200.

[0338] M_HF difference: [-40, -40, -40, -40], mean = -40

[0339] Linear regression slope (least square fit, x=0,1,2,3,4)

[0340] Perform a simple linear fit on R and calculate the slope (using the formula):

[0341] x_mean = (0 + 1 + 2 + 3 + 4) / 5 = 2, where the denominator is 2. =4+1+0+1+4=10,

[0342] molecular =(-2)×20+(-1)×10+0×0+1×(-10)+2×(-20)=-40-10+0-10-40=-100,

[0343] Slope s_R = -100 / 10 = -10 (per frame) — consistent with the differential (constantly decreasing).

[0344] Similarly: s_{Var}=-200 (per frame), s_{HF}=-40 (per frame).

[0345] Standardize the slope (to facilitate the merging of different units): Standardize the slope according to the mean of the sequence, and define the "relative rate of change":

[0346] (Relative drop rate per frame)

[0347] =200 / 1600=0.125,

[0348] =40 / 320=0.125,

[0349] These values ​​are all positive, indicating the intensity of the change in the direction of atomization (the larger the value, the faster the change).

[0350] IV. Forming Extended Feature Vectors (Example Format and Values)

[0351] A feasible extended vector consists of three parts (examples are listed in order):

[0352] A. Instantaneous stitching section (stitching together instantaneous features from each frame in chronological order) – 15 elements (3 features × 5 frames):

[0353] [R1,R2,R3,R4,R5,Var1,Var2,...,Var5,M_HF1,...,M_HF5]=[120,110,100,90,80,2000,1800,1600,1400,1200,400,360,320,280,240],

[0354] B. Statistical Features (6 features per feature: mean, std, min, max, skew, kurt) – Example from R section:

[0355] [R_mean=100,R_std≈14.1421,R_min=80,R_max=120,R_skew=0,R_excess_kurtosis≈-1.3],

[0356] The same applies to Var and M_HF;

[0357] C. Dynamic Feature Part (3-4 features per feature: mean_diff, std_diff, slope, normalized_slope):

[0358] R:mean_diff=-10,std_diff=0,slope=-10,norm_slope=0.10

[0359] Var:mean_diff=-200,std_diff=0,slope=-200,norm_slope=0.125

[0360] M_HF:mean_diff=-40,std_diff=0,slope=-40,norm_slope=0.125

[0361] Combining A, B, and C results in a complete extended feature vector (in this example, it can be expanded to a length of approximately 15 + 18 + 12 = 45; specific fields can be added or removed according to the design).

[0362] A specific example (prediction and judgment) of generating "cross-time dynamic evolution information" from extended features.

[0363] Unify the "trend severity score" and combine them into a single trend severity index using normalized slopes and weights (for easier decision-making):

[0364] Assuming weights (design values) w_R = 0.4, w_{Var} = 0.3, w_{HF} = 0.3, calculate:

[0365] Severity=0.4×0.10+0.3×0.125+0.3×0.125=0.04+0.0375+0.0375=0.115,

[0366] Explanation: Severity = 0.115 (unit: "relative severity per frame"). The higher the value, the faster the fog worsens within the time window.

[0367] Predicting "when key metrics will cross a threshold" (linear extrapolation example), setting a safety threshold (example):

[0368] R_{th}=50 (range critical threshold).

[0369] Var_{th}=800,

[0370] M_{HF_th}=200,

[0371] Current (frame 5) values: R=80, Var=1200, M_{HF}=240, slope per frame is -10, -200, -40.

[0372] The number of frames required to reach the threshold is calculated as n = (current-th) / (-slope) (slope<0).

[0373] For M_HF: n_{HF}=(240-200) / 40=40 / 40=1 frame → If the sampling frequency is 1 Hz, then M_HF will drop to 200 after about 1 second.

[0374] For Var: n_{Var} = (1200-800) / 200 = 400 / 200 = 2 frames → 2 seconds.

[0375] For R: n_R = (80-50) / 10 = 30 / 10 = 3 frames → 3 seconds;

[0376] Interpretation: Under the current window conditions, high-frequency details (M_HF) are the first to reach the safety threshold (1 second), indicating that texture / edge information is lost first, which is the earliest warning signal; this can be used to prioritize triggering early deceleration or strengthening the confidence level judgment.

[0377] Consistency and confidence checks (to avoid noise-induced misjudgments): If the slopes of multiple key features (R, Var, M_HF) are in the same direction (all negative here), the confidence of the trend judgment is improved.

[0378] In summary, in the examples above, if it is predicted that a certain key feature will exceed the threshold within t ≤ t_warn (e.g., 2 seconds), a "short-term warning" is issued, and the vehicle speed is gradually reduced while the following distance is increased. The "feature that first exceeds the threshold" and its prediction time serve as the trigger.

[0379] If t ≤ 1s: Quick intervention (substantial deceleration, strict control of automatic lane change),

[0380] If 1s < t ≤ 3s: Gentle deceleration, increase the vehicle distance, increase the visual / radar monitoring frequency,

[0381] If the feature continues to deteriorate and multiple items exceed the threshold: Enter the emergency strategy (allow emergency braking or recommend manual takeover),

[0382] Continuous monitoring and rollback: When the smoothed Vis or key features recover beyond the safety line and continue for M_hold seconds, lift the restrictions step by step,

[0383] Recording and online learning: Record the extended feature vector and trigger events, and perform offline annotation and iterative training of thresholds / mapping functions;

[0384] Detailed description of the above example content: 7]

[0385] Sampling rate description: The example uses 1 Hz for easy time conversion; the actual camera frame rate is higher, and downsampling can be performed as needed (e.g., 1 Hz) to reduce the computational load and match the vehicle response delay;

[0386] Smoothing and robustness: Before calculating the slope, the original sequence can be smoothed with a small window (moving average, median filtering) to remove spike noise; or use robust regression to estimate the slope;

[0387] Threshold and weight calibration: Thresholds (R_th, Var_th, M_HF_th) and combination weights should be based on large-scale calibration data (fog-free / light fog / heavy fog samples) and consider vehicle dynamics and regulatory limits;

[0388] Multi-module consistency: Prefer to use the consistency determination of multiple modules (brightness / color / edge) to trigger the strategy, and extreme values of single modules need to be verified by backup features or time series;

[0389] Response link time budget: Compare the time to predict the threshold with the vehicle response time (controller delay, brake dynamics) to decide whether to take more conservative actions in advance;

[0390] By integrating short-term (instantaneous) information, window-level statistical information, and dynamic features (differences, slopes, predictions) into the extended feature vector, the system can characterize "how the fog evolves over time" in terms of time, achieve trend detection, rate estimation, threshold extrapolation, and early response. In the example, it is calculated by simple and interpretable arithmetic derivation that M_HF will exceed the threshold within 1 second in the current window. Therefore, the system can intervene in advance based on this, and thus make a robust active safety decision with a shorter time window.

[0391] In this embodiment, step S5, which involves constructing the vehicle's visibility band data in real time and dynamically activating the vehicle's preset driving strategy based on the visibility band data, further includes:

[0392] S51: Based on the preset unit value of the visibility band data, the visibility band data is divided into levels to generate corresponding visibility band levels, wherein the visibility band levels specifically include high visibility band, medium visibility band, low visibility band and very low visibility band.

[0393] S52: Determine whether the visibility band level detects continuous temporal fluctuations;

[0394] S53: If so, the continuous time fluctuations are stored in a preset buffer queue. A preset number of visibility values ​​are selected from the buffer queue. The differences between adjacent frames of the visibility values ​​are detected. Based on the differences between adjacent frames, the visibility values ​​are classified as outliers. The outliers are filtered and corrected to dynamically correct the band results of the visibility band data.

[0395] In this embodiment, the system classifies the visibility band data into levels based on pre-set unit values, generating corresponding visibility band levels. These levels specifically include high visibility bands, medium visibility bands, low visibility bands, and extremely low visibility bands. The system then determines whether these visibility band levels detect continuous time fluctuations, and executes corresponding steps accordingly. For example, if the system determines that no continuous time fluctuations are detected in the visibility band levels, it considers the time fluctuations within the selected time window (e.g., the most recent N...) to be within the selected time window. If the visibility band level remains stable (within the last frame or the most recent T seconds) without a continuous upward or downward trend, the system will immediately maintain the current visibility band level and corresponding driving strategy (e.g., if in the medium visibility band, maintain the corresponding speed reduction / distance strategy). If a degraded safety strategy (such as temporary deceleration) was previously in effect, it will not be lifted until the continuous stability condition is met before rolling back. Simultaneously, a sliding short-term voting judgment is performed on the visibility band sequence to confirm stability. If stable and it is determined that high-frequency detection is unnecessary, the sampling frequency of fog detection can be reduced to save computational resources (e.g., from 10 Hz to 2 Hz). (Hz), but key thresholds must be monitored; for example, when the system detects continuous time fluctuations in the visibility band level, it considers the visibility band level unstable within the currently selected time window. The system stores the continuous time fluctuations in a pre-set buffer queue, selects a pre-set number of visibility values ​​from the buffer queue, detects the differences between adjacent frames of these visibility values, classifies the visibility values ​​as outliers, filters and corrects these outliers, and dynamically corrects the band results of the visibility band data; when the visibility band level detects continuous time fluctuations, the system does not immediately trigger a driving strategy switch, but first stores these fluctuations in the buffer queue, and then identifies whether there are outliers through adjacent frame difference analysis. This mechanism effectively avoids erroneous judgments caused by interference from individual frames such as sudden changes in illumination, camera noise, or instantaneous obstruction, thereby ensuring visibility. By ensuring the smoothness and continuity of the judgment results, and through the detection of differences between adjacent frames in the cache queue, the system can locate abnormal visibility values ​​that do not conform to the overall trend within a short period of time. Filtering and correcting these abnormal values ​​is equivalent to performing "denoising" and "correction" at the time-series data level, making the final visibility band results closer to the real environment. This improves the system's ability to represent actual fog conditions. Furthermore, based on the dynamic correction of visibility band results, the system's output band level is more stable and reliable, avoiding unnecessary operations caused by frequent and erroneous switching of driving strategies. For example, if fluctuating visibility values ​​are used directly without filtering, the vehicle may repeatedly trigger "deceleration / recovery" actions, causing safety hazards or passenger discomfort. By caching, detecting, and correcting the band results, the system can ensure that the triggering conditions of driving strategies are based on a robust data foundation, thereby improving overall driving safety.

[0396] It should be noted that continuous temporal fluctuations are stored in a preset buffer queue. A preset number of visibility values ​​are selected from the buffer queue. The differences between adjacent frames of the visibility values ​​are detected. Based on the differences between adjacent frames, the visibility values ​​are classified as outliers. The outliers are then filtered and corrected to dynamically correct the band results of the visibility band data. Specifically:

[0397] After continuously detecting "fluctuations" in visibility band levels, the visibility values ​​corresponding to these times are stored in a buffer queue (length N) in chronological order; a preset number of visibility values ​​(e.g., the most recent N=9) are retrieved from the buffer queue, and the absolute difference sequence between adjacent frames is calculated. The process involves detecting "abnormal differences" based on the difference sequence (using robust rules: a combination of absolute and relative thresholds); if certain adjacent differences are judged as abnormal, the specific frame causing the abnormality is located; filtering corrections are performed on the visibility values ​​judged as abnormal (e.g., Hampel / median replacement or linear interpolation based on adjacent valid frames) to obtain a corrected visibility sequence; the visibility band level is recalculated using the corrected sequence, and jitter suppression is performed before enabling shifting or strategies (e.g., requiring confirmation of M consecutive frames). The following example illustrates the calculation of each step with specific numerical values:

[0398] Numerical Example (Step-by-Step Calculation)

[0399] Example input (time order, unit: meters).

[0400] Assume the cache queue takes the most recent N=9 visibility estimates (t_1 to t_9).

[0401] Vis=[480,475,470,465,60,460,455,450,445] corresponds to t1, t2, t3, t4, t5, t6, t7, t8 and t9. Note: Most values ​​are in the range of 445–480m (medium visibility range), but the 5th frame is 60m (sudden drop), which is obviously inconsistent with the surroundings. It may be an anomaly caused by momentary occlusion / sensor failure.

[0402] Step 1, calculate the absolute difference between adjacent frames. ,

[0403] Δ1 = |475 - 480| = 5,

[0404] Δ2 = |470 - 475| = 5,

[0405] Δ3 = |465 - 470| = 5,

[0406] Δ4 = |60 - 465| = 405,

[0407] Δ5 = |460 - 60| = 400,

[0408] Δ6 = |455 - 460| = 5,

[0409] Δ7 = |450 - 455| = 5,

[0410] Δ8 = |445 - 450| = 5,

[0411] Obtain the differential sequence:

[0412] Δ=[5,5,5,405,400,5,5,5];

[0413] Step 2, set the anomaly detection threshold. Design principle (scientific basis): If the environment is stable, the difference between normal adjacent values ​​should be small (here ~ 5m). Directly using MAD / percentile may also degrade when "most values ​​are exactly the same" (MAD→0). Therefore, a hybrid strategy is adopted: set an absolute threshold T_{abs} (e.g. 50 m) and a relative threshold factor k (e.g. 10), and calculate the local reference (medianΔ).

[0414] Control rules (use the larger of the two to increase robustness).

[0415] T=max(T_{abs},k×median(Δ)),

[0416] The value in this example is:

[0417] median(Δ) = 5.

[0418] Let T_{abs} = 50 (meters), k = 10 → k × median = 10 × 5 = 50k, therefore T = max(50, 50) = 50 (meters);

[0419] Step 3: Identify abnormal differences using thresholds.

[0420] Compare each With T,

[0421] Δ1=5≤50→Normal

[0422] Δ2=5≤50→Normal

[0423] Δ3=5≤50→Normal

[0424] Δ4=405>50→Abnormal

[0425] Δ5=400>50→Abnormal

[0426] Δ6=5≤50→Normal

[0427] Δ7=5≤50→Normal

[0428] Δ8=5≤50→Normal

[0429] The abnormal differences are concentrated in Δ4 and Δ5, which indicates that the jumps between 4 and 5 and between 5 and 6 are very large, and the anomalies are likely to originate from the middle 5th frame (Vis5=60).

[0430] Step 4, Locate the "abnormal frame"—Use a local window to determine which specific frame is abnormal.

[0431] For each abnormal difference Check the differences between two frames. and The deviations from the local median are calculated (the local median is calculated using a three-point window: the previous frame, the current frame, and the next frame), and the frame with the largest deviation is selected as the "abnormal frame".

[0432] Taking Δ4 (involving t_4 and t_5, 465 and 60) as an example:

[0433] The local three points are [Vis_4=465,Vis_5=60,Vis_6=460] → sorting [60,460,465] → local median=460;

[0434] Deviation: |465-460|=5, |60-460|=400, |460-460|=0 → The maximum deviation is 400, corresponding to Vis_5. Therefore, frame 5 is determined to be an abnormal frame. (The conclusions given by Δ5 and Δ4 are consistent, both pointing to frame 5.)

[0435] Step 5: Perform filtering correction on outliers.

[0436] This example uses linear interpolation: the previous valid frame Vis_4=465, the next valid frame Vis_6=460, linear interpolation (or two-point averaging):

[0437]

[0438] The corrected sequence is obtained after the replacement.

[0439] Vis_corr=[480,475,470,465,462.5,460,455,450,445];

[0440] Step 6: Verify the correction effect (recalculate the neighboring differences).

[0441] Recalculate ,

[0442] |475-480|=5

[0443] |470-475|=5

[0444] |465-470|=5

[0445] |462.5-465|=2.5

[0446] |460-462.5|=2.5

[0447] |455-460|=5

[0448] |450-455|=5

[0449] |445-450|=5,

[0450] The new differential sequence [5,5,5,2.5,2.5,5,5,5] is all much smaller than the threshold T=50, indicating that the anomaly has been successfully corrected and the sequence has returned to smoothness.

[0451] Step 7, dynamically correct visibility band results (band threshold example).

[0452] Assume the system's preset band threshold is (example):

[0453] High visibility: Vis>500 m

[0454] Medium visibility: 200 <Vis≤500 m

[0455] Low visibility: 50 <Vis≤200 m

[0456] Extremely low visibility: Vis≤50 m

[0457] If the original (uncorrected) sequence is directly judged as follows: Frame 5 is 60 m → belonging to "low visibility" → which may cause the system to temporarily downgrade the driving strategy. After correction, all frame values ​​are in the range of 445–480 m → belonging to "medium visibility" → the system maintains or returns to the driving strategy corresponding to medium visibility. Therefore, the effect of dynamic correction avoids the erroneous band downgrade caused by single frame anomalies (false triggering of conservative strategy) and restores a more stable and reliable band judgment.

[0458] In this embodiment, step S2, which determines whether fog is detected in the image data, further includes:

[0459] S21: Based on the image grayscale histogram of the image data, identify the distribution characteristics of pixel values ​​from the image grayscale histogram;

[0460] S22: Determine whether the distribution characteristics are concentrated and the dynamic range is narrowing;

[0461] S23: If so, perform edge detection on the image grayscale histogram, calculate the number of edges of the pixel value, identify the dynamic changes of the pixel value, divide the image grayscale histogram into a preset number of sub-block regions according to the dynamic changes, collect the contrast of the sub-block regions respectively, and generate the statistical results of the contrast decrease.

[0462] In this embodiment, the system identifies the distribution characteristics of pixel values ​​based on the image grayscale histogram of the image data. The system then determines whether these distribution characteristics are concentrated and whether the dynamic range is reduced, in order to execute corresponding steps. For example, if the system determines that the pixel value distribution characteristics are concentrated but the dynamic range is not reduced, the system will consider that the scene has localized lighting dominance or uneven texture feature distribution. The system will mark this state in the feature determination logic to avoid misjudging it as fog. Combined with scene classification (e.g., indoor / outdoor, day / night) or vehicle positioning data, the current lighting environment is confirmed. In addition to the grayscale histogram, color histograms, edge sharpness distribution, or dark channel priors can also be referenced to further determine whether there are signs of fog. If there is still doubt, a time window can be introduced to observe whether the "concentrated distribution but wide dynamic range" feature continues to appear in subsequent frames. If it continues and the dynamic range does not shrink, it is confirmed that it is not fog, avoiding erroneous triggering of defogging processing or driving strategy switching. For example, if the system determines that the pixel value distribution characteristics are not concentrated, the system will consider that the image still has fog. However, since there is sufficient contrast and detail, the overall visual information is not "concentrated and compressed" due to fog or similar degradation effects. The system will mark the fog detection of the image as a negative result to avoid triggering unnecessary defogging or safety strategies. At the same time, the image can be directly input into subsequent conventional visual processing modules (such as object detection and lane line recognition) without additional preprocessing. In order to improve robustness, the system can combine consecutive frames to compare whether multiple consecutive frames show "dispersion" results to confirm that the environment is continuously clear. For example, when the system determines that the distribution characteristics of pixel values ​​are concentrated and the dynamic range is narrowed, the system will consider that most pixel values ​​fall within a narrow gray range and the image lacks brightness differences. It will infer that the current environment may have fog, haze, or optical interference (such as glass condensation or lens blur). The system will perform edge detection on the image gray histogram, calculate the number of edges of pixel values, identify the dynamic changes of these pixel values, divide the image gray histogram into a pre-set number of sub-block regions according to the dynamic changes, collect the contrast of these sub-block regions, and generate statistical results of contrast decrease.By identifying the concentrated distribution and dynamic range reduction of the image's grayscale histogram, the system can promptly detect low-visibility scenes such as fog, haze, or blurred images. Further combining edge detection and pixel dynamic change analysis, it can effectively eliminate interference caused by simple brightness changes or shadows, thus avoiding misjudgments. This multi-level judgment mechanism ensures the sensitivity and accuracy of vehicles in complex environments to fog and haze features, improving detection reliability. Simultaneously, dividing the grayscale histogram into a predetermined number of sub-blocks and calculating the contrast of each region reveals the degradation differences in different image areas under fog or interference; for example, the contrast of distant road areas decreases significantly, while that of nearby vehicles... Maintaining high contrast values ​​in areas with good visibility or road signs helps the system distinguish between "overall visibility reduction" and "local blurring interference," providing more refined data support for subsequent driving strategies. Furthermore, by statistically analyzing the overall contrast reduction in sub-block areas, the system can not only determine whether the image is affected by fog or haze at the current moment, but also quantify the degree and extent of the reduction. This result can be directly mapped to the vehicle's visibility level assessment, providing a scientific basis for dynamically activating driving strategies (such as reducing speed and increasing following distance). Continuous contrast reduction statistics can also serve as time-series features, supporting the prediction of fog intensification trends.

[0463] It should be noted that edge detection is performed on the image grayscale histogram, the number of edges of the pixel values ​​is calculated, the dynamic changes of the pixel values ​​are identified, and based on the dynamic changes, the image grayscale histogram is divided into a preset number of sub-block regions. The contrast of each sub-block region is collected, and a statistical result of the contrast decrease is generated. Specifically:

[0464] Calculate the grayscale histogram of the current frame (divided into preset bins), perform edge detection (Sobel) on the original image, obtain the gradient magnitude matrix and binarize it into an edge map, count the total number of pixels in each grayscale bin (or sub-block) and the number of edge pixels in that bin (used for "edge count of pixel value"), calculate the dynamic change (difference or ratio) of the histogram between the current frame and the baseline / previous frame, identify bins with significant changes, divide them into preset sub-blocks (e.g., 4 grayscale intervals), extract the pixels belonging to each sub-block in the image, calculate the sub-block contrast (here, RMS contrast = standard deviation of pixels σ), calculate the decrease in contrast of each sub-block (absolute value and percentage), form "contrast decrease statistics", and determine whether to identify it as fog / visibility reduction based on the combination of edge count change + contrast decrease (or threshold strategy), and use it as the basis for subsequent processing;

[0465] The following are numerical examples following the steps above:

[0466] Example: Input and preset,

[0467] Use two 8×8 grayscale matrices (example, pixel values ​​0–255).

[0468] clear: The numerical coverage extends from the lower to the higher segments (see the matrix below).

[0469] fog: Contrast compression is created using linear blending (fog=0.5*clear+0.5*120) (example).

[0470] The histogram is divided into 4 grayscale sub-bins: [0-63], [64-127], [128-191], [192-255];

[0471] I. Calculation and Example Values ​​(Item by Item)

[0472] 1) Grayscale histogram (number of pixels in each bin).

[0473] hist_clear=[20,22,22,0],

[0474] hist_fog=[0,46,18,0],

[0475] Explanation: The clear image has pixels in the first (0–63), second (64–127), and third (128–191) regions; after fogging, the first region (dark pixels) almost disappears (from 20→0), and many pixels that were originally in the first region are "lifted" to the second region (intermediate gray level). This is a typical manifestation of the fog / veil effect (dark pixels are lifted by the gray fog layer).

[0476] 2. Sobel edge detection and threshold binarization: calculate the gradient magnitude matrix G, and use median(G) as the threshold to obtain the edge map;

[0477] Threshold (example):

[0478] edge_thr_clear≈89.44

[0479] edge_thr_fog≈44.72,

[0480] (Edge pixel count, total pixel count) in each bin:

[0481] Clear: edge_counts_clear=[(12,20),(14,22),(14,22),(0,0)],

[0482] Atomization: edge_counts_fog=[(0,0),(29,46),(11,18),(0,0)],

[0483] explain:

[0484] In the clear image, edges (such as the edge from the dark area to the mid-gray area) are present in regions 1, 2, and 3, while after fogging, there are no pixels in region 1. Fogging causes the edges that were originally distributed in the low gray area to "disappear" or move to the mid-gray area. The edge count in region 2 increases (29), but this is accompanied by a decrease in the edge intensity threshold (the median is halved), indicating that the overall edge energy is compressed and weakened. The changes in the number of edges and edge density (edges / total_pixels) in each region can be used as a dimension for fogging judgment.

[0485] 3. Identify dynamic changes (difference / ratio) in grayscale histograms.

[0486] Difference: hist_diff = hist_fog - hist_clear = [-20, +24, -4, 0]

[0487] Ratio (avoiding division by zero semantics): hist_ratio≈[0.0,2.09,0.82,0.0]

[0488] Explanation: Zone 1 shows a significant decrease (-20), Zone 2 doubles in pixel count (+24, ratio 2.09), and Zone 3 shows a slight decrease; the dynamic change of the histogram "concentrating towards the center" is common in situations where fog / haze or a hazy light layer raises the value of dark pixels;

[0489] 4. Divide the blocks into sub-blocks and calculate the contrast of each sub-block (using RMS contrast=σ).

[0490] For each sub-block, the pixel standard deviation (σ) is calculated separately in the sharp and blurred images as a contrast index.

[0491] contrast_clear≈[14.79,20.16,16.20,0.0] (four sub-blocks).

[0492] contrast_fog≈[0.00,18.54,6.69,0.0],

[0493] explain:

[0494] The contrast of Zone 1 (dark area) becomes 0 after fogging (because there are no pixels in this area or the number of pixels becomes constant), Zone 2 decreases slightly (about 20.16→18.54), and Zone 3 decreases significantly (16.20→6.69), indicating that the details / texture in the mid-to-high grayscale areas are severely lost after fogging;

[0495] V. Generate contrast reduction statistics (absolute reduction amount and percentage).

[0496] Absolute decrease: [14.79, 1.62, 9.51, 0.0]

[0497] Percentage decrease: [100.0%, 8.03%, 58.70%, 0.0%]

[0498] Example of interpretation and judgment rules:

[0499] If the "significant decrease" threshold is set to 30% (which can be adjusted according to the dataset), then Zone 1 (100%) and Zone 3 (≈58.7%) are judged as significant decreases, while Zone 2 (8%) is not significant. The large decrease in Zone 1, combined with the disappearance of Zone 1 pixels in the histogram (hist_diff) and the edge count being 0, strongly indicates that dark pixels are lifted by veil or dark details are lost - a typical fog effect.

[0500] In summary, the examples above, through a three-layer analysis of "histogram—edge count—sub-block contrast reduction," can quantify the blurry "grayscale image" phenomenon into comparable indicators (hist_diff, edge_count change, contrast_drop_pct). In the examples, these indicators consistently point to "brightening of dark areas and loss of detail caused by fogging"—meaning the system can reliably trigger subsequent processing for fog detection or reduced visibility based on this. This process has both statistical basis (histogram / σ / ratio) and image processing basis (Sobel edges, local contrast), and can further improve robustness through multi-frame fusion.

[0501] In this embodiment, step S4, which determines whether the fog confidence score is higher than a preset confidence threshold, further includes:

[0502] S41: Based on the fog-free image dataset pre-collected by the prediction model, identify the target application scenario of the fog confidence score, wherein the fog-free image dataset specifically includes highways, urban roads, rural roads, parking lots, and tunnel entrances;

[0503] S42: Determine whether the target application scenario matches the preset lighting conditions, wherein the lighting conditions specifically include sunny days, cloudy days, and nighttime;

[0504] S43: If so, then collect the threshold crossing frequency of the fog confidence score, identify the trend parameter of the fog confidence score based on the threshold crossing frequency, and output the confidence detection result of the fog confidence score with a delay based on the trend parameter.

[0505] In this embodiment, the system identifies target application scenarios with fog confidence scores based on a pre-collected fog-free image dataset, specifically including highways, urban roads, rural roads, parking lots, and tunnel entrances. The system then determines whether these target application scenarios match pre-defined lighting conditions, specifically sunny days, cloudy days, and nighttime, and executes corresponding steps accordingly. For example, if the system determines that a target application scenario with a fog confidence score does not match the pre-defined lighting conditions, the system considers it potentially "out of the domain" for that lighting / scene combination, reducing the reliability of the model output (including fog confidence score) and increasing the likelihood of false negatives or false positives. The system will then, without reliable visual confirmation, temporarily... A conservative strategy is adopted, slightly reducing the cruising speed (e.g., slowing down by 5%–15%), moderately increasing the safe following time (+20%), and limiting automatic lane changing / overtaking. Simultaneously, a driver prompt is sent: "Abnormal visual conditions, please pay attention to road conditions / take over." The system also records the original image, model output, lighting matching confidence score, sensor readings, and GPS road segment information at that moment for subsequent offline annotation and model retraining. For example, when the system determines that the target application scenario of the fog confidence score matches the pre-set lighting conditions, the system considers the model output (including fog confidence score) to be reliable under that lighting / scene combination. The system collects the threshold crossing frequency of the fog confidence score and, based on different threshold crossing frequencies,... The system identifies trend parameters of the fog confidence score and, based on these parameters, delays the output of the fog confidence score detection result. When the system confirms that the target application scenario matches the lighting conditions, it indicates that the current environment is consistent with the distribution during model training. At this point, the fog confidence score output by the model has high reliability. Furthermore, the system collects the threshold crossing frequency of the fog confidence score and identifies the trend parameters of the fog confidence score based on the crossing frequency. This avoids erroneous judgments caused by instantaneous noise or short-term fluctuations, thus ensuring that the fog detection results are more stable and more consistent with the actual driving environment. Simultaneously, through the extraction of trend parameters, the system no longer relies solely on a single value at a single frame or time point, but rather on the changing characteristics across time periods. This trend-based analysis method effectively distinguishes between "short-term interference signals" (such as abnormal headlights, shadows, and instantaneous exposure) and "real fog deterioration," significantly reducing false alarms and alerts. This ensures that the vehicle's autonomous driving strategy is triggered only when truly needed, improving driving safety and comfort. Furthermore, the system uses a delayed output mechanism based on trend parameters, rather than immediately outputting detection results. This means that the fog confidence detection status is only updated when the trend characteristics are fully confirmed. This delayed mechanism effectively avoids frequent strategy switching caused by single threshold crossings, ensuring the stability of the vehicle in fog detection and driving control, and improving the overall system's adaptability to complex traffic environments and variable weather conditions.

[0506] It should be noted that the threshold crossing frequency of the fog confidence score is collected, and a trend parameter of the fog confidence score is identified based on the threshold crossing frequency. Based on the trend parameter, the confidence detection result of the fog confidence score is output with a delay. Specifically:

[0507] 1. Sample and smooth the fog confidence sequence.

[0508] Original input: Window length N (e.g., 12 seconds), sampling rate f_s (e.g., 1 Hz), resulting in a sequence x_t∈[0,1], t=1..N.

[0509] EWMA is commonly used for smoothing (suppressing single-frame noise).

[0510] , ,

[0511] Where α∈(0,1] (0.2–0.5 is commonly used in engineering), smoothing can reduce the misleading effect of single-point mutations on "cross-counting".

[0512] Statistical thresholding of crossing events and crossing frequency: A baseline threshold T (e.g., 0.5) is set, and a smoothed value is used to determine "crossing events".

[0513] Upward event count ,

[0514] Crossover frequency (times / second or times / window): ,

[0515] Reason: Frequent crossings indicate that the sequence is fluctuating (unstable) near the threshold, while infrequent crossings indicate stable crossings (more reliable).

[0516] Identify trend parameters (multidimensional)

[0517] Several quantitative indicators are calculated within the same window; the slope (OLS linear regression) represents the long-term directionality.

[0518] s ,

[0519] A positive slope indicates that the confidence level of fog is increasing (worsening), while a negative slope indicates that it is decreasing (improving).

[0520] Exceedance ratio: This reflects the percentage of the window that is "above the threshold".

[0521] Volatility: , used to measure noise / uncertainty;

[0522] The parameters are normalized and combined into TrendScore. To merge different units, normalization is performed empirically:

[0523] norm_slope_pos=clip(slope / Smax,0,1) (only the part that is favorable to "rising" is taken).

[0524] norm_cross=clip(fcross / fmax,0,1),

[0525] norm_vol=clip(σs / σref,0,1),

[0526] Then a weighted combination is used (example weights):

[0527] TrendScore=wp×pex+ws×norm_slope_pos+wc×norm_cross-wv×norm_vol,

[0528] The sum of w_p, w_s, w_c, and w_v can be set to 1 (or close to 1), and the weights can be determined empirically or through offline optimization.

[0529] explain: (Percentage) is the most direct and strong evidence; a positive slope indicates "deterioration"; frequency crossings further indicate "whether it fluctuates near the threshold"; volatility serves as a penalty, with high volatility indicating unreliability and lowering the TrendScore.

[0530] Make three types of output decisions based on TrendScore.

[0531] If TrendScore ≥ Immediate confirmation (IMMEDIATE) → Immediately outputs fog detection results and can trigger driving strategies;

[0532] like ≤TrendScore< Delayed confirmation (DELAYED) → Temporarily suspend output, continue sampling and request additional confirmation (e.g., collect another M frames or wait t_hold seconds).

[0533] If TrendScore < No confirmation (NO) → No trigger.

[0534] In other words, delayed confirmation can significantly reduce false alarms caused by transient noise or short-term changes in illumination;

[0535] II. Numerical Examples (Complete, Item-by-Item Calculation)

[0536] Parameters (example): sampling rate \(f_s = 1Hz\), window \(N = 12\) (12 seconds), threshold \(T = 0.5\), EWMA \(\alpha=0.4\),

[0537] Normalization reference: \(S_{max}=0.1( / s)\), \(f_{max}=0.5\) (times / s), \(\sigma_{ref}=0.2\), weights \(w_p = 0.4\), \(w_s = 0.3\), \(w_c = 0.2\), \(w_v = 0.1\), decision threshold =0.6, =0.3,

[0538] Original fog confidence (one frame per second, 12 samples):

[0539] \(x = [0.45, 0.52, 0.49, 0.55, 0.60, 0.58, 0.53, 0.48, 0.51, 0.70, 0.65, 0.60]\),

[0540] EWMA smoothing (\(\alpha = 0.4\)) gives \(s_t\),

[0541] \(s=[0.450000, 0.478000, 0.482800, 0.509680, 0.545808, 0.559485,\)

[0542] \(0.547691, 0.520615, 0.516369, 0.589821, 0.613893, 0.608336]\)

[0543] Note: After smoothing, \(s_t\) removes very short spikes but retains the trend,

[0544] Up-crossing count and crossing frequency,

[0545] Only count up-crossings from \(<T\) to \(\geq T\) in \(s\): in this example, up-crossing count \(C = 1\),

[0546] Crossing frequency \(f_{cross}=C / (N / f_s)=1 / 12\approx0.08333\) times / second,

[0547] Trend parameter,

[0548] Linear regression slope (OLS on \(s_t\)) gives: slope \(\approx0.012797\) (confidence / second, positive value indicates an increase),

[0549] Proportion above threshold \(p_{ex}==\) proportion of \(s_t\geq0.5 = 0.75\) (i.e., 9 / 12 frames are above the threshold),

[0550] Volatility \(\sigma_s\approx0.049899\),

[0551] Normalization and combination,

[0552] norm_slope_pos=slope / Smax=0.012797 / 0.1=0.12797⇒0.128 (cropped to [0,1]).

[0553] norm_cross=fcross / fmax=0.08333 / 0.5=0.16667,

[0554] norm_vol=σs / σref=0.049899 / 0.2=0.2495,

[0555] TrendScore calculation:

[0556] TrendScore=0.4×0.75+0.3×0.128+0.2×0.1667-0.1×0.2495,

[0557] Substituting the values, we get TrendScore≈0.3468;

[0558] Therefore, the conclusion is that, according to the threshold: 0.3≤TrendScore<0.6→DELAYED_CONFIRM, that is, s_t≥T (p_ex=0.75) for most of the time within the window is evidence of fog, but the slope is small and the crossing is infrequent, and fluctuations exist; therefore, the system chooses "more confirmation is needed" rather than immediately triggering an aggressive strategy for vehicle control.

[0559] In summary, the examples above combine the frequency of crossings, the proportion within the window, the slope, and the volatility into an interpretable TrendScore to determine whether it is "immediate confirmation," "delayed confirmation," or "no confirmation." In the example, TrendScore ≈ 0.347 → delayed confirmation, indicating that it is above the threshold most of the time, but the evidence is not yet sufficient to immediately trigger strong control. The system should continue to observe and take mild mitigation measures until the trend becomes clearer or is refuted.

[0560] In this embodiment, step S1, which involves acquiring image data of the vehicle during its driving process using a camera device pre-installed on the vehicle, further includes:

[0561] S11: Based on the preset installation position of the camera device on the vehicle, the image data is collected synchronously, wherein the installation position specifically includes front view, rear view, side view and surround view;

[0562] S12: Determine whether the image data is aligned;

[0563] S13: If not, then identify the frame difference information of the image data through the timestamp, and dynamically adjust the image acquisition parameters of the camera device according to the frame difference information, wherein the image acquisition parameters specifically include frame rate, resolution, exposure time and gain.

[0564] In this embodiment, the system synchronously acquires image data from different installation positions of the camera devices based on the vehicle's pre-set installation locations, specifically including front-view, rear-view, side-view, and surround-view. The system then determines whether these image data are aligned to execute corresponding steps. For example, when the system determines that the image data from different installation positions are aligned, it considers that the images acquired by each camera device are synchronized in space and time and have a consistent reference coordinate system, accurately reflecting the overall environmental information around the vehicle. The system then stitches or projects the front-view, rear-view, and side-view images according to the vehicle's coordinate system to form a surround-view or bird's-eye view covering the vehicle's surroundings, ensuring continuous and non-overlapping visual information in all directions. For instance, perspective transformation can be performed on the images using camera calibration parameters (intrinsic and extrinsic parameters) to align all images on a unified plane. Simultaneously, key visual features (such as range, variance, high-frequency texture, or edge information) are extracted from the aligned image data. Alignment ensures the consistency of features across multiple perspectives, facilitating subsequent fog detection or target recognition model processing. For example, contrast and texture gradients can be calculated separately for different sub-regions of the surround view, and then fused into a unified feature vector for prediction model input. Aligned image data can also be used for multi-module feature fusion or multi-sensor fusion, reducing perception errors caused by differences in camera position or acquisition time. For instance, if the fog confidence is high in the front view but low in the side view, alignment and fusion can determine the overall environmental visibility trend, avoiding misjudgment from a single perspective and improving the vehicle's safety decision-making ability in complex weather conditions. For example, when the system determines that image data from different installation locations cannot be aligned, the system will consider that the images acquired by each camera device are not synchronized in space and time. The system will identify the frame difference information of these image data through timestamps and dynamically adjust the image acquisition parameters of the camera device based on different frame difference information. The image acquisition parameters specifically include frame rate, resolution, exposure time, and gain.When the system determines that image data from different installation locations cannot be aligned, it indicates a time discrepancy in the acquisition by each camera. By identifying frame difference information through timestamps and dynamically adjusting the frame rate, it ensures that each camera acquires images within the same time window, thus achieving time synchronization of multi-view data. This reduces environmental perception errors caused by frame asynchrony, ensuring the continuity and integrity of information about the vehicle's surroundings. Simultaneously, by dynamically adjusting image acquisition parameters (including resolution, exposure time, and gain) based on frame difference information, the system achieves a balance in brightness, contrast, and sharpness among the cameras. This reduces image distortion or visual differences caused by inconsistent camera parameters, making multi-view images easier to align spatially. This provides a more reliable data foundation for subsequent feature extraction and fog detection. Furthermore, by dynamically adjusting acquisition parameters, the system not only corrects alignment issues in the current frame but also maintains the stability of multi-camera data under different lighting conditions, weather environments, or dynamic driving conditions. This adaptive adjustment mechanism effectively reduces the risk of misjudgment due to image asynchrony or uneven quality, improving the reliability of fog detection, target recognition, and autonomous driving strategy execution, thus ensuring driving safety.

[0565] It should be noted that the frame difference information of the image data is identified through timestamps, and the image acquisition parameters of the camera device are dynamically adjusted based on the frame difference information. Specifically, the image acquisition parameters include frame rate, resolution, exposure time, and gain.

[0566] Frame timestamp acquisition: Each frame of the image contains a system hardware timestamp t_i.

[0567] The time difference between two consecutive frames is ,

[0568] Theoretical expected value: Δ_texp = 1 / f, where f is the preset frame rate.

[0569] Frame difference information calculation,

[0570] Define time error: ,

[0571] mean deviation within the statistical window with standard deviation ,

[0572] like or A large value indicates that the frame output is out of sync with the preset value.

[0573] Dynamically adjust the acquisition parameters.

[0574] Frame Rate: If If the actual interval is greater than 0, it indicates frame drops; the target frame rate can be appropriately reduced to ensure stability. A value less than 0 indicates that the frame rate is too high; you can increase the exposure time or decrease the frame rate.

[0575] Resolution: If frame drops continue, it indicates high data bandwidth or processing pressure → dynamically reduce the resolution.

[0576] Exposure Time: In nighttime environments Larger jitter can be addressed by extending the exposure time to improve the signal-to-noise ratio, but this needs to be coordinated with the frame rate.

[0577] Gain: When exposure time cannot be extended within a short period, gain can be increased to maintain brightness.

[0578] Closed-loop feedback, after adjusting parameters, re-acquire frame sequences and monitor. If convergence is observed, and if fluctuations persist, further adjustments will be made until convergence occurs. Falling within the permitted range;

[0579] Specific examples are as follows:

[0580] Assuming the target frame rate of the camera device is set to f=30fps, and the expected interval Δ_texp=33.3ms,

[0581] Data collection timestamps, actual intervals between consecutive frames: 34.1, 33.8, 34.0, 40.5, 41.0 ms.

[0582] Calculation error,

[0583] mean =36.68ms,

[0584] deviation =36.68-33.3=3.38ms

[0585] Standard deviation ≈3.1ms

[0586] This indicates that the output frame rate is less than 30 fps (close to 27 fps) and there is noticeable jitter.

[0587] Adjust parameters,

[0588] Frame rate: Lower the target frame rate to 25 fps (expected interval 40 ms) to be closer to the actual frame rate and reduce frame drops.

[0589] Resolution: If bandwidth is insufficient, it can be adjusted from 1920×1080 to 1280×720.

[0590] Exposure time: If at night, to avoid noise, the exposure time can be increased from 10ms to 15ms.

[0591] Gain: When further exposure cannot be extended (such as when a high frame rate is required during high-speed driving), increase the gain from 2dB to 6dB to ensure brightness.

[0592] Verification results, new acquisition interval =[39.8,40.2,40.1,40.0]ms, deviation =0.2 ms, indicating that the system data acquisition has stabilized;

[0593] In summary, in the examples above, the system monitors frame differences through timestamps, which can quickly detect anomalies such as dropped frames, stuttering, or overclocked acquisition, thus avoiding unstable image input. At the same time, it dynamically adjusts the frame rate, resolution, exposure, and gain to ensure that the image meets the requirements for clarity and brightness while matching the bandwidth and real-time performance of the processing hardware. Furthermore, the closed-loop control ensures that the adjustments are not one-off but continuously optimized, enabling the vehicle to maintain stable and reliable visual input under different lighting, speed, and bandwidth conditions.

[0594] Reference Appendix Figure 2 This is an image fog detection system based on multi-module statistical feature fusion in one embodiment of the present invention, comprising:

[0595] The acquisition unit 10 is used to acquire image data of the vehicle during its driving process based on a camera device preset on the vehicle.

[0596] The judgment unit 20 is used to determine whether fog is detected in the image data;

[0597] The execution unit 30 is configured to, if so, construct a numerical matrix corresponding to the image data, extract feature parameters of the image data from the data matrix, input the feature parameters into a pre-trained prediction model, and calculate the fog confidence score of the data matrix, wherein the feature parameters specifically include range, variance, and high-frequency mean.

[0598] The second judgment unit 40 is used to determine whether the fog confidence score is higher than a preset confidence threshold;

[0599] The second execution unit 50 is used to construct the visibility band data of the vehicle in real time if the visibility is higher than the threshold, dynamically activate the vehicle's preset driving strategy based on the visibility band data, identify the prediction model's preset visibility detection standard for the vehicle, and adaptively reduce the confidence threshold of the fog confidence score based on the visibility detection standard. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

[0600] In this embodiment, the acquisition unit 10 acquires image data of the vehicle during its driving process based on a pre-installed camera device on the vehicle. Then, the judgment unit 20 determines whether fog is detected in these image data to execute corresponding steps. For example, if the system determines that no fog is detected in the image data of the vehicle during its driving process, the system considers the current driving environment to be within the normal visibility range, with no significant degradation in image clarity and contrast. The system will maintain the vehicle's current speed, distance, and autonomous driving function without imposing additional restrictions, while simultaneously marking the current environment as "fog-free" and storing the corresponding image and feature parameters for subsequent use. The model is validated or self-learned, and under the condition of no fog, the fog-free reference values ​​(such as contrast benchmark and feature mean) in the system are updated or corrected to improve the accuracy of subsequent fog detection. For example, when the system determines that fog is detected in the image data of the vehicle during driving, the execution unit 30 will consider that the current driving environment is in an abnormal visibility range, and there may be fog obstructing the field of vision. The system will construct a data matrix corresponding to the image data, extract the feature parameters of the image data from the data matrix, and the feature parameters specifically include range, variance and high frequency mean. These feature parameters are input into the pre-trained prediction model to calculate the fog in the data matrix. The system constructs a data matrix corresponding to the image data and extracts multi-dimensional statistical feature parameters (range, variance, and high-frequency mean). This allows for comprehensive capture of visual degradation phenomena caused by fog, such as reduced contrast, blurred texture, and loss of high-frequency details. Compared to methods relying on a single image metric, this approach significantly reduces the false positive rate due to environmental complexity, achieving higher accuracy in determining the presence or absence of fog. Furthermore, after the feature parameters are input into the pre-trained prediction model, the learned multi-scene, diverse data distribution patterns effectively fuse the correlation information between different features, avoiding instability caused by interference with a single feature. This mechanism... This system maintains stable performance in sunny, cloudy, and nighttime conditions, as well as various road scenarios, thereby improving the robustness and generalization ability of fog detection. Furthermore, the calculated fog confidence score enables dynamic quantitative assessment of fog levels, rather than simply a binary "fog present / no fog" judgment. This quantitative result provides reliable input for subsequent visibility assessment and vehicle driving strategies (such as deceleration, increasing following distance, or activating assisted braking), effectively reducing perception distortion and traffic safety hazards caused by fog obstruction. Then, the second judgment unit 40 determines whether the fog confidence score is higher than a preset confidence threshold to execute the corresponding steps.For example, when the system determines that the fog confidence score is not higher than a preset confidence threshold, the system will consider that the fog features in the current image data are not significant, the driving environment of the vehicle is still within the normal visibility range, and the fog level is insufficient to have a substantial impact on driving safety. The system will not trigger defogging processing or additional safety intervention, and the vehicle will maintain normal speed, following distance, and path planning. At the same time, the system will mark this state as a "low fog / no fog" scenario, store the corresponding image and feature parameters to enrich the training dataset, provide sample support for subsequent model optimization, and update the no-fog baseline feature value when the judgment result is consistently lower than the threshold multiple times, so as to adapt to the scene characteristics under different lighting and weather conditions, thereby improving the accuracy of subsequent detection. For example, when the system determines that the fog confidence score is higher than a preset confidence threshold, the second execution unit 50 will consider that the fog features in the current image data are significant, and the driving environment of the vehicle is affected by fog. The system will construct the vehicle's visibility band data in real time and dynamically activate the vehicle based on different visibility band data. The system employs pre-set driving strategies, including automatic speed reduction, increased following distance, and emergency braking. It identifies and predicts a pre-defined visibility detection standard for the vehicle, adaptively lowering the confidence threshold of the fog confidence score based on this standard. By constructing real-time visibility band data, the system quantifies environmental visibility, avoiding safety hazards caused by delayed detection or misjudgment, ensuring timely vehicle response. Simultaneously, based on the visibility band, it dynamically activates the vehicle's pre-set driving strategies, such as automatic speed reduction, increased following distance, and emergency braking. This mechanism allows the vehicle to proactively adjust its operating state to adapt to the reduced visibility risks brought about by severe weather, significantly reducing the probability of rear-end collisions and other traffic accidents. Furthermore, by combining the visibility detection standard of the predictive model, the system can dynamically adjust the confidence threshold, maintaining flexibility and accuracy under different road, lighting, and weather conditions. Adaptive threshold lowering avoids false positives or false negatives caused by fixed thresholds, improving the system's robustness and stability in changing environments.

[0601] In this embodiment, the execution unit further includes:

[0602] A generation subunit is used to generate data matrices of different dimensions based on the preset module types of the vehicle. Specifically, the module types include a contrast module, a color feature module, and an edge sharpness module, and the data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix.

[0603] The judgment subunit is used to determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis and skewness;

[0604] An execution subunit is used to identify all values ​​of the matrix in the data matrix if no, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module. The backup module specifically includes dark channel and edge gradient.

[0605] In this embodiment, the system generates data matrices of different dimensions based on pre-defined module types in the vehicle, specifically including a contrast module, a color feature module, and an edge sharpness module. These data matrices include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix. The system then determines whether the data matrix can extract pre-defined statistical features, specifically entropy, kurtosis, and skewness, and executes corresponding steps accordingly. For example, if the system determines that the data matrix can extract pre-defined statistical features, it considers the current image data to have sufficient distribution information and numerical fluctuation characteristics to fully reflect the degradation effect of fog on image brightness, color, and edge texture. The system then calculates the entropy from the data matrices of different dimensions. (Measures of information content and randomness), kurtosis (measures the sharpness of the distribution), and skewness (measures the skewness of the distribution) ensure that the features of each module can accurately represent the differences in the image under the influence of fog. Simultaneously, the feature vectors obtained from the contrast module, color feature module, and edge sharpness module are concatenated or weighted and fused to generate a comprehensive feature parameter set. For example, a unified vector containing entropy_brightness, entropy_color, entropy_gradient, kurtosis_brightness, etc., can be obtained. The fused statistical features are then passed as input to a pre-trained fog detection prediction model. The model calculates and outputs a fog confidence score, which serves as an important basis for determining whether fog exists in the image. For example, if the system determines that the data matrix cannot extract the pre-defined statistical features, the system will consider the current image... The data cannot reflect the degradation effect of fog on image brightness, color, and edge texture. The system identifies all values ​​in the data matrix. Based on the consistency of all values, the corresponding image region is marked as an invalid region. Invalid modules corresponding to these invalid regions are detected, and pre-set backup modules are dynamically activated. These backup modules include dark channels and edge gradients. Feature fusion and confidence weighting of the data matrix are performed using these backup modules to reduce the impact of invalid module failures. By identifying and marking invalid regions with consistent matrix values, the system avoids interrupting the entire detection chain due to the failure of a single module. This ensures the system can continuously output detection results even in complex environments, improving the stability of the detection process. By dynamically activating vehicle-preset backup modules (such as dark channels and edge gradients), the system can supplement image analysis using alternative features sensitive to fog when regular modules fail. Dark channels can effectively capture the impact of fog on image brightness distribution, while edge gradients can reflect details that are blurred. These backup features provide new dimensions for detection, thereby improving the algorithm's adaptability to diverse weather conditions. Furthermore, after the backup modules are activated, the system reasonably reduces the weight of invalid modules in the overall judgment through feature fusion and confidence weighting, avoiding the misleading effect of failed features on the results. This mechanism ensures that the final calculated fog confidence score is closer to the real environmental state, thereby improving detection accuracy and reducing the risk of misjudgment or missed detection due to feature loss.

[0606] In this embodiment, it also includes:

[0607] The combination unit is used to acquire continuous video frames of the driving time window based on the vehicle's preset driving time window, construct corresponding current frames and neighboring frames from the continuous video frames, and combine the current frames and neighboring frames to obtain a sequence of frames to be analyzed.

[0608] The third judgment unit is used to determine whether the frame sequence to be analyzed has detected sequence missingness;

[0609] The third execution unit is used to, if not, concatenate the frame sequence to be analyzed in chronological order according to the driving time window to obtain the corresponding extended feature vector, and generate cross-time dynamic evolution information of the frame sequence to be analyzed through the extended feature vector, wherein the extended feature vector specifically includes instantaneous features, statistical features and dynamic features.

[0610] In this embodiment, the system acquires continuous video frames within a pre-set driving time window for the vehicle. It constructs the current frame and neighboring frames from these continuous video frames, combines them to obtain a sequence of frames to be analyzed, and then determines whether the sequence contains missing frames to execute corresponding steps. For example, if the system determines that the sequence contains missing frames, it considers that the lack of complete image input at certain times will affect the extraction of temporal features within the time window, thereby reducing the stability and reliability of fog detection results and failing to guarantee that the current frame and neighboring frames accurately reflect the dynamic changes in the environment. Therefore, the system uses an interpolation algorithm to generate missing frames in the time dimension to ensure the duration of the input sequence. To maintain sequence integrity, the system may repeat the previous frame, while reducing reliance on temporal features and increasing the weight of single-frame spatial features (brightness, color, edges, etc.). Backup modules (such as dark channel analysis) should be enabled to prevent model failure due to missing frames. If a fault is identified in the perception link, safe driving strategies should be triggered: reducing vehicle speed, increasing following distance, or even prompting the driver for manual intervention. For example, if the system determines that no missing frames are detected in the analyzed frame sequence, it assumes that the current frame and neighboring frames accurately reflect the dynamic changes in the environment. The system will then concatenate the analyzed frame sequence according to the driving time window to obtain the corresponding extended feature vector. The extended feature vector specifically includes instantaneous features and statistical features. By combining dynamic features with extended feature vectors, the system generates cross-time-period dynamic evolution information of the frame sequence to be analyzed. When the system determines that there are no missing frames in the frame sequence, it indicates that the video acquisition link is stable and the temporal relationship between frames is complete. This ensures that the current frame and its neighboring frames can accurately reflect the dynamic changes in the environment, such as the gradual intensification or dissipation of fog, the movement trajectory of vehicles ahead, etc. Through this continuity, the system can avoid environmental misjudgments caused by temporal interruptions, improving the authenticity and completeness of the overall perception data. At the same time, by splicing the frame sequence to be analyzed in chronological order within the time window, the resulting extended feature vector not only includes the instantaneous features of a single frame (such as brightness difference and edge sharpness) but also covers statistical features (such as multi-frame averages). The introduction of multi-dimensional features (such as variance trends and dynamic features such as temporal change rates and visibility evolution curves) can effectively weaken the impact of random anomalies in a single frame, making fog detection more stable, thereby reducing missed or false detections and improving the accuracy of confidence scores. Furthermore, by calculating the extended feature vector, the system can obtain dynamic evolution information across time periods, such as whether fog concentration continues to rise or whether environmental visibility fluctuates and weakens. This type of trend information provides advance notice for vehicle driving strategies, enabling the system not only to react to the current state but also to predict environmental changes in a short period of time. As a result, the vehicle can slow down in advance before fog worsens and gradually remove restrictions when visibility recovers, thereby achieving smoother and more intelligent safe driving control.

[0611] In this embodiment, the second execution unit further includes:

[0612] A generation subunit is used to classify the visibility band data into levels based on a preset unit value of the visibility band data, and generate corresponding visibility band levels, wherein the visibility band levels specifically include high visibility band, medium visibility band, low visibility band and very low visibility band.

[0613] The second judgment subunit is used to determine whether the visibility band level detects continuous temporal fluctuations.

[0614] The second execution subunit is used to store continuous time fluctuations into a preset cache queue if the condition is met, select a preset number of visibility values ​​in the cache queue, detect the differences between adjacent frames of the visibility values, classify the visibility values ​​as outliers based on the differences between adjacent frames, filter and correct the outliers, and dynamically correct the band results of the visibility band data.

[0615] In this embodiment, the system classifies the visibility band data into levels based on pre-set unit values, generating corresponding visibility band levels. These levels specifically include high visibility bands, medium visibility bands, low visibility bands, and extremely low visibility bands. The system then determines whether these visibility band levels detect continuous time fluctuations, and executes corresponding steps accordingly. For example, if the system determines that no continuous time fluctuations are detected in the visibility band levels, it considers the time fluctuations within the selected time window (e.g., the most recent N...) to be within the selected time window. If the visibility band level remains stable (within the last frame or the most recent T seconds) without a continuous upward or downward trend, the system will immediately maintain the current visibility band level and corresponding driving strategy (e.g., if in the medium visibility band, maintain the corresponding speed reduction / distance strategy). If a degraded safety strategy (such as temporary deceleration) was previously in effect, it will not be lifted until the continuous stability condition is met before rolling back. Simultaneously, a sliding short-term voting judgment is performed on the visibility band sequence to confirm stability. If stable and it is determined that high-frequency detection is unnecessary, the sampling frequency of fog detection can be reduced to save computational resources (e.g., from 10 Hz to 2 Hz). (Hz), but key thresholds must be monitored; for example, when the system detects continuous time fluctuations in the visibility band level, it considers the visibility band level unstable within the currently selected time window. The system stores the continuous time fluctuations in a pre-set buffer queue, selects a pre-set number of visibility values ​​from the buffer queue, detects the differences between adjacent frames of these visibility values, classifies the visibility values ​​as outliers, filters and corrects these outliers, and dynamically corrects the band results of the visibility band data; when the visibility band level detects continuous time fluctuations, the system does not immediately trigger a driving strategy switch, but first stores these fluctuations in the buffer queue, and then identifies whether there are outliers through adjacent frame difference analysis. This mechanism effectively avoids erroneous judgments caused by interference from individual frames such as sudden changes in illumination, camera noise, or instantaneous obstruction, thereby ensuring visibility. By ensuring the smoothness and continuity of the judgment results, and through the detection of differences between adjacent frames in the cache queue, the system can locate abnormal visibility values ​​that do not conform to the overall trend within a short period of time. Filtering and correcting these abnormal values ​​is equivalent to performing "denoising" and "correction" at the time-series data level, making the final visibility band results closer to the real environment. This improves the system's ability to represent actual fog conditions. Furthermore, based on the dynamic correction of visibility band results, the system's output band level is more stable and reliable, avoiding unnecessary operations caused by frequent and erroneous switching of driving strategies. For example, if fluctuating visibility values ​​are used directly without filtering, the vehicle may repeatedly trigger "deceleration / recovery" actions, causing safety hazards or passenger discomfort. By caching, detecting, and correcting the band results, the system can ensure that the triggering conditions of driving strategies are based on a robust data foundation, thereby improving overall driving safety.

[0616] In this embodiment, the determination unit further includes:

[0617] The identification subunit is used to identify the distribution characteristics of pixel values ​​from the image grayscale histogram based on the image data;

[0618] The third judgment subunit is used to determine whether the distribution characteristics are concentrated and the dynamic range is narrowed.

[0619] The third execution subunit is configured to, if so, perform edge detection on the image grayscale histogram, calculate the number of edges of the pixel value, identify the dynamic changes of the pixel value, divide the image grayscale histogram into a preset number of sub-block regions according to the dynamic changes, collect the contrast of the sub-block regions respectively, and generate statistical results of the contrast decrease.

[0620] In this embodiment, the system identifies the distribution characteristics of pixel values ​​based on the image grayscale histogram of the image data. The system then determines whether these distribution characteristics are concentrated and whether the dynamic range is reduced, in order to execute corresponding steps. For example, if the system determines that the pixel value distribution characteristics are concentrated but the dynamic range is not reduced, the system will consider that the scene has localized lighting dominance or uneven texture feature distribution. The system will mark this state in the feature determination logic to avoid misjudging it as fog. Combined with scene classification (e.g., indoor / outdoor, day / night) or vehicle positioning data, the current lighting environment is confirmed. In addition to the grayscale histogram, color histograms, edge sharpness distribution, or dark channel priors can also be referenced to further determine whether there are signs of fog. If there is still doubt, a time window can be introduced to observe whether the "concentrated distribution but wide dynamic range" feature continues to appear in subsequent frames. If it continues and the dynamic range does not shrink, it is confirmed that it is not fog, avoiding erroneous triggering of defogging processing or driving strategy switching. For example, if the system determines that the pixel value distribution characteristics are not concentrated, the system will consider that the image still has fog. However, since there is sufficient contrast and detail, the overall visual information is not "concentrated and compressed" due to fog or similar degradation effects. The system will mark the fog detection of the image as a negative result to avoid triggering unnecessary defogging or safety strategies. At the same time, the image can be directly input into subsequent conventional visual processing modules (such as object detection and lane line recognition) without additional preprocessing. In order to improve robustness, the system can combine consecutive frames to compare whether multiple consecutive frames show "dispersion" results to confirm that the environment is continuously clear. For example, when the system determines that the distribution characteristics of pixel values ​​are concentrated and the dynamic range is narrowed, the system will consider that most pixel values ​​fall within a narrow gray range and the image lacks brightness differences. It will infer that the current environment may have fog, haze, or optical interference (such as glass condensation or lens blur). The system will perform edge detection on the image gray histogram, calculate the number of edges of pixel values, identify the dynamic changes of these pixel values, divide the image gray histogram into a pre-set number of sub-block regions according to the dynamic changes, collect the contrast of these sub-block regions, and generate statistical results of contrast decrease.By identifying the concentrated distribution and dynamic range reduction of the image's grayscale histogram, the system can promptly detect low-visibility scenes such as fog, haze, or blurred images. Further combining edge detection and pixel dynamic change analysis, it can effectively eliminate interference caused by simple brightness changes or shadows, thus avoiding misjudgments. This multi-level judgment mechanism ensures the sensitivity and accuracy of vehicles in complex environments to fog and haze features, improving detection reliability. Simultaneously, dividing the grayscale histogram into a predetermined number of sub-blocks and calculating the contrast of each region reveals the degradation differences in different image areas under fog or interference; for example, the contrast of distant road areas decreases significantly, while that of nearby vehicles... Maintaining high contrast values ​​in areas with good visibility or road signs helps the system distinguish between "overall visibility reduction" and "local blurring interference," providing more refined data support for subsequent driving strategies. Furthermore, by statistically analyzing the overall contrast reduction in sub-block areas, the system can not only determine whether the image is affected by fog or haze at the current moment, but also quantify the degree and extent of the reduction. This result can be directly mapped to the vehicle's visibility level assessment, providing a scientific basis for dynamically activating driving strategies (such as reducing speed and increasing following distance). Continuous contrast reduction statistics can also serve as time-series features, supporting the prediction of fog intensification trends.

[0621] In this embodiment, the second determination unit further includes:

[0622] The second identification subunit is used to identify the target application scenario of the fog confidence score based on the fog-free image dataset pre-collected by the prediction model, wherein the fog-free image dataset specifically includes highways, urban roads, rural roads, parking lots, and tunnel entrances;

[0623] The fourth judgment subunit is used to determine whether the target application scenario matches the preset lighting conditions, wherein the lighting conditions specifically include sunny days, cloudy days, and nighttime.

[0624] The fourth execution subunit is used to, if so, collect the threshold crossing frequency of the fog confidence score, identify the trend parameter of the fog confidence score based on the threshold crossing frequency, and output the confidence detection result of the fog confidence score with a delay based on the trend parameter.

[0625] In this embodiment, the system identifies target application scenarios with fog confidence scores based on a pre-collected fog-free image dataset, specifically including highways, urban roads, rural roads, parking lots, and tunnel entrances. The system then determines whether these target application scenarios match pre-defined lighting conditions, specifically sunny days, cloudy days, and nighttime, and executes corresponding steps accordingly. For example, if the system determines that a target application scenario with a fog confidence score does not match the pre-defined lighting conditions, the system considers it potentially "out of the domain" for that lighting / scene combination, reducing the reliability of the model output (including fog confidence score) and increasing the likelihood of false negatives or false positives. The system will then, without reliable visual confirmation, temporarily... A conservative strategy is adopted, slightly reducing the cruising speed (e.g., slowing down by 5%–15%), moderately increasing the safe following time (+20%), and limiting automatic lane changing / overtaking. Simultaneously, a driver prompt is sent: "Abnormal visual conditions, please pay attention to road conditions / take over." The system also records the original image, model output, lighting matching confidence score, sensor readings, and GPS road segment information at that moment for subsequent offline annotation and model retraining. For example, when the system determines that the target application scenario of the fog confidence score matches the pre-set lighting conditions, the system considers the model output (including fog confidence score) to be reliable under that lighting / scene combination. The system collects the threshold crossing frequency of the fog confidence score and, based on different threshold crossing frequencies,... The system identifies trend parameters of the fog confidence score and, based on these parameters, delays the output of the fog confidence score detection result. When the system confirms that the target application scenario matches the lighting conditions, it indicates that the current environment is consistent with the distribution during model training. At this point, the fog confidence score output by the model has high reliability. Furthermore, the system collects the threshold crossing frequency of the fog confidence score and identifies the trend parameters of the fog confidence score based on the crossing frequency. This avoids erroneous judgments caused by instantaneous noise or short-term fluctuations, thus ensuring that the fog detection results are more stable and more consistent with the actual driving environment. Simultaneously, through the extraction of trend parameters, the system no longer relies solely on a single value at a single frame or time point, but rather on the changing characteristics across time periods. This trend-based analysis method effectively distinguishes between "short-term interference signals" (such as abnormal headlights, shadows, and instantaneous exposure) and "real fog deterioration," significantly reducing false alarms and alerts. This ensures that the vehicle's autonomous driving strategy is triggered only when truly needed, improving driving safety and comfort. Furthermore, the system uses a delayed output mechanism based on trend parameters, rather than immediately outputting detection results. This means that the fog confidence detection status is only updated when the trend characteristics are fully confirmed. This delayed mechanism effectively avoids frequent strategy switching caused by single threshold crossings, ensuring the stability of the vehicle in fog detection and driving control, and improving the overall system's adaptability to complex traffic environments and variable weather conditions.

[0626] In this embodiment, the acquisition unit further includes:

[0627] The acquisition subunit is used to synchronously acquire the image data based on the preset installation position of the camera device on the vehicle, wherein the installation position specifically includes front view, rear view, side view and surround view;

[0628] The fifth judgment subunit is used to determine whether the image data is aligned;

[0629] The fifth execution subunit is used to identify the frame difference information of the image data by timestamp if no, and dynamically adjust the image acquisition parameters of the camera device according to the frame difference information, wherein the image acquisition parameters specifically include frame rate, resolution, exposure time and gain.

[0630] In this embodiment, the system synchronously acquires image data from different installation positions of the camera devices based on the vehicle's pre-set installation locations, specifically including front-view, rear-view, side-view, and surround-view. The system then determines whether these image data are aligned to execute corresponding steps. For example, when the system determines that the image data from different installation positions are aligned, it considers that the images acquired by each camera device are synchronized in space and time and have a consistent reference coordinate system, accurately reflecting the overall environmental information around the vehicle. The system then stitches or projects the front-view, rear-view, and side-view images according to the vehicle's coordinate system to form a surround-view or bird's-eye view covering the vehicle's surroundings, ensuring continuous and non-overlapping visual information in all directions. For instance, perspective transformation can be performed on the images using camera calibration parameters (intrinsic and extrinsic parameters) to align all images on a unified plane. Simultaneously, key visual features (such as range, variance, high-frequency texture, or edge information) are extracted from the aligned image data. Alignment ensures the consistency of features across multiple perspectives, facilitating subsequent fog detection or target recognition model processing. For example, contrast and texture gradients can be calculated separately for different sub-regions of the surround view, and then fused into a unified feature vector for prediction model input. Aligned image data can also be used for multi-module feature fusion or multi-sensor fusion, reducing perception errors caused by differences in camera position or acquisition time. For instance, if the fog confidence is high in the front view but low in the side view, alignment and fusion can determine the overall environmental visibility trend, avoiding misjudgment from a single perspective and improving the vehicle's safety decision-making ability in complex weather conditions. For example, when the system determines that image data from different installation locations cannot be aligned, the system will consider that the images acquired by each camera device are not synchronized in space and time. The system will identify the frame difference information of these image data through timestamps and dynamically adjust the image acquisition parameters of the camera device based on different frame difference information. The image acquisition parameters specifically include frame rate, resolution, exposure time, and gain.When the system determines that image data from different installation locations cannot be aligned, it indicates a time discrepancy in the acquisition by each camera. By identifying frame difference information through timestamps and dynamically adjusting the frame rate, it ensures that each camera acquires images within the same time window, thus achieving time synchronization of multi-view data. This reduces environmental perception errors caused by frame asynchrony, ensuring the continuity and integrity of information about the vehicle's surroundings. Simultaneously, by dynamically adjusting image acquisition parameters (including resolution, exposure time, and gain) based on frame difference information, the system achieves a balance in brightness, contrast, and sharpness among the cameras. This reduces image distortion or visual differences caused by inconsistent camera parameters, making multi-view images easier to align spatially. This provides a more reliable data foundation for subsequent feature extraction and fog detection. Furthermore, by dynamically adjusting acquisition parameters, the system not only corrects alignment issues in the current frame but also maintains the stability of multi-camera data under different lighting conditions, weather environments, or dynamic driving conditions. This adaptive adjustment mechanism effectively reduces the risk of misjudgment due to image asynchrony or uneven quality, improving the reliability of fog detection, target recognition, and autonomous driving strategy execution, thus ensuring driving safety.

[0631] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for detecting image fog based on multi-module statistical feature fusion, characterized in that, Includes the following steps: Based on the camera device pre-installed on the vehicle, image data of the vehicle during its driving process is collected; Determine whether fog is detected in the image data; If so, a data matrix corresponding to the image data is constructed, feature parameters of the image data are extracted from the data matrix, the feature parameters are input into a pre-trained prediction model, and the fog confidence score of the data matrix is ​​calculated. The feature parameters specifically include range, variance, and high-frequency mean. Determine whether the fog confidence score is higher than a preset confidence threshold; If the visibility is higher, the visibility band data of the vehicle is constructed in real time. Based on the visibility band data, the vehicle's preset driving strategy is dynamically activated. The visibility detection standard of the vehicle preset by the prediction model is identified. Based on the visibility detection standard, the confidence threshold of the fog confidence score is adaptively reduced. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

2. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, The step of constructing a data matrix corresponding to the image data and extracting feature parameters of the image data from the data matrix further includes: Based on the preset module types of the vehicle, data matrices of different dimensions are generated. Specifically, the module types include a contrast module, a color feature module, and an edge sharpness module. The data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix. Determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis, and skewness; If not, then identify all values ​​of the matrix in the data matrix, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module, wherein the backup module specifically includes dark channel and edge gradient.

3. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, Before the step of inputting the feature parameters into the pre-trained prediction model and calculating the fog confidence score of the data matrix, the method further includes: Based on the vehicle's preset driving time window, continuous video frames of the driving time window are collected, and corresponding current frames and neighboring frames are constructed from the continuous video frames. The current frames and neighboring frames are combined to obtain the frame sequence to be analyzed. Determine whether a sequence of missing data is detected in the frame sequence to be analyzed; If not, the frame sequence to be analyzed is spliced ​​together in chronological order according to the driving time window to obtain the corresponding extended feature vector. Through the extended feature vector, the cross-time dynamic evolution information of the frame sequence to be analyzed is generated. The extended feature vector specifically includes instantaneous features, statistical features and dynamic features.

4. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, The step of constructing the vehicle's visibility band data in real time and dynamically activating the vehicle's preset driving strategy based on the visibility band data further includes: Based on the preset unit value of the visibility band data, the visibility band data is divided into levels to generate corresponding visibility band levels. Specifically, the visibility band levels include high visibility band, medium visibility band, low visibility band and very low visibility band. Determine whether continuous temporal fluctuations are detected in the visibility band level; If so, the continuous time fluctuations are stored in a preset cache queue. A preset number of visibility values ​​are selected from the cache queue. The differences between adjacent frames of the visibility values ​​are detected. Based on the differences between adjacent frames, the visibility values ​​are classified as outliers. The outliers are filtered and corrected to dynamically correct the band results of the visibility band data.

5. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, The step of determining whether fog is detected in the image data further includes: Based on the image grayscale histogram of the image data, the distribution characteristics of pixel values ​​are identified from the image grayscale histogram; Determine whether the distribution characteristics are concentrated and whether the dynamic range is narrowing; If so, edge detection is performed on the image grayscale histogram, the number of edges of the pixel value is calculated, the dynamic changes of the pixel value are identified, and the image grayscale histogram is divided into a preset number of sub-block regions according to the dynamic changes. The contrast of each sub-block region is collected, and the statistical results of the contrast decrease are generated.

6. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, The step of determining whether the fog confidence score is higher than a preset confidence threshold further includes: Based on the fog-free image dataset pre-collected by the prediction model, the target application scenarios of the fog confidence score are identified, wherein the fog-free image dataset specifically includes highways, urban roads, rural roads, parking lots, and tunnel entrances; Determine whether the target application scenario matches the preset lighting conditions, wherein the lighting conditions specifically include sunny days, cloudy days, and nighttime; If so, the threshold crossing frequency of the fog confidence score is collected, and the trend parameter of the fog confidence score is identified based on the threshold crossing frequency. Based on the trend parameter, the confidence detection result of the fog confidence score is output with a delay.

7. The image fog detection method based on multi-module statistical feature fusion according to claim 1, characterized in that, The step of acquiring image data of the vehicle during its driving process based on a pre-installed camera device on the vehicle further includes: Based on the vehicle's preset installation position for the camera device, the image data is collected synchronously, wherein the installation position specifically includes front view, rear view, side view, and surround view. Determine whether the image data is aligned; If not, the frame difference information of the image data is identified by the timestamp, and the image acquisition parameters of the camera device are dynamically adjusted according to the frame difference information. The image acquisition parameters specifically include frame rate, resolution, exposure time and gain.

8. An image fog detection system based on multi-module statistical feature fusion, characterized in that, include: The acquisition unit is used to acquire image data of the vehicle during its driving process based on a camera device pre-installed on the vehicle. The judgment unit is used to determine whether fog is detected in the image data; An execution unit is configured to, if so, construct a data matrix corresponding to the image data, extract feature parameters of the image data from the data matrix, input the feature parameters into a pre-trained prediction model, and calculate the fog confidence score of the data matrix, wherein the feature parameters specifically include range, variance, and high-frequency mean. The second judgment unit is used to determine whether the fog confidence score is higher than a preset confidence threshold; The second execution unit is used to construct the visibility band data of the vehicle in real time if the visibility is higher than the threshold, dynamically activate the vehicle's preset driving strategy based on the visibility band data, identify the prediction model's preset visibility detection standard for the vehicle, and adaptively reduce the confidence threshold of the fog confidence score based on the visibility detection standard. The driving strategy specifically includes automatically reducing vehicle speed, increasing following distance, and activating emergency braking.

9. The image fog detection system based on multi-module statistical feature fusion according to claim 8, characterized in that, The execution unit also includes: A generation subunit is used to generate data matrices of different dimensions based on the preset module types of the vehicle. Specifically, the module types include a contrast module, a color feature module, and an edge sharpness module, and the data matrices specifically include a brightness distribution matrix, a color histogram matrix, and a gradient energy matrix. The judgment subunit is used to determine whether the data matrix can extract preset statistical features, wherein the statistical features specifically include entropy, kurtosis and skewness; An execution subunit is used to identify all values ​​of the matrix in the data matrix if no, mark the region image corresponding to the data matrix as an invalid region based on the same result of all values ​​of the matrix, detect the invalid module corresponding to the invalid region, dynamically activate the vehicle's preset backup module, and perform feature fusion and confidence weighting on the data matrix through the backup module. The backup module specifically includes dark channel and edge gradient.

10. The image fog detection system based on multi-module statistical feature fusion according to claim 8, characterized in that, Also includes: The combination unit is used to acquire continuous video frames of the driving time window based on the vehicle's preset driving time window, construct corresponding current frames and neighboring frames from the continuous video frames, and combine the current frames and neighboring frames to obtain a sequence of frames to be analyzed. The third judgment unit is used to determine whether the frame sequence to be analyzed has detected sequence missingness; The third execution unit is used to, if not, concatenate the frame sequence to be analyzed in chronological order according to the driving time window to obtain the corresponding extended feature vector, and generate cross-time dynamic evolution information of the frame sequence to be analyzed through the extended feature vector, wherein the extended feature vector specifically includes instantaneous features, statistical features and dynamic features.