Image processing method and device

By obtaining the depth information and air illumination parameters in the original image, combined with the random noise generation algorithm, the fog map is automatically generated, which solves the problem of high cost of manual data acquisition in the existing technology and improves the generalization ability of the model in real scenes.

CN113570613BActive Publication Date: 2025-01-17ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010358515.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-04-29
Publication Date
2025-01-17
Estimated Expiration
2040-04-29

AI Technical Summary

Technical Problem

In the prior art, training a neural network model requires a large amount of manual collection and labeling of data, resulting in high labor costs and generalization ability depends on the amount of data, making it difficult to generalize in real scenarios.

Method used

By obtaining the depth information of the target object in the original image and the air illumination parameters, combining the random noise generation algorithm and preset air scattering parameters, the mist map is automatically generated, increasing the amount of training data and improving the generalization ability of the model.

Benefits of technology

The labor workload is reduced, and the generated fog map conforms to the natural distribution of foggy scenes in reality, improves the generalization ability of the model in real scenes, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113570613B_ABST
    Figure CN113570613B_ABST
Patent Text Reader

Abstract

The present application provides an image processing method and device. The air transmittance corresponding to the target object is obtained according to the depth information of the target object in the original image, the random noise generation algorithm and the preset air scattering parameters; the fog map is generated according to the air transmittance, the air illumination parameters in the original image and the original image. Through the present application, the fog map can be automatically generated according to the original image, so that the amount of training data used to train the model can be increased, and the fog in the fog map generated by combining the depth information of the target object and the random noise generation algorithm conforms to the real foggy scene in reality, such as the fog in the fog map is non-uniformly distributed, the fog distribution is more random and more natural, etc., so as to improve the generalization ability of the trained model in the real foggy scene in reality. And when generating the fog map according to the original image, no manual participation is required, so that the manual workload can be reduced, and then the labor cost can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method and device. Background Art

[0002] Artificial intelligence algorithms based on neural network models, such as machine learning, have been widely used in related fields such as video imaging, speech recognition, and natural language processing due to their super fitting capabilities and end-to-end global optimization capabilities.

[0003] However, the generalization ability of the neural network model depends on the amount of training data used to train the neural network model. The more training data, the higher the generalization ability of the trained neural network model.

[0004] In this way, before training the neural network model, a large amount of training data needs to be prepared. However, in the existing technology, it is currently necessary to manually collect and label the training data. However, the collection and labeling of a large amount of training data requires a very large amount of manual work, resulting in high labor costs. Summary of the invention

[0005] In order to reduce manual workload and thus reduce labor costs, the present application shows an image processing method and device.

[0006] In a first aspect, the present application provides an image processing method, the method comprising:

[0007] Obtain the depth information of the target object in the original image;

[0008] Acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter;

[0009] Get the air illumination parameters in the original image;

[0010] A fog map is generated according to the air transmittance, the air illumination parameter and the original image.

[0011] In an optional implementation, acquiring the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter includes:

[0012] determining the type of the target object;

[0013] Selecting a preset air scattering parameter suitable for the type of object from among a plurality of preset air scattering parameters;

[0014] The air transmittance corresponding to the target object is obtained according to the depth information, a random noise generation algorithm and a selected preset air scattering parameter.

[0015] In an optional implementation, determining the type of the target object includes:

[0016] The original image is input into a semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

[0017] In an optional implementation, selecting, from a plurality of preset air scattering parameters, a preset air scattering parameter applicable to the type of object comprises:

[0018] In the correspondence between the type of the object and the preset air scattering parameter, the preset air scattering parameter corresponding to the type is searched.

[0019] In an optional implementation, acquiring the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter includes:

[0020] Generate a random noise image corresponding to the original image according to the random noise generation algorithm;

[0021] Acquire the position of the target object in the original image;

[0022] Acquire noise data at the position in the random noise map;

[0023] The air transmittance corresponding to the target object is acquired according to the depth information, the noise data and the preset air scattering parameter.

[0024] In an optional implementation, acquiring the air transmittance corresponding to the target object according to the depth information, the noise data and the preset air scattering parameter includes:

[0025] Calculating the square of the product of the depth information and the noise data to obtain a first value;

[0026] Calculate the first value of a preset base to the power of the first value to obtain a second value;

[0027] The reciprocal of the second value is calculated to obtain the air transmittance.

[0028] In an optional implementation, generating the random noise image corresponding to the original image according to the random noise generation algorithm includes:

[0029] generating at least two random candidate noise patterns of different frequencies based on a random noise generation algorithm;

[0030] At least two random candidate noise images of different frequencies are superimposed to obtain a random noise image corresponding to the original image.

[0031] In an optional implementation, generating a fog image according to the air transmittance, the air illumination parameter and the original image includes:

[0032] According to the air transmittance, obtaining a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation;

[0033] According to the air transmittance, obtaining a second illumination parameter after the air illumination parameter is attenuated by air propagation;

[0034] The fog image is generated according to the first lighting parameter, the second lighting parameter and the original image.

[0035] In an optional implementation, obtaining, according to the air transmittance, a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation, includes:

[0036] The product of the illumination parameter of the light reflected by the target object in the original image and the air transmittance is calculated to obtain the first illumination parameter.

[0037] In an optional implementation, obtaining, according to the air transmittance, a second illumination parameter after the air illumination parameter is attenuated by air propagation includes:

[0038] The product of the air illumination parameter and the air transmittance is calculated to obtain the second illumination parameter.

[0039] In an optional implementation, generating the fog image according to the first illumination parameter, the second illumination parameter and the original image includes:

[0040] The illumination parameter of the light reflected by the target object in the original image is adjusted to the sum of the first illumination parameter and the second illumination parameter to obtain the fog image.

