Method, device and storage medium for simulating fog environment

By conducting multi-dimensional comparative analysis of simulated fog environment images and real fog environment images, and dynamically adjusting fog-making parameters in a closed loop, the problem of difficulty in determining the realism of fog environment simulation was solved, achieving high-fidelity fog environment simulation and improving the reliability and efficiency of the simulation.

CN122175842APending Publication Date: 2026-06-09ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG GEELY HLDG GRP CO LTD
Filing Date
2026-05-13
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing fog environment simulation methods only test real fog or simulated fog separately, and cannot determine whether the realism of the simulated fog meets the standard, which affects the reliability of fog environment simulation.

Method used

By acquiring and comparing simulated fog environment images with real fog environment images in multiple dimensions, the target visibility level of the simulated fog environment image is determined, and the fog-making parameters are adjusted according to the first degree of realism to achieve dynamic closed-loop adjustment of the fog-making parameters, thereby generating a simulated fog environment that meets a specific visibility level and has high realism.

Benefits of technology

It improves the controllability and realism of fog environment simulation, ensuring that the simulation results are closer to the physical characteristics and visual performance of actual foggy scenes, and provides reliable technical support for testing fog-related equipment and conducting scenario drills.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175842A_ABST
    Figure CN122175842A_ABST
Patent Text Reader

Abstract

This invention relates to the field of vehicle technology and discloses a method, apparatus, and storage medium for simulating fog environments. The fog environment simulation method includes: acquiring a simulated fog environment image of the original simulated fog environment output by a fog-generating device; analyzing the similarity between the simulated fog environment image and real fog environment images at different visibility levels to determine the target visibility level closest to the simulated fog environment image; acquiring a first degree of realism of the simulated fog environment image relative to the target visibility level; and adjusting the fog-generating parameters of the original simulated fog environment based on the first degree of realism to obtain a target simulated fog environment at the target visibility level. This invention can accurately determine whether the realism of the simulated fog meets the standard, thus improving the reliability of fog environment simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and more specifically to a method, apparatus, and storage medium for simulating fog environments. Background Technology

[0002] With the rapid development of autonomous driving and intelligent assisted driving technologies, it is necessary to test the performance of machine vision-related applications under adverse weather conditions such as fog to ensure driving safety. However, the testing of fog environments in related technologies usually only tests indicators under real fog or simulated fog, which makes it impossible to determine whether the realism of the simulated fog meets the standards, thus affecting the reliability of fog environment simulation. Summary of the Invention

[0003] This invention provides a method, apparatus, and storage medium for simulating fog environments, in order to solve the problem that in related technologies, fog environment testing usually only tests indicators under real fog or simulated fog, which makes it impossible to determine whether the realism of the simulated fog meets the standards, thus affecting the reliability of fog environment simulation.

[0004] In a first aspect, the present invention provides a method for simulating a fog environment, comprising: acquiring a simulated fog environment image of the original simulated fog environment output by a fog-making device; analyzing the similarity between the simulated fog environment image and real fog environment images of different visibility levels, and determining the target visibility level closest to the simulated fog environment image; acquiring a first realism of the simulated fog environment image relative to the target visibility level; and adjusting the fog-making parameters of the original simulated fog environment according to the first realism to obtain a target simulated fog environment at the target visibility level.

[0005] The fog environment simulation method provided in this invention achieves dynamic closed-loop adjustment of fog-making parameters by comparing and analyzing the original simulated fog environment image with the real fog environment image from multiple dimensions, combined with accurate matching and realism evaluation of visibility level. By quickly generating a simulated fog environment that meets specific visibility levels and has high realism according to target requirements, it provides reliable technical support for applications such as equipment testing and scenario drills related to fog days, significantly improves the controllability and realism of the simulated fog environment, and ensures that the simulation results are closer to the physical characteristics and visual performance of actual fog scenes.

[0006] In one optional implementation, analyzing the similarity between simulated fog environment images and real fog environment images at different visibility levels, and determining the target visibility level closest to the simulated fog environment image, includes: acquiring first image features reflecting the degree of fog degradation in real fog environment images at different visibility levels, and second image features reflecting the degree of fog degradation in simulated fog environment images; calculating the similarity between the second image features and each first image feature; taking the real fog environment image corresponding to the first image feature with the highest similarity to the second image feature as the target real fog environment image, and taking the visibility level corresponding to the target real fog environment image as the target visibility level.

[0007] The fog environment simulation method provided in this invention can efficiently and accurately determine the target visibility level corresponding to the simulated fog environment image by extracting image features reflecting the degree of fog degradation and performing similarity matching. This ensures a high degree of consistency between the simulated fog environment and the real fog environment in terms of visual features and visibility performance, thereby improving the realism and reliability of fog environment simulation. In addition, through quantitative feature analysis and similarity calculation, the error of subjective judgment is avoided, making the simulation results more objective and repeatable.

[0008] In one optional implementation, acquiring first image features reflecting the degree of fog degradation in real fog environment images at different visibility levels, and second image features reflecting the degree of fog degradation in simulated fog environment images, includes: analyzing first pixel gradient statistical features, first local grayscale statistical features, and fog intensity in real fog environment images and simulated fog environment images to obtain image quality data; wherein, fog intensity is used to characterize the difference in contrast between foggy scene images and fog-free scene images, and image contrast is used to characterize the difference in brightness or grayscale between different regions in the image; performing target detection based on real fog environment images and simulated fog environment images, determining the false negative rate and classification confidence, and obtaining target detection data; and using the image quality data and target detection data respectively, determining the first image features in real fog environment images and the second image features in simulated fog environment images.

[0009] The fog environment simulation method provided in this invention compares the differences in image features between real fog environments and simulated fog environments, and adjusts the simulation parameters so that the generated simulated fog environment images are highly consistent with real fog environments in terms of fog distribution, degree of detail degradation, and impact on target recognition. This provides a more realistic and reliable test scenario for visual perception in foggy weather, such as autonomous driving and security monitoring.

[0010] In one optional implementation, obtaining a first degree of realism of a simulated fog environment image relative to a target visibility level includes: taking the absolute values ​​of the similarities between the simulated fog environment image and real fog environment images at different visibility levels, and summing them to obtain a similarity sum value; and calculating the first degree of realism based on the similarity sum value and the number of visibility levels.

