Fog image sample generation method and device, equipment, medium and program product
By modeling the transmittance and atmospheric light field of fog-free images, fog image samples are generated, solving the problems of distortion and obvious artificiality in existing technologies. This achieves the generation of high-quality fog image samples, adapts to different fog concentration conditions, and improves the adaptability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU HOTAPPS TECH LTD
- Filing Date
- 2026-05-09
- Publication Date
- 2026-07-14
AI Technical Summary
Existing methods for generating foggy image samples suffer from problems such as image distortion and obvious artifacts, making it difficult to generate high-quality samples.
By acquiring fog-free images and real fog template images, transmittance modeling and atmospheric light field modeling are performed to generate transmittance distribution maps and atmospheric light field distribution maps. Combined with depth distribution maps and atmospheric extinction coefficients, pixel-by-pixel transmittance modeling and fog effect compositing are performed to generate fog image samples corresponding to the target area.
The generated fog image samples can more closely resemble the light and shadow changes in a real fog environment, avoid image distortion, improve sample quality, adapt to different fog concentration conditions, and enhance the robustness of the model in foggy scenarios.
Smart Images

Figure CN122391385A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, medium, and program product for generating foggy image samples. Background Technology
[0002] In foggy conditions, the large number of suspended water droplets or aerosol particles in the air scatters and absorbs light, leading to reduced contrast, color decay, and blurred or even disappearing distant targets in images taken under foggy conditions. This can significantly impact road and shipping safety. Therefore, with the rapid development of artificial intelligence technology, the industry has begun to use visual algorithms or models to identify images of different areas, determine whether fog has occurred in the current area, and generate corresponding warning information.
[0003] However, due to the randomness, short duration, and uneven regional distribution of fog formation, it is difficult to obtain sufficient real fog image samples as annotation data under different scenarios and visibility conditions. This difficulty in collecting real fog image samples directly leads to insufficient training data for visual algorithms or models, thus limiting the model's generalization ability. In the absence of diverse and high-quality fog image samples, models are prone to overfitting, especially in complex and variable real fog environments, where models are susceptible to recognition failures or sharp performance degradation.
[0004] To address the problem of insufficient fog image samples, two main methods are currently used to synthesize fog image samples: a fog effect overlay method based on empirical rules and a fog effect synthesis method based on style transfer.
[0005] Empirical rule-based fog overlay methods primarily generate fog image samples by overlaying a semi-transparent fog layer onto the original image or uniformly reducing the brightness and contrast of the original image. However, this method does not consider the propagation laws of light in the fog medium, which can easily lead to significant differences between the generated fog image samples and real fog images, resulting in insufficient quality of generated fog image samples.
[0006] The core idea of style transfer-based fog effect synthesis is to map the visual style features of another fog image onto the original image while keeping the original image content unchanged, using image generation and transformation techniques based on depth feature representation, thereby generating a fog image sample. This method can usually only change the "appearance statistics" of the original image, but it is difficult to accurately simulate the spatial depth, optical attenuation, and physical consistency involved in the formation of real fog, which easily leads to problems such as image distortion and obvious artificiality in the generated fog image samples.
[0007] In summary, existing methods for generating foggy image samples suffer from problems such as image distortion and obvious artifacts, making it difficult to generate high-quality samples. Summary of the Invention
[0008] This invention provides a method, apparatus, device, medium, and program product for generating fog image samples, which solves the problems of distortion and obvious artifacts in existing fog image sample generation methods, making it difficult to generate high-quality samples.
[0009] This invention provides a method for generating fog image samples, comprising: acquiring a fog-free image and a real fog template image; the fog-free image is obtained by photographing the target area under fog-free conditions; performing transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium; performing atmospheric light field modeling on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; and performing fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
[0010] According to the present invention, a method for generating fog image samples involves performing transmittance modeling on a fog-free image to generate a transmittance distribution map of the fog-free image. The method includes: performing depth estimation on the fog-free image to generate a depth distribution map of the fog-free image; the depth distribution map is used to characterize the relative distance information between different pixel positions of the fog-free image and the imaging device; based on the depth distribution map and the atmospheric extinction coefficient, performing pixel-by-pixel transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the atmospheric extinction coefficient is used to characterize the concentration and intensity of fog.
[0011] According to the present invention, a method for generating fog image samples is provided, which performs fog effect synthesis processing on a fog-free image based on a transmittance distribution map and an atmospheric light field distribution map to generate a fog image sample corresponding to a target area. The method includes: determining the original radiation distribution information of the fog-free image; and performing a weighted aggregation operation on the atmospheric light field distribution map and the original radiation distribution information based on the transmittance distribution map to obtain a fog image sample corresponding to the target area.
[0012] According to a method for generating foggy image samples provided by the present invention, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0013] According to the method for generating foggy image samples provided by the present invention, the spatial size of the atmospheric light field distribution map is the same as that of the fog-free image, and the expression of the atmospheric light field distribution map is as follows: ; in, Represents the pixel position of the real fog template image Atmospheric light field value at that location; For the color parameters of the fog medium; Represents the pixel position of the real fog template image Fog intensity distribution at the location; This is a non-linear adjustment parameter.
[0014] According to the method for generating fog image samples provided by the present invention, the expression for the fog image sample corresponding to the target region is as follows: ; in, Represents the pixel position of a foggy image sample Pixel value at; Represents the pixel position of a fog-free image The original radiation distribution at that location; Represents the pixel position of the real fog template image Atmospheric light field value at that location; Represents the pixel position of a fog-free image Transmittance at that location.
[0015] This invention also provides a fog image sample generation device, comprising: an acquisition module for acquiring a fog-free image and a real fog template image; the fog-free image is obtained by taking a picture of the target area under fog-free conditions; a transmittance modeling module for performing transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium; an atmospheric light field modeling module for performing atmospheric light field modeling on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; and a sample generation module for performing fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described methods for generating foggy image samples.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for generating foggy image samples.
[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for generating foggy image samples.
[0019] The present invention provides a method, apparatus, device, medium, and program product for generating fog image samples. In the process of synthesizing fog image samples, transmittance modeling and atmospheric light field modeling are introduced. First, fog-free images and real fog template images are acquired. The fog-free images are obtained by capturing the target area under fog-free conditions. Then, transmittance modeling is performed on the fog-free images to generate a transmittance distribution map. The transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium. Next, atmospheric light field modeling is performed on the real fog template images to generate an atmospheric light field distribution map. The atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light. Finally, the transmittance distribution map is used to generate the fog image sample. Transmittance distribution maps and atmospheric light field distribution maps are used to perform fog effect synthesis on fog-free images, generating fog image samples corresponding to the target area. Since the transmittance distribution map can reflect the attenuation of light in the target area during propagation under fog, and the atmospheric light field distribution map can reflect the influence of the fog medium on the scattering of ambient light in a real fog scene, under the combined conditions of the transmittance distribution map and the atmospheric light field distribution map, the light and shadow changes of the target area in a real fog scene can be effectively physically modeled. This allows the final fog image sample to present a visual effect of light and shadow changes that is closer to the real fog environment, effectively avoiding the problems of image distortion and obvious artificiality, and improving the sample quality of fog image samples. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is one of the flowcharts illustrating the fog image sample generation method provided by the present invention.
[0022] Figure 2 This is the second flowchart illustrating the fog image sample generation method provided by the present invention.
[0023] Figure 3This is a schematic diagram of the fog-free image provided by the present invention.
[0024] Figure 4 This is a schematic diagram of the depth distribution map provided by the present invention.
[0025] Figure 5 This is a schematic diagram of a fog image sample provided by the present invention.
[0026] Figure 6 This is a schematic diagram of the structure of the fog image sample generation device provided by the present invention.
[0027] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0029] Please see Figures 1 to 5 , Figure 1 This is one of the flowcharts illustrating the fog image sample generation method provided by the present invention. Figure 2 This is the second flowchart illustrating the fog image sample generation method provided by the present invention. Figure 3 This is a schematic diagram of the fog-free image provided by the present invention. Figure 4 This is a schematic diagram of the depth distribution map provided by the present invention. Figure 5 This is a schematic diagram of a fog image sample provided by the present invention.
[0030] In this embodiment, the fog image sample generation method is applied to a server. For example... Figure 1 As shown, the method for generating foggy image samples includes steps S110 to S140, and the specific steps are as follows: S110: Obtain the fog-free image and the real fog template image.
[0031] Fog-free images are obtained by taking pictures of the target area under conditions where there is no fog.
[0032] Specifically, the video management system on the server can call various connected imaging devices (such as surveillance cameras, mobile phones, dashcams, imaging drones, etc.). The imaging devices can periodically take pictures of the target area, obtain image frames or video streams of the target area, and store the collected image frames or video streams in the database.
[0033] The imaging device can capture images of the target area under different weather conditions. The image frames or video streams it acquires include images of the target area under different weather conditions, such as fog-free images under no-fog conditions and rain images under rainfall conditions.
[0034] like Figure 2 As shown, the server can obtain fog-free images of the target area from the database, or directly acquire fog-free images of the target area in real time from the imaging device.
[0035] Understandably, there should be at least one target area. To generate diverse fog image samples, multiple target areas can be selected to generate fog image samples under various environmental conditions. The number and location of imaging devices can be adjusted according to the actual selected target area.
[0036] At the same time, the server can also obtain real fog template images, which are a type of real fog texture data.
[0037] Optionally, the real fog template image is obtained by taking pictures of real fog scenes, or extracted from public datasets, or artificially synthesized.
[0038] Optionally, the real fog template image can be stored on a local imaging device, server, or database for subsequent processing.
[0039] S120: Perform transmittance modeling on the haze-free image to generate a transmittance distribution map of the haze-free image.
[0040] Transmittance distribution maps are used to characterize the situation where light in a target area is not scattered or absorbed after propagation in a fog medium.
[0041] Specifically, the server can call a pre-deployed depth estimation model to perform depth estimation processing on the fog-free image, extract the relative depth information corresponding to different pixel positions in the fog-free image, and generate a depth map with the same spatial size as the fog-free image.
[0042] Among them, the depth distribution map is used to characterize the relative distance information between different pixel positions in a fog-free image and the imaging device. In other words, the depth distribution map can characterize the relative distance relationship between different positions in the target area and the imaging device.
[0043] Since the depth-of-field distribution map corresponds one-to-one with the fog-free image in space, the fog intensity at different pixel locations can be calculated differently based on their corresponding depth-of-field values during subsequent fog effect synthesis, thus simulating the fog effect distribution that varies with distance. By introducing the depth-of-field distribution map as a control variable, the situation where applying a uniform fog effect or brightness directly to the original fog-free image in existing technologies results in a fog effect distribution that is almost uniform across the entire image (which does not match real fog scenes) can be avoided. The fog effect distribution will not remain consistent across the entire image, but will exhibit gradually changing spatial characteristics depending on the relative distance between objects at different locations in the target area and the imaging device. This ensures that the generated fog effect conforms to the propagation laws of real fog scenes in both visual appearance and physical mechanism.
[0044] Furthermore, based on the depth-of-field distribution map and atmospheric extinction coefficient, pixel-by-pixel transmittance modeling is performed on the fog-free image to generate a transmittance distribution map of the fog-free image.
[0045] The atmospheric extinction coefficient is a parameter that describes the effect of fog on the light attenuation capacity of the fog medium and is used to characterize the concentration and intensity of fog.
[0046] Generally, if light propagates in a fog medium, it will be affected by the scattering and absorption of suspended particles in the air (such as water droplets or aerosol particles) during propagation, which will lead to its attenuation. Under this condition, the attenuation process of light can be described by an exponential decay model. The exponential decay model of light is related to the atmospheric extinction coefficient, so an atmospheric extinction model can be constructed based on the atmospheric extinction coefficient.
[0047] The server can perform pixel-by-pixel transmittance modeling (i.e., physically modeling the light attenuation at different pixel locations in the fog-free image) based on the depth distribution map and atmospheric extinction model, thereby generating a pixel-level transmittance distribution map with the same spatial size as the fog-free image, which is used to characterize the proportion of light in the target area that is not scattered or absorbed after propagation in the fog medium.
[0048] Specifically, for each pixel location in a fog-free image, the larger the depth value and the smaller the transmittance corresponding to that pixel location, the farther the relative distance between the actual location of that pixel location and the imaging device is, and the stronger the influence of the fog medium is. Conversely, the smaller the depth value and the larger the transmittance corresponding to that pixel location, the closer the relative distance between the actual location of that pixel location and the imaging device is, and the weaker the influence of the fog medium is.
[0049] S130: Perform atmospheric light field modeling on a real fog template image to generate an atmospheric light field distribution map.
[0050] Atmospheric light field distribution maps are used to characterize the spatial distribution of the scattering contribution of fog media to ambient light.
[0051] Generally, in real fog scenes, the collected fog images include not only the direct radiation light from objects in the target area, but also the air light component formed by the scattering of ambient light by the fog medium. These air light components can be described by the atmospheric light field / airlight field.
[0052] Based on the above principles, the server can perform atmospheric light field modeling on real fog template images (i.e., physically model the scattering characteristics of light in the fog medium), thereby generating an atmospheric light field distribution map that varies with space.
[0053] Among them, the spatial size of the atmospheric light field distribution map is the same as that of the fog-free image, and it is used to characterize the spatial distribution of the scattering contribution of the fog medium to the ambient light.
[0054] Preferably, in a specific implementation, to avoid the generated fog effect being too regular in spatial distribution, local areas of other real fog template images can be introduced as disturbance sources. By randomly cropping or sampling other real fog template images, the fog effect in different areas can be made to exhibit random changes at the detail level, thereby further enhancing the non-uniformity and realism of the fog effect distribution.
[0055] S140: Based on the transmittance distribution map and the atmospheric light field distribution map, perform fog effect synthesis processing on the fog-free image to generate a fog image sample corresponding to the target area.
[0056] The fog image sample generation method provided in this embodiment introduces transmittance modeling and atmospheric light field modeling during the fog image sample synthesis process. First, fog-free images and real fog template images are acquired. The fog-free images are obtained by capturing the target area under fog-free conditions. Then, transmittance modeling is performed on the fog-free images to generate a transmittance distribution map. This transmittance distribution map characterizes the extent to which light in the target area is not scattered or absorbed after propagation in the fog medium. Next, atmospheric light field modeling is performed on the real fog template images to generate an atmospheric light field distribution map. This atmospheric light field distribution map characterizes the spatial distribution of the scattering contribution of the fog medium to ambient light. Finally, the transmittance distribution map is used... By combining the transmittance distribution map and the atmospheric light field distribution map, fog effect synthesis is performed on the fog-free image to generate a fog image sample corresponding to the target area. Since the transmittance distribution map can reflect the attenuation of light in the target area during the propagation process under the fog medium, and the atmospheric light field distribution map can reflect the influence of the fog medium on the scattering of ambient light in a real fog scene, under the combined conditions of the transmittance distribution map and the atmospheric light field distribution map, the light and shadow changes of the target area in a real fog scene can be effectively physically modeled. This allows the final fog image sample to present a visual effect of light and shadow changes that is closer to the real fog environment, effectively avoiding the problems of image distortion and obvious artificiality, and improving the sample quality of fog image samples.
[0057] In some embodiments, transmitting light modeling is performed on a fog-free image to generate a transmitting light distribution map of the fog-free image, including: performing depth estimation on the fog-free image to generate a depth distribution map of the fog-free image; the depth distribution map is used to characterize the relative distance information between different pixel positions of the fog-free image and the imaging device; based on the depth distribution map and the atmospheric extinction coefficient, pixel-by-pixel transmitting light modeling is performed on the fog-free image to generate a transmitting light distribution map of the fog-free image; the atmospheric extinction coefficient is used to characterize the concentration and intensity of fog.
[0058] Specifically, after obtaining a fog-free image of the target area, the server can call a pre-deployed depth estimation model to perform depth estimation processing on the fog-free image, extract the relative depth information corresponding to different pixel positions in the fog-free image, and generate a depth map with the same spatial size as the fog-free image.
[0059] Among them, the depth distribution map is used to characterize the relative distance information between different pixel positions in a fog-free image and the imaging device. In other words, the depth distribution map can characterize the relative distance relationship between different positions in the target area and the imaging device.
[0060] Since the depth-of-field distribution map corresponds one-to-one with the fog-free image in space, the fog intensity at different pixel locations can be calculated differently based on their corresponding depth-of-field values during subsequent fog effect synthesis, thus simulating the fog effect distribution that varies with distance. By introducing the depth-of-field distribution map as a control variable, the situation where applying a uniform fog effect or brightness directly to the original fog-free image in existing technologies results in a fog effect distribution that is almost uniform across the entire image (which does not match real fog scenes) can be avoided. The fog effect distribution will not remain consistent across the entire image, but will exhibit gradually changing spatial characteristics depending on the relative distance between objects at different locations in the target area and the imaging device. This ensures that the generated fog effect conforms to the propagation laws of real fog scenes in both visual appearance and physical mechanism.
[0061] Furthermore, based on the depth-of-field distribution map and atmospheric extinction coefficient, pixel-by-pixel transmittance modeling is performed on the fog-free image to generate a transmittance distribution map of the fog-free image.
[0062] The atmospheric extinction coefficient is a parameter that describes the effect of fog on the light attenuation capacity of the fog medium and is used to characterize the concentration and intensity of fog.
[0063] Generally, if light propagates in a fog medium, it will be affected by the scattering and absorption of suspended particles in the air (such as water droplets or aerosol particles) during propagation, which will lead to its attenuation. Under this condition, the attenuation process of light can be described by an exponential decay model. The exponential decay model of light is related to the atmospheric extinction coefficient, so an atmospheric extinction model can be constructed based on the atmospheric extinction coefficient.
[0064] The server can perform pixel-by-pixel transmittance modeling (i.e., physically modeling the light attenuation at different pixel locations in the fog-free image) based on the depth distribution map and atmospheric extinction model, thereby generating a pixel-level transmittance distribution map with the same spatial size as the fog-free image, which is used to characterize the proportion of light in the target area that is not scattered or absorbed after propagation in the fog medium.
[0065] Specifically, for each pixel location in a fog-free image, the larger the depth value and the smaller the transmittance corresponding to that pixel location, the farther the relative distance between the actual location of that pixel location and the imaging device is, and the stronger the influence of the fog medium is. Conversely, the smaller the depth value and the larger the transmittance corresponding to that pixel location, the closer the relative distance between the actual location of that pixel location and the imaging device is, and the weaker the influence of the fog medium is.
[0066] Alternatively, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0067] Optionally, in practical applications, to enhance the diversity and robustness of fog effect synthesis, the atmospheric extinction coefficient... The transmittance distribution can be selected or adjusted within a preset range to generate different fog concentration conditions, thereby adapting to different application scenarios such as light fog, medium fog, or dense fog.
[0068] In some embodiments, based on the transmittance distribution map and the atmospheric light field distribution map, fog effect synthesis processing is performed on the fog-free image to generate a fog image sample corresponding to the target area, including: determining the original radiation distribution information of the fog-free image; and performing a weighted aggregation operation on the atmospheric light field distribution map and the original radiation distribution information based on the transmittance distribution map to obtain a fog image sample corresponding to the target area.
[0069] Generally, in real fog scenes, the collected fog images include not only the direct radiation light from objects in the target area, but also the air light component formed by the scattering of ambient light by the fog medium, and these air light components can be described by the atmospheric light field.
[0070] Based on the above principles, to simulate the lighting effects in a foggy image, it is necessary to consider not only the atmospheric light field but also the radiation distribution of the original fog-free image. That is, in a foggy environment, the actual imaging result should be determined by both the direct radiation component of objects in the target area and the air light component formed by the scattering of ambient light by the fog medium. Therefore, after generating the transmittance distribution map and the atmospheric light field distribution map, the server can first determine the original radiation distribution information of the fog-free image.
[0071] In this embodiment, the original radiation distribution information of the fog-free image can be used express, Specifically, the pixel positions of the haze-free image. The original radiation distribution at that location.
[0072] Furthermore, the server can analyze the atmospheric light field distribution map and the original radiation distribution information based on the transmittance distribution map. Weighted fusion is performed to generate fog image samples corresponding to the target region. .
[0073] Specifically, in this embodiment, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0074] The expression for the atmospheric light field distribution map is as follows: ; in, Represents the pixel position of the real fog template image Atmospheric light field value at that location; For the color parameters of the fog medium; Represents the pixel position of the real fog template image Fog intensity distribution at the location; It is a nonlinear adjustment parameter used to control the distribution pattern of fog scattering intensity.
[0075] In determining the transmittance distribution map Atmospheric light field distribution map and original radiation distribution information Next, the transmittance distribution map can be generated. As a weight, the atmospheric light field distribution map and original radiation distribution information Perform weighted aggregation operations to generate fog image samples corresponding to the target region. The expression for the foggy image sample is as follows: ; in, Represents the pixel position of a foggy image sample Pixel value at; Represents the pixel position of a fog-free image The original radiation distribution at that location; Represents the pixel position of the real fog template image Atmospheric light field value at that location; Represents the pixel position of a fog-free image Transmittance at; " indicates a pixel-by-pixel multiplication operation.
[0076] As can be seen from the above formula, when the transmittance at a certain pixel position in the fog-free image is relatively high, it indicates that the fog medium has a weak influence on light, and the final fog image sample mainly retains the information of the original fog-free image; when the transmittance at a certain pixel position in the fog-free image is relatively low, it indicates that the fog medium's contribution to the scattering of ambient light is enhanced, and the fog effect in the final fog image sample is more obvious.
[0077] This method, which fuses the original radiation distribution and atmospheric light field components of a fog-free image pixel by pixel, enables continuous spatial variation of fog effects, thus making the final fog image sample visually present a foggy effect that conforms to physical laws.
[0078] In some embodiments, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0079] Optionally, in practical applications, to enhance the diversity and robustness of fog effect synthesis, the atmospheric extinction coefficient... The transmittance distribution can be selected or adjusted within a preset range to generate different fog concentration conditions, thereby adapting to different application scenarios such as light fog, medium fog, or dense fog.
[0080] In some embodiments, the spatial dimensions of the atmospheric light field distribution map are the same as those of the haze-free image, and the expression for the atmospheric light field distribution map is as follows: ; in, Represents the pixel position of the real fog template image Atmospheric light field value at that location; For the color parameters of the fog medium; Represents the pixel position of the real fog template image Fog intensity distribution at the location; It is a nonlinear adjustment parameter used to control the distribution pattern of fog scattering intensity.
[0081] It should be noted that in the above formula, the parameters... Used to describe the color characteristics of fog, through color parameters By configuring or combining different light sources, fog effects can be simulated under various lighting conditions. For example, under daytime sunlight, the fog appears to have a warmer overall tone, while under artificial light sources such as streetlights and traffic lights at night, the fog appears to have a cooler or more specific color-biased scattering effect in certain areas.
[0082] Optionally, in practical applications, to enhance the diversity and adaptability of fog effect synthesis, the color parameters of the fog medium can be adjusted during atmospheric light field modeling. and nonlinear adjustment parameters Configure or adjust settings to create atmospheric light fields with different colors, brightness, and distribution characteristics to suit different foggy environments or application needs.
[0083] Since the atmospheric light field distribution map in this embodiment is based on a real fog template image with spatial variation characteristics and the color parameters of the fog medium. The color parameters of the fog medium are jointly constructed. and nonlinear adjustment parameters Furthermore, it is adjustable, thus allowing for differences in atmospheric scattering brightness and color in different pixel locations of the final modeled fog image sample. This results in a more natural and harmonious overall image. In contrast, existing techniques that apply uniform color or brightness filters to the original image cannot produce such a natural image effect.
[0084] Optionally, in this embodiment, the atmospheric light field value at each pixel location in the atmospheric light field distribution map is not a globally fixed constant, but a light field distribution value that can vary with space, so as to more realistically reflect the non-uniformity characteristics of fog.
[0085] In some embodiments, the expression for the fog image sample corresponding to the target region is as follows: ; in, Represents the pixel position of a foggy image sample Pixel value at; Represents the pixel position of a fog-free image The original radiation distribution at that location; Represents the pixel position of the real fog template image Atmospheric light field value at that location; Represents the pixel position of a fog-free image Transmittance at that location.
[0086] Generally, in real fog scenes, the collected fog images include not only the direct radiation light from objects in the target area, but also the air light component formed by the scattering of ambient light by the fog medium, and these air light components can be described by the atmospheric light field.
[0087] Based on the above principles, to simulate the lighting effects in a foggy image, it is necessary to consider not only the atmospheric light field but also the radiation distribution of the original fog-free image. That is, in a foggy environment, the actual imaging result should be determined by both the direct radiation component of objects in the target area and the air light component formed by the scattering of ambient light by the fog medium. Therefore, after generating the transmittance distribution map and the atmospheric light field distribution map, the server can first determine the original radiation distribution information of the fog-free image.
[0088] In this embodiment, the original radiation distribution information of the fog-free image can be used express, Specifically, the pixel positions of the haze-free image. The original radiation distribution at that location.
[0089] Furthermore, the server can analyze the atmospheric light field distribution map and the original radiation distribution information based on the transmittance distribution map. Weighted fusion is performed to generate fog image samples corresponding to the target region. .
[0090] Specifically, in this embodiment, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0091] The expression for the atmospheric light field distribution map is as follows: ; in, Represents the pixel position of the real fog template image Atmospheric light field value at that location; For the color parameters of the fog medium; Represents the pixel position of the real fog template image Fog intensity distribution at the location; It is a nonlinear adjustment parameter used to control the distribution pattern of fog scattering intensity.
[0092] In determining the transmittance distribution map Atmospheric light field distribution map and original radiation distribution information Next, the transmittance distribution map can be generated. As a weight, the atmospheric light field distribution map and original radiation distribution information Perform weighted aggregation operations to generate fog image samples corresponding to the target region. The expression for the foggy image sample is as follows: ; in, Represents the pixel position of a foggy image sample Pixel value at; Represents the pixel position of a fog-free image The original radiation distribution at that location; Represents the pixel position of the real fog template image Atmospheric light field value at that location; Represents the pixel position of a fog-free image Transmittance at; " indicates a pixel-by-pixel multiplication operation.
[0093] As can be seen from the above formula, when the transmittance at a certain pixel position in the fog-free image is relatively high, it indicates that the fog medium has a weak influence on light, and the final fog image sample mainly retains the information of the original fog-free image; when the transmittance at a certain pixel position in the fog-free image is relatively low, it indicates that the fog medium's contribution to the scattering of ambient light is enhanced, and the fog effect in the final fog image sample is more obvious.
[0094] This method, which fuses the original radiation distribution and atmospheric light field components of a fog-free image pixel by pixel, enables continuous spatial variation of fog effects, thus making the final fog image sample visually present a foggy effect that conforms to physical laws.
[0095] The server can generate fog image samples of different target areas in batches using the above method, thereby realizing large-scale and controllable fog image sample generation and dataset construction.
[0096] Specifically, for each foggy image sample, the server can associate and organize the foggy image sample with its corresponding original fog-free image, depth distribution map, and fog intensity parameters to form a structured training dataset, and output it to a specified storage location for subsequent model training, algorithm testing, or simulation evaluation. For example, in visual algorithm training and data augmentation scenarios, or in intelligent transportation and road monitoring algorithm testing scenarios, these foggy image samples can be effectively utilized by the model.
[0097] Compared with existing technologies, the fog image sample generation method provided in this embodiment can automatically generate fog image samples that conform to physical laws in batches, which can significantly reduce the acquisition cost of real fog image samples. Moreover, the fog effect of the fog image samples can change with the depth of field, resulting in a strong sense of realism. At the same time, this method supports the flexible generation of fog image samples of different levels by adjusting the atmospheric extinction coefficient, realizing fine control over fog intensity and visibility. In addition, since the generated fog image samples have high sample quality, it is beneficial to improve the robustness of the visual model in foggy scenes and enhance the model's adaptability to complex meteorological conditions.
[0098] To verify the technical effectiveness of the fog image sample generation method provided in this embodiment, this section combines... Figures 3 to 5 Please provide an explanation.
[0099] Assuming the target area is a body of water, and the body of water is photographed under fog-free conditions, a fog-free image of the body of water is obtained. Figure 3 This is the original, fog-free image of the water area; for Figure 3 Depth estimation can be performed on the original fog-free image to generate... Figure 4 The depth-of-field distribution map shown; using Figure 4 The depth-of-field distribution map and atmospheric extinction coefficient shown are for Figure 3 The image shown is subjected to pixel-by-pixel transmittance modeling to generate a transmittance distribution map. Simultaneously, atmospheric light field modeling is performed on a real foggy template image to generate an atmospheric light field distribution map. Then, using the transmittance distribution map and the atmospheric light field distribution map, fog effect compositing is applied to the fog-free image to generate... Figure 5 The fog image sample shown is... Figure 5 The fog image samples shown do not exhibit obvious artifacts, and the fog effect distribution is natural and harmonious.
[0100] The present invention also provides an apparatus for generating foggy image samples. Please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of the fog image sample generation device provided by the present invention. In this embodiment, the fog image sample generation device includes an acquisition module 610, a transmittance modeling module 620, an atmospheric light field modeling module 630, and a sample generation module 640.
[0101] The acquisition module 610 is used to acquire fog-free images and real fog template images.
[0102] Fog-free images are obtained by taking pictures of the target area under conditions where there is no fog.
[0103] The transmittance modeling module 620 is used to model the transmittance of haze-free images and generate a transmittance distribution map of the haze-free images.
[0104] Transmittance distribution maps are used to characterize the situation where light in a target area is not scattered or absorbed after propagation in a fog medium.
[0105] The atmospheric light field modeling module 630 is used to model the atmospheric light field of a real fog template image and generate an atmospheric light field distribution map.
[0106] Atmospheric light field distribution maps are used to characterize the spatial distribution of the scattering contribution of fog media to ambient light.
[0107] The sample generation module 640 is used to perform fog effect synthesis processing on fog-free images based on the transmittance distribution map and the atmospheric light field distribution map, and generate fog image samples corresponding to the target area.
[0108] In some embodiments, transmitting light modeling is performed on a fog-free image to generate a transmitting light distribution map of the fog-free image, including: performing depth estimation on the fog-free image to generate a depth distribution map of the fog-free image; the depth distribution map is used to characterize the relative distance information between different pixel positions of the fog-free image and the imaging device; based on the depth distribution map and the atmospheric extinction coefficient, pixel-by-pixel transmitting light modeling is performed on the fog-free image to generate a transmitting light distribution map of the fog-free image; the atmospheric extinction coefficient is used to characterize the concentration and intensity of fog.
[0109] In some embodiments, based on the transmittance distribution map and the atmospheric light field distribution map, fog effect synthesis processing is performed on the fog-free image to generate a fog image sample corresponding to the target area, including: determining the original radiation distribution information of the fog-free image; and performing a weighted aggregation operation on the atmospheric light field distribution map and the original radiation distribution information based on the transmittance distribution map to obtain a fog image sample corresponding to the target area.
[0110] In some embodiments, the expression for the transmittance distribution map is as follows: ; in, Represents the pixel position of a fog-free image Transmittance at that location; It is a natural constant; Atmospheric extinction coefficient; Represents the pixel position of a fog-free image The relative distance between the device and the imaging equipment.
[0111] In some embodiments, the spatial dimensions of the atmospheric light field distribution map are the same as those of the haze-free image, and the expression for the atmospheric light field distribution map is as follows: ; in, Represents the pixel position of the real fog template image Atmospheric light field value at that location; For the color parameters of the fog medium; Represents the pixel position of the real fog template image Fog intensity distribution at the location; This is a non-linear adjustment parameter.
[0112] In some embodiments, the expression for the fog image sample corresponding to the target region is as follows: ; in, Represents the pixel position of a foggy image sample Pixel value at; Represents the pixel position of a fog-free image The original radiation distribution at that location; Represents the pixel position of the real fog template image Atmospheric light field value at that location; Represents the pixel position of a fog-free image Transmittance at that location.
[0113] The present invention also provides an electronic device. Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 7 As shown, the electronic device may include a processor 710, a communication interface 720, a memory 730, and a communication bus 740. The processor 710, communication interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a fog image sample generation method. The fog image sample generation method includes: acquiring a fog-free image and a real fog template image; the fog-free image is obtained by photographing the target area under fog-free conditions; performing transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium; performing atmospheric light field modeling on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; and performing fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
[0114] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0115] This invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the fog image sample generation method provided by the above methods. The fog image sample generation method includes: acquiring a fog-free image and a real fog template image; the fog-free image is obtained by taking a picture of the target area under fog-free conditions; performing transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium; performing atmospheric light field modeling on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; and performing fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
[0116] This invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the fog image sample generation method provided by the above methods. The fog image sample generation method includes: acquiring a fog-free image and a real fog template image; the fog-free image is obtained by taking a picture of the target area under fog-free conditions; performing transmittance modeling on the fog-free image to generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium; performing atmospheric light field modeling on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; and performing fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
[0117] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating foggy image samples, characterized in that, include: Obtain fog-free images and realistic fog template images; The fog-free image was obtained by taking pictures of the target area under fog-free conditions; Transmittance modeling is performed on the haze-free image to generate a transmittance distribution map of the haze-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the haze medium; An atmospheric light field model is performed on the real fog template image to generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; Based on the transmittance distribution map and the atmospheric light field distribution map, fog effect synthesis processing is performed on the fog-free image to generate a fog image sample corresponding to the target area.
2. The method for generating foggy image samples according to claim 1, characterized in that, The step of performing transmittance modeling on the haze-free image to generate a transmittance distribution map of the haze-free image includes: Depth estimation is performed on the fog-free image to generate a depth distribution map of the fog-free image; the depth distribution map is used to characterize the relative distance information between different pixel positions of the fog-free image and the imaging device; Based on the depth-of-field distribution map and the atmospheric extinction coefficient, pixel-by-pixel transmittance modeling is performed on the fog-free image to generate the transmittance distribution map of the fog-free image; the atmospheric extinction coefficient is used to characterize the concentration and intensity of fog.
3. The method for generating foggy image samples according to claim 1, characterized in that, The process of performing fog effect compositing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area includes: Determine the original radiation distribution information of the haze-free image; Based on the transmittance distribution map, a weighted aggregation operation is performed on the atmospheric light field distribution map and the original radiation distribution information to obtain the fog image sample corresponding to the target area.
4. The method for generating foggy image samples according to claim 2, characterized in that, The expression for the transmittance distribution map is as follows: ; in, Indicates the pixel position of the haze-free image Transmittance at that location; It is a natural constant; The atmospheric extinction coefficient is mentioned above. Indicates the pixel position of the haze-free image The relative distance between the imaging device and the imaging device.
5. The method for generating foggy image samples according to claim 1, characterized in that, The spatial dimensions of the atmospheric light field distribution map are the same as those of the haze-free image, and the expression for the atmospheric light field distribution map is as follows: ; in, Indicates the pixel position of the real fog template image Atmospheric light field value at that location; The color parameters of the fog medium; Indicates the pixel position of the real fog template image Fog intensity distribution at the location; This is a non-linear adjustment parameter.
6. The method for generating foggy image samples according to claim 3, characterized in that, The expression for the fog image sample corresponding to the target region is as follows: ; in, Indicates the pixel position of the fog image sample Pixel value at; Indicates the pixel position of the haze-free image The original radiation distribution at that location; Indicates the pixel position of the real fog template image Atmospheric light field value at that location; Indicates the pixel position of the haze-free image Transmittance at that location.
7. A device for generating foggy image samples, characterized in that, include: The acquisition module is used to acquire fog-free images and real fog template images; The fog-free image was obtained by taking pictures of the target area under fog-free conditions; The transmittance modeling module is used to perform transmittance modeling on the fog-free image and generate a transmittance distribution map of the fog-free image; the transmittance distribution map is used to characterize the situation where light in the target area is not scattered or absorbed after propagation in the fog medium. An atmospheric light field modeling module is used to model the atmospheric light field of the real fog template image and generate an atmospheric light field distribution map; the atmospheric light field distribution map is used to characterize the spatial distribution of the scattering contribution of the fog medium to ambient light; The sample generation module is used to perform fog effect synthesis processing on the fog-free image based on the transmittance distribution map and the atmospheric light field distribution map to generate a fog image sample corresponding to the target area.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the fog image sample generation method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the fog image sample generation method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the fog image sample generation method as described in any one of claims 1 to 6.