[0041] In an optional implementation, the step of obtaining the depth information of the target object in the original image includes:

[0042] The original image is input into the depth information recognition model to obtain the depth information output by the depth information recognition model.

[0043] In an optional implementation, obtaining air illumination parameters in the original image includes:

[0044] Obtaining illumination parameters of light reflected by each pixel in the original image;

[0045] The maximum illumination parameter is determined as the air illumination parameter.

[0046] In a second aspect, the present application provides an image processing device, the device comprising:

[0047] A first acquisition module is used to acquire depth information of a target object in an original image;

[0048] A second acquisition module, configured to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter;

[0049] The third acquisition module is used to obtain air illumination parameters in the original image;

[0050] A generation module is used to generate a fog image according to the air transmittance, the air illumination parameter and the original image.

[0051] In an optional implementation, the second acquisition module includes:

[0052] A first determining unit, configured to determine the type of the target object;

[0053] A selection unit, configured to select a preset air scattering parameter suitable for the type of object from a plurality of preset air scattering parameters;

[0054] The first acquisition unit is used to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a selected preset air scattering parameter.

[0055] In an optional implementation, the determining unit is specifically configured to: input the original image into a semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

[0056] In an optional implementation manner, the selection unit is specifically configured to: search for a preset air scattering parameter corresponding to the type of the object in a corresponding relationship between the type of the object and the preset air scattering parameter.

[0057] In an optional implementation, the first acquiring unit includes:

[0058] A generating subunit, configured to generate a random noise image corresponding to the original image according to the random noise generating algorithm;

[0059] A first acquisition subunit, used to acquire the position of the target object in the original image;

[0060] A second acquisition subunit is used to acquire noise data at the position in the random noise map;

[0061] The third acquisition subunit is used to acquire the air transmittance corresponding to the target object according to the depth information, the noise data and the preset air scattering parameter.

[0062] In an optional implementation, the third acquisition subunit is specifically used to: calculate the square of the product of the depth information and the noise data to obtain a first value; calculate the power of the first value of a preset base to obtain a second value; calculate the reciprocal of the second value to obtain the air transmittance.

[0063] In an optional implementation, the generating subunit is specifically used to: generate at least two random candidate noise images with different frequencies based on a random noise generation algorithm; and superimpose at least two random candidate noise images with different frequencies to obtain a random noise image corresponding to the original image.

[0064] In an optional implementation, the generating module includes:

[0065] A second acquisition unit is used to acquire, according to the air transmittance, a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation;

[0066] A third acquisition unit is used to acquire, according to the air transmittance, a second illumination parameter of the air illumination parameter after the air illumination parameter is attenuated by air propagation;

[0067] A generating unit is used to generate the fog image according to the first lighting parameter, the second lighting parameter and the original image.

[0068] In an optional implementation, the second acquisition unit is specifically configured to calculate the product of an illumination parameter of light reflected by the target object in the original image and the air transmittance to obtain the first illumination parameter.

[0069] In an optional implementation, the third acquisition unit is specifically used to: calculate the product of the air illumination parameter and the air transmittance to obtain the second illumination parameter.

[0070] In an optional implementation, the generating unit is specifically configured to: adjust an illumination parameter of light reflected by the target object in the original image to a sum of the first illumination parameter and the second illumination parameter, so as to obtain the fog image.

[0071] In an optional implementation, the first acquisition module is specifically used to: input the original image into a depth information recognition model to obtain the depth information output by the depth information recognition model.

[0072] In an optional implementation, the third acquisition module includes:

[0073] A fourth acquisition unit, used to acquire illumination parameters of light reflected by each pixel in the original image;

[0074] The second determining unit is configured to determine the maximum illumination parameter as the air illumination parameter.

[0075] In a third aspect, the present application shows an electronic device, the electronic device comprising:

[0076] Processor; and

[0077] A memory having executable codes stored thereon, which, when executed, enables the processor to execute the image processing method as described in the first aspect.

[0078] In a fourth aspect, the present application shows one or more machine-readable media on which executable codes are stored. When the executable codes are executed, the processor executes the image processing method as described in the first aspect.

[0079] Compared with the prior art, the embodiments of the present application have the following advantages:

[0080] In the present application, the depth information of the target object in the original image is obtained; the air transmittance corresponding to the target object is obtained according to the depth information, the random noise generation algorithm and the preset air scattering parameters; the air illumination parameters in the original image are obtained; and a fog map is generated according to the air transmittance, the air illumination parameters and the original image. Through the present application, a fog map can be automatically generated according to the original image, thereby increasing the amount of training data used to train the model, and the fog in the fog map generated by combining the depth information of the target object and the random noise generation algorithm conforms to the real foggy scene in reality, for example, the fog in the fog map is non-uniformly distributed, the fog distribution is more random and more natural, etc., thereby improving the generalization ability of the trained model in the real foggy scene in reality after it goes online. And when generating a fog map according to the original image, no human participation is required, so compared with the prior art, the present application can reduce the manual workload and thus reduce the labor cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] Figure 1 It is a flowchart of an image processing method shown in an exemplary embodiment of the present application.

[0082] Figure 2 It is a flowchart of a method for obtaining air transmittance shown in an exemplary embodiment of the present application.

[0083] Figure 3 It is a structural block diagram of an image processing device shown in an exemplary embodiment of the present application.

[0084] Figure 4It is a schematic diagram of the structure of a device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0085] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0086] Reference Figure 1 , shows a schematic flow chart of an image processing method of the present application, the method is applied in an electronic device, and the method may include:

[0087] In step S101, the depth information of the target object in the original image is obtained;

[0088] In one embodiment of the present application, assuming that the original image is obtained based on camera photography, the depth information of the target object includes the distance between the target object and the camera, etc.