[0011] The fog environment simulation method provided in this invention provides objective data for adjusting simulation parameters such as fog concentration, fog particle diameter, and fog spatial distribution uniformity by quantifying the matching degree between the simulated fog environment image and the real fog environment, thereby effectively improving the realism and reliability of the fog environment simulation. By converting subjective visual similarity into calculable numerical indicators, the subjective bias of manual evaluation is avoided, ensuring the consistency and scientific nature of the evaluation results. In addition, combined with the feedback of the first degree of realism, the fog environment simulation can be further optimized so that the generated fog environment image is more in line with the characteristics of real fog scenes under different visibility levels.

[0012] In one optional implementation, adjusting the fog-making parameters of the original simulated fog environment based on a first degree of realism to obtain a target simulated fog environment at the target visibility level includes: comparing the first degree of realism with a preset threshold, wherein the preset threshold represents the minimum degree of realism required for the simulated fog environment to meet the corresponding target fog environment standard relative to the target visibility level; if the first degree of realism is less than the preset threshold, determining the adjustment direction and adjustment range of the fog-making parameters based on the difference between the first degree of realism and the preset threshold; and adjusting the fog-making parameters according to the adjustment direction and adjustment range to obtain a target simulated fog environment at the target visibility level.

[0013] The fog environment simulation method provided in this invention dynamically adjusts the fog-generating parameters based on the comparison results of a first realism level and a preset threshold, enabling precise iteration of the fog environment simulation process and gradually narrowing the gap between the simulation effect and the real fog scene. Through a closed-loop adjustment mechanism based on realism feedback, it not only improves the efficiency of fog environment simulation and reduces the cost of blind trial and error, but also makes the final generated target simulated fog environment more in line with the physical laws of the real fog environment in terms of visual performance and visibility characteristics, meeting the needs of autonomous driving testing, meteorological simulation experiments and other scenarios for high-realism fog environments.

[0014] In one optional implementation, the fog-making parameters are adjusted according to the adjustment direction and adjustment range to obtain a target simulated fog environment at the target visibility level. This includes: determining the adjustment amount for the fog-making parameters based on the adjustment direction and adjustment range; adjusting the fog-making parameters of the original simulated fog environment according to the adjustment amount to obtain the adjusted simulated fog environment; acquiring candidate simulated fog environment images of the adjusted simulated fog environment; obtaining a second degree of realism of the candidate simulated fog environment images relative to the target visibility level; if the second degree of realism is greater than or equal to a preset threshold, then the adjusted simulated fog environment is determined as the target simulated fog environment at the target visibility level; or, if the second degree of realism is less than the preset threshold, then the adjustment direction and adjustment range for the next round are determined again based on the difference between the second degree of realism and the preset threshold, and the adjustment steps are executed iteratively until the degree of realism of the acquired simulated fog environment images is greater than or equal to the preset threshold.

[0015] The fog environment simulation method provided in this invention dynamically adjusts fog-generating parameters and performs iterative optimization in conjunction with realism feedback to ensure that the simulated fog environment can accurately match the target visibility level, effectively improving the realism and stability of the simulated fog environment. At the same time, the closed-loop adjustment mechanism also ensures the efficiency of the simulation process and avoids the waste of resources caused by blind debugging.

[0016] In an optional implementation, the method further includes: if the first realism is greater than or equal to a preset threshold, then the fog-making parameters of the original simulated fog environment are used as the target fog-making parameters corresponding to the target visibility level.

[0017] The fog environment simulation method provided in this invention, by pre-verifying the adaptability of the original simulated fog environment, directly reuses fog-making parameters while meeting the target visibility level requirements, further shortening the simulation cycle and improving overall efficiency; at the same time, this "verify first, then adjust" strategy takes into account both accuracy and resource optimization, avoids unnecessary parameter iteration, and makes the fog environment simulation process more intelligent and flexible, maximizing the reduction of computation and debugging costs while ensuring simulation effects.

[0018] Secondly, the present invention provides a device for simulating a foggy environment, comprising: The image acquisition module is used to acquire the simulated fog environment image of the original simulated fog environment output by the fog-making device; The visibility level determination module is used to analyze the similarity between simulated fog environment images and real fog environment images at different visibility levels, and to determine the target visibility level that is closest to the simulated fog environment image. The realism acquisition module is used to acquire the first realism of the simulated fog environment image relative to the target visibility level; The environment simulation module is used to adjust the fog-making parameters of the original simulated fog environment according to the first degree of realism, so as to obtain the target simulated fog environment under the target visibility level.

[0019] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the fog environment simulation method of the first aspect or any corresponding embodiment described above.

[0020] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the fog environment simulation method of the first aspect or any corresponding embodiment thereof.

[0021] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the fog environment simulation method of the first aspect or any corresponding embodiment described above. Attached Figure Description

[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart of a first method for simulating a fog environment according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a second process for simulating a fog environment according to an embodiment of the present invention; Figure 3 This is a data flow diagram of a fog environment simulation method according to an embodiment of the present invention; Figure 4 This is a structural block diagram of a fog environment simulation device according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 some embodiments of the present invention, not all embodiments. 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.

[0025] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0026] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0027] According to an embodiment of the present invention, a method for simulating a fog environment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0028] This embodiment provides a method for simulating a foggy environment. Figure 1 This is a flowchart of a fog environment simulation method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain the simulated fog environment image of the original simulated fog environment output by the fog generating device.

[0029] Among them, the simulated fog environment map refers to the image data captured in real time by image acquisition equipment (such as a high-definition camera) after the fog-generating equipment generates simulated fog in the target test scene (such as a closed laboratory space, outdoor simulated site, etc.). This data includes, but is not limited to, the fog concentration distribution, fog particle morphology, and the visual effects of the interaction between the target object and the fog in the scene.

[0030] In some optional implementations, when acquiring the simulated fog environment image of the original simulated fog environment output by the fog-making device, the image acquisition device can be calibrated first to ensure that its resolution, color space, and exposure parameters match the environmental characteristics of the target test scene. For example, the white balance can be adjusted appropriately in a high humidity scene to avoid image color cast. Real-time operating data of the fog-making device (such as atomization amount and spray angle) and scene environmental parameters (such as temperature, humidity, and wind speed) are acquired simultaneously and associated with the simulated fog environment image. At the same time, the acquired original image is subjected to preliminary noise reduction processing, and noise points caused by device vibration or environmental interference are removed by Gaussian filtering or median filtering.

[0031] Step S102: Analyze the similarity between the simulated fog environment image and real fog environment images of different visibility levels, and determine the target visibility level that the simulated fog environment image is closest to.