[0089] There is at least one target object in the original image.

[0090] Target objects may include cars, people, bicycles, pets, numbers, buildings, roads, mountains, rivers, etc.

[0091] In the present application, in one scenario, it is necessary to increase the amount of training data used to train the model, thereby improving the generalization ability of the trained model.

[0092] In order to increase the amount of training data used to train the model without increasing labor costs, it is necessary to automatically generate training data for training the model. In one method, fog can be added to the original image to obtain a fog map. When training the model, the original image and the fog map can be combined to train the model, wherein the fog map and the original image can be regarded as different images, and the annotation data of the fog map can be the same as the annotation data of the original image.

[0093] Among them, in a real foggy scene in reality, the fog is distributed in the real space, and the fog is not evenly distributed in the real space, but non-uniformly distributed in the real space, for example, the concentration of fog distributed in different parts of the space is not the same.

[0094] For example, the farther the object is from the camera, the more fog is contained in the space between the camera and the object, the lower the air transmittance in this space, and the higher the illumination parameter of the light reflected by the object collected by the camera, for example, the higher the brightness of the reflected light, etc. The closer the object is to the camera, the less fog is contained in the space between the camera and the object, the higher the air transmittance in this space, and the lower the illumination parameter of the light reflected by the object collected by the camera, for example, the lower the brightness of the reflected light, etc.

[0095] The illumination parameter of the light reflected by the object includes the brightness of the light reflected by the object.

[0096] If the fog in the generated fog map used to train the model does not conform to the actual foggy scene in reality, for example, the fog in the fog map is evenly distributed, the generalization ability of the model obtained by combining the original image and the fog map for training will be low.

[0097] For example, after the model obtained by training the original image and the fog image with uniform fog distribution is put online, the model has a higher business recognition ability for objects in the image with uniform fog, that is, the model has a lower business recognition ability for objects in the image with uniform fog.

[0098] However, in fact, after the model is launched, if there is fog in the image that the model needs to recognize, the fog is often non-uniformly distributed. However, the model's business recognition ability for objects in images with non-uniform fog is low, resulting in low generalization ability of the model.

[0099] Therefore, in order to improve the generalization ability of the model, it is necessary to make the fog in the fog map generated based on the original image in this application consistent with the real foggy scene in reality, for example, the fog in the fog map is non-uniformly distributed, the fog distribution is more random and more natural, etc.

[0100] In order to make the fog in the fog map generated based on the original image in the present application conform to the real foggy scene in reality, it is necessary to obtain the depth information of the target object in the original image and then execute step S102.

[0101] In an optional manner, in the present application, the depth information of the target object can be determined based on a depth information recognition model.

[0102] The depth information recognition model may be trained in advance, and the training process includes: obtaining a sample data set, the sample data set includes a plurality of sample images, the plurality of sample images include sample objects, and the sample data set also includes annotated depth information of the sample objects.

[0103] Then, the model is trained according to the sample data set until the parameters in the model converge, thereby obtaining a deep information recognition model, wherein the model includes a U-net model and the like.

[0104] Thus, in this step, the original image may be input into the depth information recognition model to obtain the depth information of each target object in the original image output by the depth information recognition model.

[0105] In another embodiment of the present application, a technician can manually specify a target object in the original image, and the electronic device obtains the target object specified by the technician in the original image, and then obtains depth information of the target object.

[0106] Alternatively, in another embodiment of the present application, a technician can manually specify an area in the original image where fog needs to be added, and the electronic device identifies a target object in the original image that is located in the area, and then obtains depth information of the target object.

[0107] In step S102, the air transmittance corresponding to the target object is obtained according to the depth information, the random noise generation algorithm and the preset air scattering parameters;

[0108] In one embodiment of the present application, a technician may calculate appropriate air scattering parameters in advance according to actual air conditions, and store the parameters as preset air scattering parameters in the electronic device.

[0109] Alternatively, in another embodiment of the present application, a technician may also search for air scattering parameters commonly used in the industry and store them as preset air scattering parameters in the electronic device.

[0110] Thus, in this step, the electronic device can directly obtain the stored preset air scattering parameters.

[0111] The random noise generation algorithms in this application include Gaussian random noise generation algorithm, Perlin random noise generation algorithm and salt and pepper random noise generation algorithm, etc. This application does not limit the random noise generation algorithm.

[0112] The random noise generation algorithm in the present application is to control the air transmittance at different positions on the plane perpendicular to the camera's viewing angle in the image to be different, so that the illumination parameters of the light reflected by objects at different positions in the image are different, thereby making the fog displayed in the image uneven and more natural.

[0113] The lower the air transmittance corresponding to the target object is, the higher the illumination parameter of the light reflected by the target object is, for example, the higher the brightness of the reflected light is.

[0114] The higher the air transmittance corresponding to the target object is, the lower the illumination parameter of the light reflected by the target object is, for example, the lower the brightness of the reflected light is.

[0115] For details of this step, please refer to the following Figure 2 The illustrated embodiment will not be described in detail here.

[0116] In step S103, the air illumination parameters in the original image are obtained;

[0117] Air illumination includes background light formed by the scattering of light sources such as sunlight by scattering media in the air.

[0118] Air illumination parameters include the brightness of air illumination, for example, the brightness of background light formed by the scattering of light sources such as sunlight by scattering media in the air.

[0119] Air illumination parameters are often greater than illumination parameters of light reflected by a target object. For example, the brightness of air illumination is often greater than the brightness of light reflected by a target object.

[0120] For example, assuming that the original image is captured by a camera, when the original image is captured by the camera, the brightness of light sources such as sunlight that reaches the camera after scattering can be an air lighting parameter, etc.

[0121] Among them, the attenuation degree of light sources such as sunlight after scattering at different positions is not the same. Therefore, in an optional method, the lighting parameters of the light reflected by each pixel in the original image can be obtained, and then the maximum lighting parameter can be determined as the air lighting parameter.

[0122] In step S104, a fog map is generated according to the air transmittance, air illumination parameters and the original image.

[0123] This step can be implemented through the following process, including:

[0124] 1041. According to the air transmittance, obtain a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation;

[0125] In the present application, the product of the illumination parameter of the light reflected by the target object in the original image and the air transmittance may be calculated to obtain the first illumination parameter.

[0126] The illumination parameters of the light reflected by the target object include the brightness of the reflected light, etc.

[0127] The target object in the original image is composed of multiple pixels, and for any pixel included in the target object in the original image, the product of the illumination parameter of the reflected light of the pixel and the air transmittance can be calculated to obtain the first illumination parameter. The same is true for each other pixel included in the target object in the original image.

[0128] In this application, a pixel point can represent the pixel value in RGB format, that is, a pixel point has three channels, namely, a red channel, a green channel and a blue channel, and each channel has its own illumination parameters. In this way, the first illumination parameter of the pixel point includes the illumination parameters of the light reflected by the pixel point in the red channel, the illumination parameters of the green channel and the illumination parameters of the blue channel, for example, including the brightness of the light reflected by the pixel point in the red channel, the brightness in the green channel and the brightness in the blue channel, etc.

[0129] In this way, when calculating the product between the illumination parameters of the light reflected by the pixel and the air transmittance to obtain the first illumination parameter, the product between the illumination parameters of the light reflected by the pixel in the red channel and the air transmittance can be calculated, the product between the illumination parameters of the light reflected by the pixel in the green channel and the air transmittance can be calculated, and the product between the illumination parameters of the light reflected by the pixel in the blue channel and the air transmittance can be calculated, and the three products are all used as the first illumination parameter.

[0130] 1042. Obtain, according to the air transmittance, a second illumination parameter after the air illumination parameter is attenuated by air propagation;

[0131] In the present application, the product of the air illumination parameter and the air transmittance may be calculated to obtain the second illumination parameter.

[0132] 1043. Generate a fog image according to the first illumination parameter, the second illumination parameter, and the original image.

[0133] The illumination parameter of the light reflected by the target object in the original image is adjusted to the sum of the first illumination parameter and the second illumination parameter to obtain a fog image.

[0134] For any pixel point included in the target object in the original image, the sum of the second illumination parameter and the first illumination parameter corresponding to the pixel point can be calculated, and then the illumination parameter of the light reflected by the pixel point is adjusted to the sum of the first illumination parameter corresponding to the pixel point and the second illumination parameter. The same is done for each other pixel point included in the target object in the original image, thereby obtaining a fog map.

[0135] In this application, a pixel point can represent the pixel value in RGB format, that is, a pixel point has three channels, namely, a red channel, a green channel and a blue channel, and each channel has its own illumination parameters. In this way, the first illumination parameter of the pixel point includes the illumination parameters of the light reflected by the pixel point in the red channel, the illumination parameters of the green channel and the illumination parameters of the blue channel, for example, including the brightness of the light reflected by the pixel point in the red channel, the brightness in the green channel and the brightness in the blue channel, etc.

[0136] In this way, when calculating the sum of the second illumination parameter and the first illumination parameter corresponding to the pixel, the sum of the second illumination parameter and the illumination parameter of the light reflected by the pixel in the red channel can be calculated, the sum of the second illumination parameter and the illumination parameter of the light reflected by the pixel in the green channel can be calculated, and the sum of the second illumination parameter and the illumination parameter of the light reflected by the pixel in the blue channel can be calculated.

[0137] In the present application, the depth information of the target object in the original image is obtained; the air transmittance corresponding to the target object is obtained according to the depth information, the random noise generation algorithm and the preset air scattering parameters; the air illumination parameters in the original image are obtained; and a fog map is generated according to the air transmittance, the air illumination parameters and the original image. Through the present application, a fog map can be automatically generated according to the original image, thereby increasing the amount of training data used to train the model, and the fog in the fog map generated by combining the depth information of the target object and the random noise generation algorithm conforms to the real foggy scene in reality, for example, the fog in the fog map is non-uniformly distributed, the fog distribution is more random and more natural, etc., thereby improving the generalization ability of the trained model in the real foggy scene in reality after it goes online. And when generating a fog map according to the original image, no human participation is required, so compared with the prior art, the present application can reduce the manual workload and thus reduce the labor cost.

[0138] The solution in the present application can be applied to traffic scenarios and open kitchen products, etc., of course, it can also be applied to many scenarios. For example, the core point of this solution is to add fog to encrypt the image, enhance data by adding fog in face recognition scenarios, add fog effects to pictures and images in film and television post-production, and add fog effects to pictures and images in game scenes. These scenarios can all expand and apply this solution.

[0139] In addition, in another embodiment of the present application, the original image can be manually fogged using image processing software to obtain an intermediate fog image corresponding to the original image, and then the intermediate fog image is processed according to the present application. Figure 1 The scheme shown is used to perform fogging processing to obtain the final fog image.

[0140] Or, in another embodiment of the present application, in accordance with Figure 1 After the solution shown obtains the fog map corresponding to the original image, the fog map can also be manually processed using image processing software.

[0141] In another embodiment of the present application, see Figure 2 , step S102 includes:

[0142] In step S201, the type of the target object is determined;

[0143] In this application, different types of objects may be included, such as cars, people, bicycles, pets, numbers, buildings, roads, mountains, and rivers.

[0144] In the present application, the type of the target object can be determined based on the semantic segmentation model.

[0145] The semantic segmentation model may be trained in advance, and the training process includes: obtaining a sample data set, the sample data set includes a plurality of sample images, the plurality of sample images include sample objects, and the sample data set also includes labeled types of the sample objects.