[0032] The real fog environment images are images from a pre-built standard image library. This standard image library includes real fog scene images under different visibility levels (such as light fog, moderate fog, and dense fog, with visibility of 1~10km for light fog, 200m~1km for moderate fog, and <200m for dense fog) and different scenes (coastal ports, mountain roads, etc.). Each image is associated with corresponding metadata such as atmospheric extinction coefficient, scene correction factor, measurement equipment model, and correction algorithm version, so that feature matching and comparison can be performed based on a unified benchmark during similarity analysis.

[0033] In some optional implementations, when analyzing the similarity between simulated fog environment images and real fog environment images at different visibility levels, and determining the target visibility level closest to the simulated fog environment image, a first image feature reflecting the degree of fog degradation in the real fog environment images at different visibility levels, and a second image feature reflecting the degree of fog degradation in the simulated fog environment images can be obtained; the similarity between the second image feature and each first image feature can be calculated; the real fog environment image corresponding to the first image feature with the highest similarity to the second image feature can be taken as the target real fog environment image, and the visibility level corresponding to the target real fog environment image can be taken as the target visibility level.

[0034] Specifically, the process can begin by preprocessing real foggy environment images from a standard image library, including Gaussian denoising to eliminate image noise interference and grayscale normalization to unify the brightness benchmark. Next, the Canny edge detection algorithm is used to extract edge blurring features between foggy and non-foggy areas, and the gradient variance of edge pixels is calculated to reflect the degree of edge degradation caused by fog. Then, a brightness histogram is used to statistically analyze the brightness attenuation gradient features of the image, quantifying the fog's effect on overall brightness reduction. Simultaneously, RGB to HSV color space conversion is used to extract the rate of change of color saturation, reflecting the impact of fog on color reproduction. Furthermore, the above features can be weighted and corrected based on the atmospheric extinction coefficient in the metadata; for example, the higher the atmospheric extinction coefficient (the denser the fog), the greater the weight of edge blurring and brightness attenuation gradient, resulting in a standardized first image feature vector.

[0035] For simulated fog environment images, a preprocessing procedure and feature extraction algorithm identical to those used for real fog environment images are employed to generate a second image feature vector. During the similarity calculation stage, a cosine similarity algorithm is used to calculate the similarity value between the second image feature vector and each first image feature vector. If multiple real fog environment images exist at the same visibility level, the arithmetic mean of all similarity values ​​at that level is taken as the comprehensive similarity for that level. Finally, the visibility level with the highest comprehensive similarity is determined as the target visibility level for the simulated fog environment image. Furthermore, if multiple levels have similarity values ​​differing by less than a preset threshold (e.g., 5%), a secondary verification is performed using scene correction factors from the metadata, prioritizing the matching of levels corresponding to real fog environment images consistent with the simulated scene type to ensure the accuracy of the results.

[0036] As shown above, by extracting image features that reflect the degree of fog degradation and performing similarity matching, the target visibility level corresponding to the simulated fog environment image can be determined efficiently and accurately. This ensures a high degree of consistency between the simulated fog environment and the real fog environment in terms of visual features and visibility performance, thereby improving the realism and reliability of the fog environment simulation. In addition, through quantitative feature analysis and similarity calculation, the error of subjective judgment is avoided, making the simulation results more objective and repeatable.

[0037] In some optional implementations, when acquiring first image features reflecting the degree of fog degradation in real fog environment images at different visibility levels, and second image features reflecting the degree of fog degradation in simulated fog environment images, the first pixel gradient statistical features, first local grayscale statistical features, and fog intensity of the real fog environment images and simulated fog environment images can also be analyzed to obtain image quality data. Here, fog intensity is used to characterize the difference in contrast between foggy scene images and fog-free scene images, and image contrast is used to characterize the difference in brightness or grayscale between different regions in the image. Image quality data is used to describe the visual degradation characteristics of the image in a foggy environment. Target detection is performed based on the real fog environment images and simulated fog environment images to determine the false negative rate and classification confidence, thus obtaining target detection data. The first image features in the real fog environment images and the second image features in the simulated fog environment images are determined using the image quality data and the target detection data, respectively.

[0038] Specifically, when analyzing the statistical features of the first pixel gradient in real fog environment images and simulated fog environment images, a 3×3 operator can be used to calculate the horizontal gradient of the images in both real and simulated fog environments:

[0039] Vertical gradients of real and simulated fog environment images (* indicates convolution operation, I represents a real or simulated fog environment image):

[0040] Calculate pixel gradient magnitude based on image horizontal and vertical gradients. .