[0146] The model is then trained based on the sample data set until the parameters in the model converge, thereby obtaining a semantic segmentation model.

[0147] Among them, the model includes deeplabv3+, CNN (Convolutional Neural Networks), FCN (Fully Convolutional Networks), and so on.

[0148] Thus, in this step, the original image can be input into the semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

[0149] In step S202, a preset air scattering parameter suitable for an object of the type of the target object is selected from a plurality of preset air scattering parameters;

[0150] In the aforementioned embodiment, when generating a fog image, each type of target object in the original image uses the same preset air scattering parameter, so that the reflection effect of the reflected light of each type of target object is consistent.

[0151] However, in real foggy scenes in reality, the reflection effects of light reflected from different types of objects are not the same. For example, the reflection effect of light reflected from the road surface is usually diffuse reflection, and the reflection effect of light reflected from the car surface is usually mirror reflection, etc. Therefore, if the reflection effect of light reflected from objects in the generated fog map used to train the model does not conform to the real scene in reality, for example, the reflection effects of light reflected from target objects of different types are consistent, the generalization ability of the model obtained by combining the original image and the fog map for training will be low.

[0152] For example, after the model is put online and trained by combining the original image and the fog image with the same reflection effect of reflected light from various types of target objects, the model has a higher business recognition ability for objects in images with the same reflection effects for various types of objects. That is, the model has a lower business recognition ability for objects in images with different reflection effects for various types of objects.

[0153] However, in fact, after the model is launched, if there are multiple different types of objects in the image that the model needs to recognize, the reflection effects of the reflected light of the different types of objects are not the same. However, the model's business recognition ability for objects in images with different reflection effects of different types of objects is low.

[0154] Therefore, in order to improve the generalization ability of the model, it is necessary to make the reflection effects of light reflected by various types of objects in the fog map generated based on the original image in this application consistent with the real scene in reality. For example, the reflection effects of light reflected by different types of objects are not the same.

[0155] Therefore, in order to make the reflection effect of reflected light of various types of objects in the fog map generated based on the original image in the present application conform to the real scene in reality, since the reflection effect of reflected light can be at least determined by the preset air scattering parameters, the preset air scattering parameters suitable for this type of object can be selected from multiple preset air scattering parameters.

[0156] In another embodiment of the present application, for any type of object, the reflection effect of the reflected light of the object of the type can be determined in advance, and then the air scattering parameter corresponding to the reflection effect can be determined and used as the preset air scattering parameter applicable to the object of the type, and then the type and the preset air scattering parameter applicable to the object of the type are formed into a corresponding table item and stored in the corresponding relationship between the type of object and the preset air scattering parameter. The same is true for each other type of object.

[0157] Therefore, in this step, the preset air scattering parameters corresponding to the type of the target object may be searched in the correspondence between the type of the object and the preset air scattering parameters.

[0158] In step S203, the air transmittance corresponding to the target object is obtained according to the depth information, the random noise generation algorithm and the selected preset air scattering parameters.

[0159] This step can be implemented through the following process, including:

[0160] 2031. Generate a random noise image corresponding to the original image according to a random noise generation algorithm;

[0161] In the present application, the size of the generated noise image can be the same as the size of the original image. For example, the size of the original image is M*N, that is, there are M rows of pixels in the original image, and each row includes N pixels.

[0162] The size of the generated random noise map is M*N, that is, there are M rows of noise data in the random noise map, each row includes N noise data, and the noise data can be a value in the interval (0,1), etc.

[0163] The position of each pixel in the original image corresponds one-to-one to the position of each noise data in the random noise image.

[0164] The larger the noise data at a certain position in the random noise image, the lower the air transmittance at the position in the original image, or in other words, the higher the concentration of fog generated at the position in the original image.

[0165] The smaller the noise data at a certain position in the random noise image, the higher the air transmittance at the position in the original image, or in other words, the lower the concentration of fog generated at the position in the original image.

[0166] However, since the random noise map in the present application is generated according to a random noise generation algorithm, a situation may occur: the difference between two adjacent noise data in the generated random noise map is large. For example, one of the two adjacent noise data is 0.95 and the other is 0.01. This results in a very large difference in fog concentration between two adjacent positions in the generated fog map.

[0167] There are many such cases in the generated random noise map, that is, there are many places in the generated fog map where the difference between the fog concentrations in two adjacent positions is very large, which makes the generated fog map visually unnatural and does not conform to the real foggy scene in reality.

[0168] Among them, in a real foggy scene in reality, even if there is a difference in the concentration of fog at adjacent positions, the difference is very small, that is, in a real foggy scene in reality, the concentration of fog has a smooth transition.

[0169] If the fog in the generated fog map used to train the model does not conform to the actual foggy scene in reality, for example, the difference between the fog concentrations at adjacent positions in the generated fog map used to train the model is very large, or even there are multiple places in the generated fog map where the difference between the fog concentrations at two adjacent positions is very large, then the generalization ability of the model trained by combining the original image and the fog map will be low.

[0170] For example, after the model is put online and trained by combining the original image and a fog image with multiple places where the difference in fog concentration between two adjacent locations is very large, the model has a high business recognition ability for objects in the image with multiple places where the difference in fog concentration between two adjacent locations is very large. In other words, the model has a low business recognition ability for objects in the image with multiple places where the difference in fog concentration between two adjacent locations is very small.

[0171] However, in fact, after the model is launched, if there is fog in the image that the model needs to recognize, the difference between the fog concentration in two adjacent positions is often very small, that is, the fog concentration has a smooth transition. However, the model has a low business recognition ability for objects in images where there are many places where the difference between the fog concentration in two adjacent positions is very small.

[0172] Therefore, in order to improve the generalization ability of the model, it is necessary to make the fog in the fog map generated based on the original image in this application consistent with the real foggy scene in reality. For example, the difference between the fog concentrations in two adjacent positions in the fog map is often very small, that is, the fog concentration in the fog map is smoothly transitioned, and the transition of the fog concentration is more random and natural.

[0173] Therefore, in order to make the fog in the fog map generated based on the original image in the present application conform to the real foggy scene in reality, when generating the random noise map corresponding to the original image according to the random noise generation algorithm, at least two random candidate noise maps with different frequencies can be generated based on the random noise generation algorithm; the at least two random candidate noise maps with different frequencies are superimposed to obtain the random noise map corresponding to the original image.

[0174] In one embodiment, when at least two random candidate noise patterns of different frequencies can be generated based on a random noise generation algorithm, the random noise pattern can be generated according to a Perlin random noise generation algorithm.

[0175] The parameters that control Perlin noise include: scale, octave, lacunarity, and persistence.

[0176] Scale represents the distance from which the random noise image is viewed. Octave represents the degree of detail retained in the generated random noise image. Lacunarity represents the adaptive control of the frequency in each octave. Persistence represents the contribution of each octave to the overall random noise image.

[0177] Through experiments, technicians have found that the octave in the Berlin Perlin random noise generation algorithm can be set to 1, and the lacunarity can be set to 2. When the octave is 1, the value of persistence can be set randomly. In this way, when generating at least two random candidate noise images with different frequencies based on the random noise generation algorithm, it is only necessary to adjust the value of scale.

[0178] Specifically, candidate random noise maps with the same size as the original image can be generated at different scales according to the Perlin random noise generation algorithm, and then the noise data at the same position in multiple candidate random noise maps are added to obtain a new random noise map, which is used as the random noise map corresponding to the original image.

[0179] 2032. Obtain the position of the target object in the original image;

[0180] In the present application, the target object in the original image is composed of multiple pixels, and each pixel has its own position in the original image. Therefore, the position of each pixel constituting the target object in the original image can be obtained.

[0181] 2033. Obtain noise data at the position in the random noise map;

[0182] 2034. Obtain air transmittance corresponding to the target object according to the depth information, the noise data, and a preset air scattering parameter.

[0183] In one embodiment of the present application, for noise data located at any acquired position, the square of the product between the depth information and the noise data can be calculated to obtain a first value; then the power of the first value of the preset base is calculated to obtain a second value, wherein the preset base includes e, etc., and e includes natural numbers such as 2.71828183, and then the reciprocal of the second value is calculated to obtain the air transmittance corresponding to the position in the original image. The above operation is also performed for noise data located at each other acquired position. Thus, the air transmittance corresponding to each acquired position in the original image is obtained; then the air transmittance corresponding to each acquired position in the original image is combined into the air transmittance corresponding to the target object.

[0184] Reference Figure 3 , shows a structural block diagram of an embodiment of an image processing device of the present application, which may specifically include the following modules:

[0185] A first acquisition module 11 is used to acquire depth information of a target object in an original image;

[0186] A second acquisition module 12, configured to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter;

[0187] The third acquisition module 13 is used to obtain air illumination parameters in the original image;

[0188] The generating module 14 is used to generate a fog image according to the air transmittance, the air illumination parameter and the original image.

[0189] In an optional implementation, the second acquisition module includes:

[0190] A first determining unit, configured to determine the type of the target object;

[0191] A selection unit, configured to select a preset air scattering parameter suitable for the type of object from a plurality of preset air scattering parameters;

[0192] The first acquisition unit is used to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a selected preset air scattering parameter.

[0193] In an optional implementation, the determining unit is specifically configured to: input the original image into a semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

[0194] In an optional implementation manner, the selection unit is specifically configured to: search for a preset air scattering parameter corresponding to the type of the object in a corresponding relationship between the type of the object and the preset air scattering parameter.

[0195] In an optional implementation, the first acquiring unit includes:

[0196] A generating subunit, configured to generate a random noise image corresponding to the original image according to the random noise generating algorithm;

[0197] A first acquisition subunit, used to acquire the position of the target object in the original image;

[0198] A second acquisition subunit is used to acquire noise data at the position in the random noise map;

[0199] The third acquisition subunit is used to acquire the air transmittance corresponding to the target object according to the depth information, the noise data and the preset air scattering parameter.

[0200] In an optional implementation, the third acquisition subunit is specifically used to: calculate the square of the product of the depth information and the noise data to obtain a first value; calculate the power of the first value of a preset base to obtain a second value; calculate the reciprocal of the second value to obtain the air transmittance.

[0201] In an optional implementation, the generating subunit is specifically used to: generate at least two random candidate noise images with different frequencies based on a random noise generation algorithm; and superimpose at least two random candidate noise images with different frequencies to obtain a random noise image corresponding to the original image.

[0202] In an optional implementation, the generating module includes:

[0203] A second acquisition unit is used to acquire, according to the air transmittance, a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation;

[0204] A third acquisition unit is used to acquire, according to the air transmittance, a second illumination parameter of the air illumination parameter after the air illumination parameter is attenuated by air propagation;

[0205] A generating unit is used to generate the fog image according to the first lighting parameter, the second lighting parameter and the original image.

[0206] In an optional implementation, the second acquisition unit is specifically configured to calculate the product of an illumination parameter of light reflected by the target object in the original image and the air transmittance to obtain the first illumination parameter.

[0207] In an optional implementation, the third acquisition unit is specifically used to: calculate the product of the air illumination parameter and the air transmittance to obtain the second illumination parameter.

[0208] In an optional implementation, the generating unit is specifically configured to: adjust an illumination parameter of light reflected by the target object in the original image to a sum of the first illumination parameter and the second illumination parameter, so as to obtain the fog image.