[0041] Set weak edge threshold (High proportion of weak edges in foggy environments) If Then the pixel gradient magnitude is multiplied by the weighting factor. x =1.5 to enhance the sensitivity of weak edge attenuation. The weighting factor is obtained through testing and calibration of multiple sets of foggy image samples to ensure accurate response to changes in weak edges under different fog concentrations and scenes. The weak edge threshold is determined based on the statistical analysis of edge features in foggy images and the perception requirements of edge attenuation by machine vision algorithms. It is strongly correlated with fog concentration and scene and will be dynamically adapted to actual working conditions. Calculate the global weighted gradient mean of pixel gradient magnitudes (M×N is the image pixel size, (where is the pixel gradient magnitude), thus obtaining the first pixel gradient statistical features of the real fog environment image and the simulated fog environment image.

[0042] When analyzing the first local grayscale statistical features of real fog environment images and simulated fog environment images, the real fog environment images and simulated fog environment images can be divided into 5×5 local windows, and all non-overlapping windows can be traversed; the grayscale variance of each local window can be calculated. ( For window pixel grayscale values, (This refers to the average grayscale value of all local windows); the mean variance of the global window is obtained by calculating the arithmetic mean of all local windows. (K is the total number of windows), which yields the first local grayscale statistical features of the real fog environment image and the simulated fog environment image.

[0043] When analyzing the fog level in real and simulated fog environment images, the image contrast of the real and simulated fog environment images can be calculated first: =

[0044] Image contrast in foggy and fog-free scenes and To calculate the contrast ratio, i.e., haze ( To improve image contrast in foggy scenes, (Image contrast for fog-free scenes), which yields the fog level of both real fog environment images and simulated fog environment images.

[0045] Furthermore, based on the ratio of the total number of missed detections to the total number of detections for all typical targets within the measurement time range. (The target is a typical object in the test scene, such as a dummy, vehicle, lane line, traffic sign, etc.) This allows us to obtain the false negative rate of target detection for real fog environment images and simulated fog environment images.

[0046] based on ( To identify the number of successful targets, The classification confidence of a single target output by the target detection algorithm can be used to obtain the classification confidence of target detection in real fog environment images and simulated fog environment images.

[0047] In some optional implementations, when determining the first image feature in a real fog environment image and the second image feature in a simulated fog environment image using image quality data and target detection data respectively, the second pixel gradient statistical feature and the second local grayscale statistical feature of the fog-free image can be obtained first. Based on the fusion of the pixel deviation between the first pixel gradient statistical feature and the second pixel gradient statistical feature, the grayscale deviation between the first local grayscale statistical feature and the second local grayscale statistical feature, the fog level, the false negative rate, and the classification confidence, the first image feature reflecting the degree of fog degradation in the real fog environment image and the second image feature reflecting the degree of fog degradation in the simulated fog environment image are determined.

[0048] Specifically, the model for determining the first image feature reflecting the degree of fog degradation in real fog environment images and the second image feature reflecting the degree of fog degradation in simulated fog environment images is as follows:

[0049] Wherein, DR is the image feature, a is the pixel gradient statistical feature weight, b is the local gray level statistical feature weight, c is the haze weight, d is the false negative rate weight, and e is the classification confidence weight. Based on sample data from multiple sets of real fog and simulated fog scenes, the optimal weights were obtained through statistical regression analysis (0.2, 0.15, 0.15, 0.25, 0.25). For the second pixel gradient statistical features, The second local grayscale statistical feature is DR, which ranges from [0,1]. The larger the DR value, the higher the degree of fog degradation reflected in the fog environment image.

[0050] As shown above, by comparing the differences in image features between real fog environments and simulated fog environments, and adjusting the simulation parameters, the generated simulated fog environment images are highly consistent with real fog environments in terms of fog distribution, degree of detail degradation, and impact on target recognition. This provides a more realistic and reliable test scenario for visual perception in foggy weather, such as autonomous driving and security monitoring.

[0051] Step S103: Obtain the first realism of the simulated fog environment image relative to the target visibility level.

[0052] The first realism is used to characterize the degree of matching between the simulated fog environment image and the real fog environment image under the corresponding target visibility level in terms of fog degradation, detail preservation, and impact on target recognition.

[0053] In some optional implementations, when obtaining the first realism of the simulated fog environment image relative to the target visibility level, the absolute values ​​of the similarity between the simulated fog environment image and real fog environment images at different visibility levels can be taken and summed to obtain a similarity sum value; the first realism is calculated based on the similarity sum value and the number of visibility levels.

[0054] Specifically, for each independent fog level—light fog, moderate fog, and dense fog—the similarity model between the simulated fog environment and the real fog environment at that level is calculated as follows:

[0055] Where k is the fog level indicator (e.g., k=1 represents light fog, k=2 represents moderate fog, and k=3 represents dense fog); Let be the similarity of the k-th fog level, with a value in the range [0,1]. The DR value for simulating a fog environment at the k-th fog level; Let be the DR value of the real fog environment at the k-th fog level.

[0056] The first truth calculation model is:

[0057] Furthermore, based on the actual impact of each fog level on machine vision tasks (such as object recognition and image classification), a weighting coefficient corresponding to each fog level can be pre-set. Then, the similarity of each fog level is multiplied by its weighting coefficient to obtain the weighted similarity for that level. Finally, the weighted similarities of all fog levels are summed to obtain the overall realism of the real and simulated environment images at the corresponding visibility levels. The weighting coefficients can be determined based on statistical analysis of extensive experimental data. For example, dense fog has a higher interference effect on machine vision, and its weighting coefficient can be set higher than that of light and medium fog levels to more accurately reflect the realism of the simulated fog environment in real-world application scenarios. The overall realism characterizes the overlap between real and simulated environment images at at least one visibility level.

[0058] As an example, when determining the overall realism of a real environment image and a simulated environment image at at least one visibility level based on hierarchical similarity, the number of visibility levels can be obtained first. If the number of visibility levels is 1, the overall realism of the real environment image and the simulated environment image at that visibility level can be determined based on hierarchical similarity. If the number of visibility levels is greater than 1, the relationship between the similarity of each level and the corresponding level threshold can be obtained, and the overall realism of the real environment image and the simulated environment image at multiple visibility levels can be determined based on the number of visibility levels.

[0059] As mentioned above, by quantifying the degree of matching between simulated fog environment images and real fog environments, objective data is provided for subsequent adjustments to simulation parameters such as fog concentration, fog particle diameter, and fog spatial distribution uniformity, thereby effectively improving the realism and reliability of fog environment simulation. By converting subjective visual similarity into calculable numerical indicators, the subjective bias of manual evaluation is avoided, ensuring the consistency and scientific nature of the evaluation results. In addition, combined with feedback from the first degree of realism, the fog environment simulation can be further optimized, making the generated fog environment images more closely resemble the characteristics of real fog scenes under different visibility levels.

[0060] Step S104: Adjust the fog-making parameters of the original simulated fog environment according to the first realism to obtain the target simulated fog environment under the target visibility level.

[0061] Among them, the fog-generating parameters include, but are not limited to, fog concentration adjustment coefficient, particulate matter size distribution parameter, light scattering coefficient, and spatial distribution uniformity parameter.

[0062] In some optional implementations, when adjusting the fog-making parameters of the original simulated fog environment based on the first level of realism to obtain the target simulated fog environment at the target visibility level, the difference between the first level of realism and the target level of realism threshold can be calculated first. If the difference is positive (i.e., the current level of realism is higher than the target), the fog concentration adjustment coefficient is appropriately reduced, and the particle size distribution is finely adjusted to shift towards a more uniform direction. If the difference is negative, the fog concentration adjustment coefficient is increased, and the light scattering coefficient is adjusted to enhance the optical effect of the fog. Furthermore, based on the detection results of spatial distribution uniformity, the fog-making parameters of local areas are compensated and corrected. In addition, based on a feedback mechanism, the first level of realism can be recalculated after each parameter adjustment until it meets the realism requirements corresponding to the target visibility level. For the particle size distribution parameter, the proportion of different particle size ranges can be adjusted according to the statistical characteristics of particles in the real fog environment. For example, when the level of realism is insufficient, the proportion of small-diameter particles can be increased to improve the fog's suspension effect. For the spatial distribution uniformity parameter, the fog-making intensity in different areas can be dynamically adjusted to make the spatial distribution of the simulated fog environment closer to the non-uniform characteristics of real fog.

[0063] As an example, assuming a target visibility level of 500 meters corresponds to a realistic fog environment, and the target realism threshold is set to 90%, the initial fog generation parameters are: fog concentration adjustment coefficient 0.6, small particle size (≤2μm) proportion 30%, light scattering coefficient 1.2, and spatial distribution uniformity parameter 0.8. The realism calculation model yields a first realism of 82%, with a difference of -8% (below the target threshold). At this point, the fog concentration adjustment coefficient is increased to 0.75, and the light scattering coefficient is adjusted to 1.5 to enhance the optical masking effect of the fog; simultaneously, the proportion of small particle size is increased to 45% to improve the fog's suspension stability; spatial distribution detection reveals that the fog concentration in the right shoulder area of ​​the simulated environment is 12% lower than in the real fog environment, therefore, a 15% compensation correction is applied to the fog generation intensity in this area. After adjustment, the realism is recalculated, resulting in 91%, reaching the target threshold. The simulated fog environment obtained at this point is the effective simulation result under the target visibility level.

[0064] The fog environment simulation method provided in this embodiment achieves dynamic closed-loop adjustment of fog-making parameters by comparing and analyzing the original simulated fog environment image with the real fog environment image from multiple dimensions, combined with accurate matching and realism assessment of visibility level. By quickly generating simulated fog environments that meet specific visibility levels and have high realism according to target requirements, it provides reliable technical support for applications such as equipment testing and scenario drills related to fog days, significantly improving the controllability and realism of the simulated fog environment, and ensuring that the simulation results are closer to the physical characteristics and visual performance of actual fog scenes.

[0065] This embodiment provides a method for simulating a foggy environment. Figure 2 This is a flowchart of a fog environment simulation method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Obtain the simulated fog environment image of the original simulated fog environment output by the fog-generating device. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0066] Step S202: Analyze the similarity between the simulated fog environment image and real fog environment images at different visibility levels, and determine the target visibility level that the simulated fog environment image most closely matches. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.

[0067] Step S203: Obtain the first level of realism of the simulated fog environment image relative to the target visibility level. See details below. Figure 1 Step S103 of the illustrated embodiment will not be described again here.

[0068] Step S204: Adjust the fog-making parameters of the original simulated fog environment according to the first realism to obtain the target simulated fog environment under the target visibility level.

[0069] Specifically, step S204 includes: Step S2041: Compare the first level of realism with the preset threshold.

[0070] The preset threshold is used to represent the minimum level of realism required for the simulated fog environment to meet the corresponding target fog environment standard, relative to the target visibility level.

[0071] Step S2042: If the first accuracy is less than the preset threshold, then the adjustment direction and adjustment range of the fog-making parameters are determined based on the difference between the first accuracy and the preset threshold.

[0072] The adjustment directions of the fog-generating parameters include, but are not limited to, increasing or decreasing fog concentration, increasing or decreasing fog droplet size, improving or optimizing fog distribution uniformity, and accelerating or slowing down the fog dynamic diffusion rate. The adjustment ranges of the fog-generating parameters include, but are not limited to, proportional adjustment ranges determined based on the ratio of the accuracy difference to a preset threshold, step-like adjustment ranges based on a preset step size table, adaptive adjustment ranges optimized using historical adjustment data, and differentiated fixed adjustment ranges set for different fog-generating parameter characteristics.

[0073] In some optional implementations, when determining the adjustment direction and magnitude of fog-generating parameters based on the difference between the first level of accuracy and a preset threshold, a multi-parameter collaborative adjustment strategy can be adopted based on the influence weight of different fog-generating parameters on accuracy. For example, when the difference ΔT between the first level of accuracy and the preset threshold is greater than 20% of the preset threshold, the fog concentration is adjusted proportionally first, with the adjustment magnitude being the ratio of ΔT to the preset threshold multiplied by a base coefficient of 0.8; if ΔT is in the range of 10% to 20% of the preset threshold, a step-wise adjustment is made in combination with the droplet size and distribution uniformity, referring to the particle size increase / decrease step size (e.g., 0.5 μm) and uniformity optimization step size (e.g., 5%) in the corresponding interval of the step size table; if ΔT is less than 10% of the preset threshold, an adaptive adjustment magnitude is adopted based on the best case with the same difference range in historical adjustment data to fine-tune the fog dynamic diffusion rate (e.g., increasing the rate by 0.2 m / s based on historical data). In addition, different fixed adjustment ranges can be set according to the characteristics of different fog-generating parameters: for example, a fixed increase of 5% when the fog concentration is insufficient, and a fixed decrease of 1μm when the droplet size is too large, to ensure that the adjustment process is both efficient and precise.

[0074] Step S2043: Adjust the fog-making parameters according to the adjustment direction and adjustment range to obtain the target simulated fog environment under the target visibility level.

[0075] Specifically, assuming the target visibility level is light fog (corresponding to a visibility range of 500-1000 meters), the preset realism threshold is 85%. The initial realism of the simulated fog environment is detected to be 70%, with a difference ΔT = 15%, falling within the 10%~20% range of the preset threshold. At this point, based on a multi-parameter collaborative adjustment strategy, a step-by-step adjustment is made, combining droplet size and distribution uniformity: referring to the corresponding parameters in the preset step size table for this range, the droplet size needs to be increased by 0.5μm (from 10μm to 10.5μm), and the fog distribution uniformity needs to be increased by 5% (from 80% to 85%). After adjustment, the realism of the simulated fog environment is detected again. If the detection result reaches 85% or higher, the target simulated fog environment at the target visibility level is confirmed as generated.

[0076] The fog environment simulation method provided in this invention dynamically adjusts the fog-generating parameters based on the comparison results of a first realism level and a preset threshold, enabling precise iteration of the fog environment simulation process and gradually narrowing the gap between the simulation effect and the real fog scene. Through a closed-loop adjustment mechanism based on realism feedback, it not only improves the efficiency of fog environment simulation and reduces the cost of blind trial and error, but also makes the final generated target simulated fog environment more in line with the physical laws of the real fog environment in terms of visual performance and visibility characteristics, meeting the needs of autonomous driving testing, meteorological simulation experiments and other scenarios for high-realism fog environments.

[0077] In some optional implementations, when adjusting the fog-making parameters according to the adjustment direction and adjustment range to obtain the target simulated fog environment at the target visibility level, the adjustment amount for the fog-making parameters can also be determined according to the adjustment direction and adjustment range; the fog-making parameters of the original simulated fog environment are adjusted according to the adjustment amount to obtain the adjusted simulated fog environment; candidate simulated fog environment images of the adjusted simulated fog environment are acquired; the second realism of the candidate simulated fog environment image relative to the target visibility level is obtained; if the second realism is greater than or equal to a preset threshold, the adjusted simulated fog environment is determined as the target simulated fog environment at the target visibility level; or, if the second realism is less than the preset threshold, the adjustment direction and adjustment range for the next round are determined again according to the difference between the second realism and the preset threshold, and the adjustment steps are executed cyclically until the realism of the acquired simulated fog environment image is greater than or equal to the preset threshold.

[0078] As an example, if the current simulated fog environment realism is 0.75 and the preset threshold is 0.9, the difference between the two is 0.15. Therefore, the adjustment direction is determined to be to improve the fog environment realism, and the adjustment range is 0.15. According to the mapping relationship, every 0.05 increase in realism requires an increase in fog concentration by 5%, a decrease in fog particle diameter by 2μm, and an optimization of spatial distribution uniformity by 3%. Based on this, the adjustment amount of the fog generation parameters is calculated to be: an increase in fog concentration by 15%, a decrease in fog particle diameter by 6μm, and an optimization of fog spatial distribution uniformity by 9%.

[0079] It should be noted that when determining the adjustment amount of the fog-generating parameters, verification can be performed based on the range of hardware parameters of the fog-generating equipment. For example, if the calculated fog concentration adjustment amount exceeds the maximum output concentration of the equipment (e.g., the maximum fog concentration of the equipment is 80%, but the calculated amount needs to be increased to 85%), the fog concentration adjustment amount should be corrected to the maximum allowable value of the equipment, and other parameters should be adjusted accordingly (e.g., further reducing the fog particle diameter or optimizing the spatial distribution uniformity) to compensate for the difference in accuracy. In addition, to avoid infinite loops, a maximum number of loops can be set (e.g., 5 times). If the accuracy is still not up to standard after reaching the maximum number of loops, an adjustment suggestion report will be output, prompting the user to check the equipment status or update the accuracy assessment model.

[0080] Furthermore, if the second realism of the candidate simulated fog environment image is much higher than the preset threshold (e.g., the difference exceeds 0.2), the subsequent adjustment range can be appropriately reduced to minimize unnecessary parameter adjustment costs. For example, when the realism is 0.95 and the preset threshold is 0.9, only the fog particle diameter or spatial distribution uniformity can be fine-tuned to keep the realism within a reasonable range while ensuring simulation efficiency.

[0081] Furthermore, the mapping relationship can be dynamically updated according to different scenarios (such as enclosed indoor spaces and open outdoor areas). For example, in outdoor scenarios, wind factors can affect the distribution of fog, so the mapping relationship needs to include a correction coefficient for the spatial uniformity of fog based on wind speed to ensure that the adjusted fog environment better reflects the physical characteristics of the actual scenario.

[0082] The fog environment simulation method provided in this invention dynamically adjusts fog-generating parameters and performs iterative optimization in conjunction with realism feedback to ensure that the simulated fog environment can accurately match the target visibility level, effectively improving the realism and stability of the simulated fog environment. At the same time, the closed-loop adjustment mechanism also ensures the efficiency of the simulation process and avoids the waste of resources caused by blind debugging.

[0083] In some optional implementations, if the first realism is greater than or equal to a preset threshold, the fog-making parameters of the original simulated fog environment are used as the target fog-making parameters corresponding to the target visibility level.

[0084] As an example, when the preset threshold is set to 0.85, assuming the original simulated fog environment's fog-making parameters are a fog particle concentration of 1500 particles / cm³ and an average fog particle diameter of 10μm, the first realism obtained through detection and calculation is 0.88. This value is greater than the preset threshold of 0.85. At this point, there is no need to adjust the fog-making parameters. The fog particle concentration of 1500 particles / cm³ and the average fog particle diameter of 10μm can be directly used as the target fog-making parameters corresponding to the target visibility level (such as visibility of 500 meters), which can meet the realism requirements of the simulated fog environment and shorten the time cost of simulation debugging.

[0085] The fog environment simulation method provided in this invention, by pre-verifying the adaptability of the original simulated fog environment, directly reuses fog-making parameters while meeting the target visibility level requirements, further shortening the simulation cycle and improving overall efficiency; at the same time, this "verify first, then adjust" strategy takes into account both accuracy and resource optimization, avoids unnecessary parameter iteration, and makes the fog environment simulation process more intelligent and flexible, maximizing the reduction of computation and debugging costs while ensuring simulation effects.

[0086] For one or more specific application embodiments of the present invention, please refer to Figure 3 When the assisted driving is activated, the images captured by the forward-facing camera cover three levels: light fog with visibility between 1km and 10km, moderate fog with visibility between 200m and 1km, and dense fog with visibility less than 200m. Simultaneously, 100 frames each of real fog weather and simulated fog weather (physical simulation, simulation, AI model generation) with fog and no fog control images are captured, and the road layout and the position of target objects (such as the vehicle in front, dummy, lane lines) are completely consistent.

[0087] Based on actual data collection and simulated generation of images of different fog levels on highways, the images were grouped into a fog-free control group and fog level subgroups. The fog-free control group integrated all fog-free images from various scenes to eliminate the inherent effects of the scene. The evaluation group was divided into three subgroups: "light fog," "medium fog," and "dense fog," with each subgroup containing 100 frames of real fog and 100 frames of simulated fog images. The evaluation index quantification included "image quality indices (fog-adaptive Tenengrad gradient function, local variance sharpness function, fog contrast coefficient) and target detection indices (false negative rate, classification confidence)," which were based on the calculation of the change in foggy images compared to fog-free images. In the evaluation index quantification stage, a fog environment evaluation system that included image quality and target detection was constructed. Through the evaluation quantification of each group of images, the image quality indices under different fog conditions are shown in Table 1, and the target detection indices under different fog conditions are shown in Table 2.

[0088] Table 1 Image quality indicators under different fog conditions

[0089] Table 2 Target detection indicators under different fog conditions

[0090] The evaluation of each group of images was further quantified to obtain the DR value under different fog conditions, that is, the degree of damage to the fog environment image.

[0091] Table 3 DR values ​​under different fog conditions

[0092] Calculate the overall accuracy (i.e., the degree of pattern overlap) based on the above data, and then further calculate the degree of pattern overlap (overall accuracy). .

[0093] because The machine vision realism level of the physical simulation fog in the laboratory was rated as "excellent".

[0094] In some optional implementations, when analyzing the first and second degree of influence at each visibility level to obtain the corresponding comprehensive realism, the first degree of influence of each real fog environment image corresponding to each visibility level can be extracted to construct a first sequence corresponding to the corresponding visibility level; the second degree of influence of each simulated fog environment image corresponding to each visibility level can be extracted to construct a second sequence corresponding to the corresponding visibility level; the statistical feature similarity between the first and second sequences at the same visibility level can be calculated; multiple sub-fog intervals corresponding to the visibility level can be obtained, and the visual influence correlation coefficient of the fog environment on machine vision performance in real fog environment images and simulated fog environment images within each sub-fog interval can be calculated; the statistical feature similarity and the visual influence correlation coefficient of each sub-fog interval can be weighted and fused according to the sample proportion and importance coefficient to obtain the comprehensive realism.

[0095] Specifically, the calculation of statistical feature similarity can be achieved by constructing a statistical feature vector of the sequences: for example, extracting the mean, variance, and skewness of the first and second sequences respectively to form feature vectors. and Then, the cosine similarity formula is used to calculate the similarity between the two, that is... The division of sub-haze intervals needs to be combined with the haze range corresponding to the visibility level. The equal-frequency partitioning principle should be used to ensure a balanced sample size in each sub-interval. For example, when the visibility level is 200-500 meters, it can be divided into three sub-haze intervals based on the haze coefficient: [0.2, 0.3), [0.3, 0.4), and [0.4, 0.5]. Each sub-haze interval should contain at least 15 valid samples. The calculation of the visual impact correlation coefficient requires statistically analyzing the performance degradation rate of machine vision tasks (such as object detection and semantic segmentation) under real and simulated images for samples within each sub-interval, and then using the linear correlation coefficient... Calculate the correlation between the two: ,in x t For the actual image performance degradation rate, y t To simulate the rate of image performance degradation, μ x , μ yThese are the means of the two, respectively. In the weighted fusion stage, the sample proportion is the ratio of the number of samples in the sub-haze interval to the total number of samples in that visibility level. The importance coefficient is determined based on task sensitivity analysis (e.g., in target detection tasks, the importance coefficient for the low haze interval is set to 0.4, for the medium haze interval to 0.3, and for the high haze interval to 0.3). The final formula for calculating the overall realism is: Overall Realism ,in The weights for statistical feature similarity (usually taken as 0.3-0.4). , r t Let be the correlation coefficient of visual impact in the sub-haze range, and satisfy . The higher the overall realism value obtained through this method, the more consistent the influence of real and simulated fog environments on machine vision.

[0096] As shown above, by constructing sequences of the impact levels in real and simulated fog environments and calculating statistical feature similarity, the matching of the impact patterns between the two can be quantified at the overall level. By dividing multiple sub-fog intervals and calculating the visual impact correlation coefficient, the consistency of impact under different fog concentration scenarios can be accurately captured. Through a weighted fusion strategy based on sample proportion and importance coefficient, the weights can be dynamically adjusted according to the frequency of occurrence of each sub-fog interval and its criticality to the machine vision task in actual applications, effectively improving the scientificity and rationality of the comprehensive realism calculation. The realism of the simulated fog environment determined based on the comprehensive realism can more accurately reflect the fit between the simulated fog environment and the real fog environment in terms of their impact on machine vision performance.

[0097] This embodiment also provides a fog environment simulation device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0098] This embodiment provides a device for simulating a foggy environment, such as... Figure 4 As shown, it includes: Image acquisition module 401 is used to acquire the simulated fog environment image of the original simulated fog environment output by the fog-making device; The level determination module 402 is used to analyze the similarity between the simulated fog environment image and the real fog environment image at different visibility levels, and to determine the target visibility level that is closest to the simulated fog environment image. The realism acquisition module 403 is used to acquire the first realism of the simulated fog environment image relative to the target visibility level; The environment simulation module 404 is used to adjust the fog-making parameters of the original simulated fog environment according to the first realism to obtain the target simulated fog environment under the target visibility level.

[0099] In some alternative implementations, the level determination module 402 includes: The image feature acquisition unit is used to acquire first image features reflecting the degree of fog degradation in real fog environment images with different visibility levels, and second image features reflecting the degree of fog degradation in simulated fog environment images; A similarity calculation unit is used to calculate the similarity between the second image feature and each first image feature; The target level determination unit is used to take the real fog environment image corresponding to the first image feature with the highest similarity to the second image feature as the target real fog environment image, and take the visibility level corresponding to the target real fog environment image as the target visibility level.

[0100] In some optional implementations, the target level determination unit includes: The quality analysis subunit is used to analyze the first pixel gradient statistical features, the first local grayscale statistical features, and the haze of real fog environment images and simulated fog environment images to obtain image quality data. Among them, the haze is used to characterize the difference between the contrast of fog scene images and the contrast of non-fog scene images, and the image contrast is used to characterize the difference between the brightness or grayscale of different regions in the image. The target detection subunit is used to perform target detection based on real fog environment images and simulated fog environment images, determine the false detection rate and classification confidence, and obtain target detection data. The feature subunit is defined to determine the first image feature in the real fog environment image and the second image feature in the simulated fog environment image, respectively, using image quality data and target detection data.

[0101] In some optional implementations, the authenticity acquisition module 403 includes: The similarity calculation unit is used to take the absolute value of the similarity between the simulated fog environment image and the real fog environment image at different visibility levels, and then sum them to obtain the similarity sum value; The authenticity calculation unit is used to calculate the first authenticity based on the similarity and the number of visibility levels.

[0102] In some alternative implementations, the environment simulation module 404 includes: The realism comparison unit is used to compare the first realism with a preset threshold, wherein the preset threshold is used to represent the minimum realism required for the simulated fog environment to reach the target visibility level in order to meet the corresponding target fog environment standard. The first parameter determination unit is used to determine the adjustment direction and adjustment range of the fog-making parameter based on the difference between the first authenticity and the preset threshold if the first authenticity is less than the preset threshold. The fog-making parameter adjustment unit is used to adjust the fog-making parameters according to the adjustment direction and adjustment range to obtain the target simulated fog environment under the target visibility level.

[0103] In some optional implementations, the fogging parameter adjustment unit includes: The adjustment amount determination subunit is used to determine the adjustment amount for the fogging parameters based on the adjustment direction and adjustment range; The parameter adjustment subunit is used to adjust the fog-generating parameters of the original simulated fog environment according to the adjustment amount, so as to obtain the adjusted simulated fog environment; The image acquisition subunit is used to acquire candidate simulated fog environment images after adjustment. The realism acquisition subunit is used to acquire the second realism of the candidate simulated fog environment image relative to the target visibility level; The target environment determination subunit is used to determine the adjusted simulated fog environment as the target simulated fog environment under the target visibility level if the second realism is greater than or equal to the preset threshold; or, if the second realism is less than the preset threshold, to re-determine the adjustment direction and adjustment range of the next round based on the difference between the second realism and the preset threshold and to repeatedly execute the adjustment steps until the realism of the acquired simulated fog environment image is greater than or equal to the preset threshold.

[0104] In some alternative implementations, the environment simulation module 404 further includes: The second parameter determination unit is used to take the fog-making parameters of the original simulated fog environment as the target fog-making parameters corresponding to the target visibility level if the first realism is greater than or equal to the preset threshold.

[0105] In some optional implementations, the fog-generating parameters include at least one of fog concentration, fog particle diameter, and fog spatial distribution uniformity.

[0106] The fog environment simulation device provided in this embodiment of the invention can execute the fog environment simulation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0107] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0108] The following is a detailed reference. Figure 5The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from memory 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device. The processor 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0109] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0110] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a memory 508, or installed from a ROM 502. When the computer program is executed by the processor 501, it performs the functions defined in the fog environment simulation method of the embodiments of the present invention.