[0209] In an optional implementation, the first acquisition module is specifically used to: input the original image into a depth information recognition model to obtain the depth information output by the depth information recognition model.

[0210] In an optional implementation, the third acquisition module includes:

[0211] A fourth acquisition unit, used to acquire illumination parameters of light reflected by each pixel in the original image;

[0212] The second determining unit is configured to determine the maximum illumination parameter as the air illumination parameter.

[0213] In the present application, the depth information of the target object in the original image is obtained; the air transmittance corresponding to the target object is obtained according to the depth information, the random noise generation algorithm and the preset air scattering parameters; the air illumination parameters in the original image are obtained; and a fog map is generated according to the air transmittance, the air illumination parameters and the original image. Through the present application, a fog map can be automatically generated according to the original image, thereby increasing the amount of training data used to train the model, and the fog in the fog map generated by combining the depth information of the target object and the random noise generation algorithm conforms to the real foggy scene in reality, for example, the fog in the fog map is non-uniformly distributed, the fog distribution is more random and more natural, etc., thereby improving the generalization ability of the trained model in the real foggy scene in reality after it goes online. And when generating a fog map according to the original image, no human participation is required, so compared with the prior art, the present application can reduce the manual workload and thus reduce the labor cost.

[0214] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0215] The present application embodiment provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments. In the present application embodiment, the electronic device includes a server, a gateway, a sub-device, etc., and the sub-device is an Internet of Things device or other device.

[0216] The embodiments of the present disclosure may be implemented as an apparatus configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the apparatus may include electronic devices such as servers (clusters), terminal devices such as IoT devices, and the like.

[0217] Figure 4 An exemplary apparatus 1300 that can be used to implement various embodiments described in this application is schematically shown.

[0218] For one embodiment, Figure 4 An exemplary apparatus 1300 is shown having one or more processors 1302, a control module (chip set) 1304 coupled to at least one of the (one or more) processors 1302, a memory 1306 coupled to the control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the control module 1304, one or more input / output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1306.

[0219] The processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1300 can be used as a server device such as a gateway described in the embodiments of the present application.

[0220] In some embodiments, the device 1300 may include one or more computer-readable media (e.g., memory 1306 or NVM / storage device 1308) having instructions 1314 and one or more processors 1302 configured to execute the instructions 1314 in combination with the one or more computer-readable media to implement a module to perform the actions described in the present disclosure.

[0221] For one embodiment, the control module 1304 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1302 and / or any suitable device or component in communication with the control module 1304 .

[0222] The control module 1304 may include a memory controller module to provide an interface to the memory 1306. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0223] The memory 1306 may be used, for example, to load and store data and / or instructions 1314 for the device 1300. For one embodiment, the memory 1306 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1306 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0224] For one embodiment, control module 1304 may include one or more input / output controllers to provide an interface to NVM / storage device 1308 and input / output device(s) 1310 .

[0225] For example, NVM / storage 1308 may be used to store data and / or instructions 1314. NVM / storage 1308 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0226] NVM / storage device 1308 may include storage resources that are physically part of the device on which apparatus 1300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 1308 may be accessed via input / output device(s) 1310 over a network.

[0227] (One or more) input / output devices 1310 may provide an interface for the apparatus 1300 to communicate with any other appropriate device, and the input / output device 1310 may include a communication component, a phonetic component, a sensor component, etc. The network interface 1312 may provide an interface for the apparatus 1300 to communicate through one or more networks, and the apparatus 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0228] For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers of the control module 1304 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304 to form a system-on-chip (SoC).

[0229] In various embodiments, the device 1300 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0230] An embodiment of the present application provides an electronic device, comprising: one or more processors; and one or more machine-readable media having instructions stored thereon, which, when executed by the one or more processors, enable the electronic device to perform one or more image processing methods as described in the present application.

[0231] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0232] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0233] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of the processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0234] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0235] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0236] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0237] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0238] The above is a detailed introduction to an image processing method and device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An image processing method, characterized in that: The method comprises: Obtain the depth information of the target object in the original image; Acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter; Get the air illumination parameters in the original image; A fog map is generated according to the air transmittance, the air illumination parameter and the original image.

2. The method according to claim 1, characterized in that The obtaining the air transmittance corresponding to the target object according to the depth information, the random noise generation algorithm and the preset air scattering parameter includes: determining the type of the target object; Selecting a preset air scattering parameter suitable for the type of object from among a plurality of preset air scattering parameters; The air transmittance corresponding to the target object is obtained according to the depth information, a random noise generation algorithm and a selected preset air scattering parameter.

3. The method according to claim 2, characterized in that The determining the type of the target object includes: The original image is input into a semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

4. The method according to claim 2, characterized in that: The step of selecting a preset air scattering parameter suitable for the type of object from among a plurality of preset air scattering parameters comprises: In the correspondence between the type of the object and the preset air scattering parameter, the preset air scattering parameter corresponding to the type is searched.

5. The method according to claim 2, characterized in that: The obtaining the air transmittance corresponding to the target object according to the depth information, the random noise generation algorithm and the preset air scattering parameter includes: Generate a random noise image corresponding to the original image according to the random noise generation algorithm; Acquire the position of the target object in the original image; Acquire noise data at the position in the random noise map; The air transmittance corresponding to the target object is acquired according to the depth information, the noise data and the preset air scattering parameter.

6. The method according to claim 5, characterized in that The obtaining the air transmittance corresponding to the target object according to the depth information, the noise data and the preset air scattering parameter includes: Calculating the square of the product of the depth information and the noise data to obtain a first value; Calculate the first value of a preset base to the power of the first value to obtain a second value; The reciprocal of the second value is calculated to obtain the air transmittance.

7. The method according to claim 5, characterized in that The step of generating a random noise image corresponding to the original image according to the random noise generation algorithm includes: generating at least two random candidate noise patterns of different frequencies based on a random noise generation algorithm; At least two random candidate noise images of different frequencies are superimposed to obtain a random noise image corresponding to the original image.

8. The method according to claim 1, characterized in that: The generating of the fog image according to the air transmittance, the air illumination parameter and the original image comprises: According to the air transmittance, obtaining a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation; According to the air transmittance, obtaining a second illumination parameter after the air illumination parameter is attenuated by air propagation; The fog image is generated according to the first lighting parameter, the second lighting parameter and the original image.

9. The method according to claim 8, characterized in that The step of obtaining, according to the air transmittance, a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation, comprises: The product of the illumination parameter of the light reflected by the target object in the original image and the air transmittance is calculated to obtain the first illumination parameter.

10. The method according to claim 8, characterized in that The step of obtaining, according to the air transmittance, a second illumination parameter after the air illumination parameter has been attenuated by air propagation includes: The product of the air illumination parameter and the air transmittance is calculated to obtain the second illumination parameter.

11. The method according to claim 8, characterized in that The generating the fog image according to the first illumination parameter, the second illumination parameter and the original image includes: The illumination parameter of the light reflected by the target object in the original image is adjusted to the sum of the first illumination parameter and the second illumination parameter to obtain the fog image.

12. The method according to claim 1, characterized in that The obtaining of depth information of the target object in the original image includes: The original image is input into the depth information recognition model to obtain the depth information output by the depth information recognition model.

13. The method according to claim 1, characterized in that The obtaining of air illumination parameters in the original image includes: Obtaining illumination parameters of light reflected by each pixel in the original image; The maximum illumination parameter is determined as the air illumination parameter.

14. An image processing device, characterized in that: The device comprises: A first acquisition module is used to acquire depth information of a target object in an original image; A second acquisition module, configured to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a preset air scattering parameter; The third acquisition module is used to obtain air illumination parameters in the original image; A generation module is used to generate a fog image according to the air transmittance, the air illumination parameter and the original image.

15. The device according to claim 14, characterized in that The second acquisition module includes: A first determining unit, configured to determine the type of the target object; A selection unit, configured to select a preset air scattering parameter suitable for the type of object from a plurality of preset air scattering parameters; The first acquisition unit is used to acquire the air transmittance corresponding to the target object according to the depth information, a random noise generation algorithm and a selected preset air scattering parameter.

16. The device according to claim 15, characterized in that The determination unit is specifically used to: input the original image into a semantic segmentation model to obtain the type of the target object output by the semantic segmentation model.

17. The device according to claim 15, characterized in that The selection unit is specifically configured to search for a preset air scattering parameter corresponding to the type of the object in the corresponding relationship between the type of the object and the preset air scattering parameter.

18. The device according to claim 15, characterized in that The first acquiring unit includes: A generating subunit, configured to generate a random noise image corresponding to the original image according to the random noise generating algorithm; A first acquisition subunit, used to acquire the position of the target object in the original image; A second acquisition subunit, configured to acquire noise data at the position in the random noise map; The third acquisition subunit is used to acquire the air transmittance corresponding to the target object according to the depth information, the noise data and the preset air scattering parameter.

19. The device according to claim 18, characterized in that The third acquisition subunit is specifically used to: calculate the square of the product of the depth information and the noise data to obtain a first value; calculate the power of the first value of a preset base to obtain a second value; calculate the reciprocal of the second value to obtain the air transmittance.

20. The device according to claim 18, characterized in that The generating subunit is specifically used for: generating at least two random candidate noise images with different frequencies based on a random noise generating algorithm; and superimposing at least two random candidate noise images with different frequencies to obtain a random noise image corresponding to the original image.

21. The device according to claim 14, characterized in that The generation module comprises: A second acquisition unit is used to acquire, according to the air transmittance, a first illumination parameter of the light reflected by the target object in the original image after the illumination parameter is attenuated by air propagation; A third acquisition unit is used to acquire, according to the air transmittance, a second illumination parameter of the air illumination parameter after the air illumination parameter is attenuated by air propagation; A generating unit is used to generate the fog image according to the first lighting parameter, the second lighting parameter and the original image.

22. The device according to claim 21, characterized in that The second acquisition unit is specifically used to calculate the product of the illumination parameter of the light reflected by the target object in the original image and the air transmittance to obtain the first illumination parameter.

23. The device according to claim 22, characterized in that The third acquisition unit is specifically used to calculate the product of the air illumination parameter and the air transmittance to obtain the second illumination parameter.

24. The device according to claim 22, characterized in that The generating unit is specifically configured to adjust an illumination parameter of light reflected by the target object in the original image to a sum of the first illumination parameter and the second illumination parameter, so as to obtain the fog image.

25. The device according to claim 14, characterized in that The first acquisition module is specifically used to: input the original image into the depth information recognition model to obtain the depth information output by the depth information recognition model.

26. The device according to claim 14, characterized in that The third acquisition module includes: A fourth acquisition unit, used to acquire illumination parameters of light reflected by each pixel in the original image; The second determining unit is configured to determine the maximum illumination parameter as the air illumination parameter.

27. An electronic device, characterized in that: The electronic device comprises: Processor; and A memory having executable codes stored thereon, which, when executed, enable the processor to perform the image processing method as described in one or more of claims 1-13.

28. One or more machine-readable media having executable codes stored thereon, which, when executed, cause a processor to perform the image processing method according to one or more of claims 1-13.

Citation Information

Patent Citations

  • Simulation fog image generation method based on depth priori

    CN106709901A

  • Image generating method and apparatus

    CN106952239A