[0111] Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0112] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the fog environment simulation method shown in the above embodiments is implemented.

[0113] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0114] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for simulating a foggy environment, characterized in that, The method includes: Acquire the original simulated fog environment image output by the fog-generating device; Analyze the similarity between the simulated fog environment image and real fog environment images at different visibility levels to determine the target visibility level that the simulated fog environment image is closest to. Obtain the first realism of the simulated fog environment image relative to the target visibility level; The fog-making parameters of the original simulated fog environment are adjusted according to the first level of realism to obtain the target simulated fog environment at the target visibility level.

2. The method according to claim 1, characterized in that, The analysis of the similarity between the simulated fog environment image and real fog environment images at different visibility levels, and the determination of the target visibility level closest to the simulated fog environment image, includes: Acquire a first image feature reflecting the degree of fog degradation in the real fog environment image at different visibility levels, and a second image feature reflecting the degree of fog degradation in the simulated fog environment image; Calculate the similarity between the second image feature and each of the first image features; The real fog environment image corresponding to the first image feature with the highest similarity to the second image feature is taken as the target real fog environment image, and the visibility level corresponding to the target real fog environment image is taken as the target visibility level.

3. The method according to claim 2, characterized in that, The acquisition of a first image feature reflecting the degree of fog degradation in real fog environment images at different visibility levels, and a second image feature reflecting the degree of fog degradation in simulated fog environment images, includes: Image quality data is obtained by analyzing the first pixel gradient statistical features, the first local grayscale statistical features, and the fog level of the real fog environment image and the simulated fog environment image; wherein, the fog level is used to characterize the degree of difference between the contrast of the fog scene image and the contrast of the non-fog scene image, and the image contrast is used to characterize the degree of difference in brightness or grayscale between different regions in the image. Target detection is performed based on the real fog environment image and the simulated fog environment image to determine the false detection rate and classification confidence, and to obtain target detection data. Using the image quality data and the target detection data respectively, a first image feature in the real fog environment image and a second image feature in the simulated fog environment image are determined.

4. The method according to claim 1, characterized in that, The step of obtaining the first realism of the simulated fog environment image relative to the target visibility level includes: The absolute values ​​of the similarity between the simulated fog environment image and real fog environment images at different visibility levels are taken and summed to obtain the sum of similarity values; The first degree of authenticity is calculated based on the similarity score and the number of visibility levels.

5. The method according to claim 1, characterized in that, The step of adjusting the fog-making parameters of the original simulated fog environment according to the first realism to obtain the target simulated fog environment at the target visibility level includes: Compare the first level of realism with a preset threshold, wherein the preset threshold is used to represent the minimum level of realism required for the simulated fog environment to meet the corresponding target fog environment standard relative to the target visibility level. If the first degree of realism is less than the preset threshold, then the adjustment direction and adjustment range of the fog-making parameter are determined based on the difference between the first degree of realism and the preset threshold. The fog-making parameters are adjusted according to the adjustment direction and the adjustment range to obtain the target simulated fog environment under the target visibility level.

6. The method according to claim 5, characterized in that, The step of adjusting the fog-making parameters according to the adjustment direction and the adjustment range to obtain the target simulated fog environment under the target visibility level includes: Based on the adjustment direction and the adjustment range, determine the adjustment amount for the fogging parameters; Adjust the fog-generating parameters of the original simulated fog environment according to the adjustment amount to obtain the adjusted simulated fog environment; Acquire candidate simulated fog environment images of the adjusted simulated fog environment; Obtain the second realism of the candidate simulated fog environment image relative to the target visibility level; If the second realism is greater than or equal to the preset threshold, the adjusted simulated fog environment is determined as the target simulated fog environment under the target visibility level; or, if the second realism is less than the preset threshold, the adjustment direction and adjustment range of the next round are determined again according to the difference between the second realism and the preset threshold, and the adjustment steps are executed cyclically until the realism of the collected simulated fog environment image is greater than or equal to the preset threshold.

7. The method according to claim 5, characterized in that, The method further includes: If the first level of realism is greater than or equal to the preset threshold, then the fog-making parameters of the original simulated fog environment are used as the target fog-making parameters corresponding to the target visibility level.

8. The method according to any one of claims 1-7, characterized in that, The fog-generating parameters include at least one of fog concentration, fog particle diameter, and fog spatial distribution uniformity.

9. A device for simulating a foggy environment, characterized in that, The device includes: The image acquisition module is used to acquire the simulated fog environment image of the original simulated fog environment output by the fog-making device; The level determination module is used to analyze the similarity between the simulated fog environment image and real fog environment images of different visibility levels, and determine the target visibility level that the simulated fog environment image is closest to. The realism acquisition module is used to acquire the first realism of the simulated fog environment image relative to the target visibility level; An environment simulation module is used to adjust the fog-making parameters of the original simulated fog environment according to the first realism, so as to obtain the target simulated fog environment under the target visibility level.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the method of any one of claims 1 to 8.