Fog concentration estimation method, apparatus, device, and storage medium
By estimating fog concentration based on image brightness, texture intensity, and color deviation, this method solves the problems of inaccurate fog concentration estimation and computational complexity in existing technologies, achieving more efficient and accurate fog concentration estimation.
Patent Information
- Application Number
- CN202311147430.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-09-06
AI Technical Summary
Existing technologies have low accuracy and complex calculations in foggy image processing, especially in scenarios where the dark channel assumption is not met, the calculation results have large deviations.
By acquiring the brightness, texture intensity, and color deviation in the image, the first fog concentration, second fog concentration, and third fog concentration are determined respectively. The total fog concentration of the scene to be detected is estimated by combining these concentrations, which avoids dependence on specific assumptions and simplifies the calculation process.
It improves the adaptability and efficiency of fog concentration estimation, reduces computational complexity, and improves the accuracy of fog concentration estimation.
Smart Images

Figure CN117197068B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of imaging, and in particular to a haze concentration estimation method, device, equipment and storage medium. BACKGROUND
[0002] In the air environment full of impurities such as fog, water vapor, dust, rain, snow, haze, etc., a special haze filter is usually added inside the monitoring camera to filter the influence of impurities in the air on the image, so that the image of the monitored object can be clearly obtained. However, since the invisible light that can penetrate the air impurities does not have corresponding visible light color information, the image processed by the camera is black and white, which cannot meet the user's requirements for image formation in general scenes.
[0003] In order to obtain a clear image, haze concentration can be calculated and estimated. For example, a clear image can be calculated based on a haze image degradation model. The classical method of calculating a clear image based on a haze image degradation model needs to estimate the size of the haze concentration. It is usually assumed that each small area of the haze-free image has a small value in at least one of the RGB three channels, that is, there is a dark channel, but this assumption is not applicable to all scenes, and there may be deviations in some scenes, resulting in low accuracy of the estimation result; and when estimating the haze concentration, guided filtering is also needed to optimize the transmission rate, which has high time and space complexity. SUMMARY
[0004] Therefore, the embodiments of the present application provide a haze concentration estimation method, device, equipment and storage medium to solve the problem of low accuracy and complex calculation in determining the haze concentration in the prior art.
[0005] The first aspect of the embodiments of the present application provides a haze concentration estimation method, which comprises:
[0006] obtaining an image including a scene to be detected;
[0007] determining a first haze concentration of the image according to the brightness of the pixels in the image;
[0008] determining a second haze concentration of the image according to the texture intensity of the pixels in the image;
[0009] determining a third haze concentration of the image according to the color deviation degree of the pixel color from white in the image;
[0010] estimating the haze concentration of the scene to be detected according to the first haze concentration, the second haze concentration and the third haze concentration.
[0011] With reference to the first aspect, in a first possible implementation manner of the first aspect, before determining the first fog density of the image according to the brightness of the pixels in the image, the method further comprises:
[0012] dividing the image into a plurality of image blocks according to a predetermined block rule;
[0013] The first fog density, the second fog density and the third fog density are the fog densities determined according to the respective image blocks; and the fog density of the scene to be detected is estimated according to the first fog density, the second fog density and the third fog density, comprising:
[0014] determining the fog density of each image block according to the first fog density, the second fog density and the third fog density;
[0015] estimating the fog density of the scene to be detected according to the fog densities of the respective image blocks.
[0016] With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, determining the first fog density of the image according to the brightness of the pixels in the image comprises:
[0017] determining the brightness of the pixels in the image block according to the color channel value of the pixels in the image block and the color weight coefficient corresponding to the preset color type;
[0018] determining the brightness of the image block according to the brightness of the pixels in the image block;
[0019] determining the first fog density of the image block according to the preset corresponding relationship between the brightness and the fog density, wherein the color type comprises red, green and blue, the color weight coefficient of the green is greater than the color weight coefficient of the red, and the color weight coefficient of the red is greater than the color weight coefficient of the blue.
[0020] With reference to the first possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, determining the second fog density of the image according to the texture intensity of the pixels in the image comprises:
[0021] determining the longitudinal gradient and the transverse gradient of the pixels in the image block according to the preset gradient operator;
[0022] determining the texture intensity of the pixels in the image block according to the longitudinal gradient of the pixels and the transverse gradient of the pixels, and determining the texture intensity of the image block according to the texture intensity of the pixels in the image block;
[0023] determining the second fog density of the image block according to the preset corresponding relationship between the texture intensity and the fog density.
[0024] In a fourth possible implementation manner of the first aspect, according to the color deviation degree of the pixel color from white in the image, the third haze density of the image is determined, including:
[0025] determining the ratio of the color types of the pixels in the image block;
[0026] determining the color deviation degree of the pixel color from white in the image block according to the ratio of the color types;
[0027] determining the third haze density of the image block according to the color deviation degree of the pixel color from white.
[0028] In a fifth possible implementation manner of the first aspect, according to the ratio of the color types, the color deviation degree of the pixel color from white in the image block is determined, including:
[0029] determining a first ratio according to the red channel value and the green channel value of the pixel, a second ratio according to the blue channel value and the green channel value of the pixel, and a third ratio according to the red channel value and the blue channel value of the pixel;
[0030] obtaining an average ratio according to the first ratio, the second ratio and the third ratio;
[0031] determining the color deviation degree of the pixel color from white in the image block according to the difference between the average ratio and a preset standard value.
[0032] In a sixth possible implementation manner of the first aspect, after the haze density of the scene to be detected is estimated according to the first haze density, the second haze density and the third haze density, the method further includes:
[0033] performing dehazing processing on the image according to the different haze densities of the same scene estimated according to the preset haze density weight coefficients;
[0034] updating the haze density weight coefficients for calculating the haze density of the scene to be detected according to the difference between the image after dehazing processing and the image before dehazing processing.
[0035] A second aspect of the embodiments of the present application provides a haze density estimation device, the device including:
[0036] an image acquisition unit configured to acquire an image including a scene to be detected;
[0037] a first haze concentration determining unit configured to determine a first haze concentration of the image according to brightness of pixels in the image;
[0038] a second haze concentration determining unit configured to determine a second haze concentration of the image according to texture intensity of pixels in the image;
[0039] a third haze concentration determining unit configured to determine a third haze concentration of the image according to color deviation degree of colors of pixels in the image from white;
[0040] a haze concentration estimating unit configured to estimate haze concentration of the scene to be detected according to the first haze concentration, the second haze concentration and the third haze concentration.
[0041] A third aspect of the embodiments of the present application provides a haze concentration estimating device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of the first aspect when executing the computer program.
[0042] A fourth aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the steps of the method according to any one of the first aspect.
[0043] Compared with the prior art, the embodiments of the present application have the beneficial effects that: the embodiments of the present application determine a first haze concentration of an image according to brightness values of pixels in the image including the scene to be detected, determine a second haze concentration according to texture intensity of pixels in the image, determine a third haze concentration according to color deviation degree of colors of pixels in the image from white, and estimate haze concentration of the scene to be detected according to the first haze concentration, the second haze concentration and the third haze concentration. Since the process of estimating haze concentration does not need specific assumptions, the adaptability of the method to scenes is improved, and only brightness, texture intensity and color deviation degree of pixels in the image need to be calculated, which is beneficial to simplify haze concentration estimation and improve haze concentration estimation efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0045] Figure 1 is an implementation flow diagram of a haze concentration estimation method provided by the embodiments of the present application;
[0046] Figure 2is a method for determining a third haze concentration according to a color deviation degree provided by an embodiment of the present application, and a flowchart of the implementation process is shown in the figure;
[0047] Figure 3 is a schematic diagram of a haze concentration estimation device provided by an embodiment of the present application;
[0048] Figure 4 is a schematic diagram of a haze concentration estimation device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0049] In the following description, specific details are set forth such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be implemented in other embodiments without these specific details. In other cases, well-known systems, devices, circuits, and methods have not been described in detail in order not to obscure the description of the present application with unnecessary detail.
[0050] In order to illustrate the technical solutions described in the present application, the following will be described by specific embodiments.
[0051] In implementing haze concentration estimation, haze concentration estimation can be performed based on a haze image degradation model. The haze image degradation model can be expressed as:
[0052] I(x) = J(x) t(x) + A (1 - I(x))
[0053] where x represents the coordinate position of a pixel point on an image, I(x) is a degraded image captured by an image acquisition device, i.e., a haze-containing image; J(x) is a haze-free clear image to be restored; A is a global atmospheric light component, which is a constant, and t(x) is a transmittance function of the image, usually with a value range of [0, 1]. The greater the value of t(x) is, the stronger the light transmittance is, i.e., the weaker the haze concentration is, and the smaller the value of t(x) is, the stronger the haze concentration is.
[0054] According to the haze image degradation model, the process of solving t(x) is the process of solving the haze concentration. Currently, commonly used solving algorithms include: estimating transmittance by using an iterative idea and solving transmittance based on a dark channel prior estimation method, and before solving the transmittance, the global atmospheric light value A also needs to be calculated. At present, there is no accurate algorithm for calculating the global atmospheric light and the transmittance, and the calculation complexity is high. In addition, when estimating the haze concentration based on the dark channel prior method, it is necessary to assume that at least one channel value is small in the RGB three channels based on each small area of the haze-free image, i.e., to assume that there is a dark channel. If the scene does not exist a dark channel, the calculation result will be deviated.
[0055] Based on this, in order to solve the above problems, as Figure 1As shown, the embodiment of the present application proposes a fog concentration estimation method, which determines the fog concentration of a to-be-detected scene based on the brightness, texture intensity and color deviation degree of an image, so that the adaptability of the fog concentration estimation is stronger, and the calculation complexity can be effectively reduced, which is beneficial to improve the fog concentration acquisition efficiency.
[0056] In S101, an image including a to-be-detected scene is acquired.
[0057] The to-be-detected scene in the embodiment of the present application can include monitoring scenes at different positions. For example, the to-be-detected scene can include outdoor monitoring scenes of a community, fire prevention monitoring scenes of a forest, highway monitoring scenes in the field of transportation, etc.
[0058] The image acquired in the embodiment of the present application can be an image collected by an image collection device installed in the to-be-detected scene in real time. For example, the current fog concentration is estimated based on the collected image by collecting the image in real time through the image collection device. When the current fog concentration meets the preset de-fogging requirement, the de-fogging operation is started, so that the obtained image is clearer and more reliable.
[0059] Alternatively, the image used for estimating the fog concentration in the embodiment of the present application can also be collected when the fog concentration estimation switch is triggered. For example, the image collection device can include a fog-transparent mode and a non-fog-transparent mode. When the image collection device operates in the non-fog-transparent mode, i.e., the image does not need to be de-fogged, the calculation for fog concentration estimation can not be triggered. When the image collection device operates in the fog-transparent mode, i.e., the image needs to be de-fogged, the image of the to-be-detected scene needs to be acquired. For example, when the image collection device receives a de-fogging instruction, the image of the to-be-detected scene is acquired, and the fog concentration is estimated based on the acquired image, so as to de-fog the image according to the fog concentration.
[0060] The condition for triggering the fog concentration estimation can also include other set conditions. For example, weather information is acquired through other platforms. When the acquired weather information meets the preset weather condition, the image of the to-be-detected scene is acquired, and the fog concentration is estimated based on the acquired image, so as to de-fog the image according to the fog concentration.
[0061] In S102, a first fog concentration of the image is determined according to the brightness of the pixels in the image.
[0062] The order of determining the first fog concentration, the second fog concentration and the third fog concentration of the image in steps S102-S104 in the embodiment of the present application can be flexibly set according to needs.
[0063] Before determining the first fog density based on the brightness of the pixels in the image, the image can be divided into multiple image blocks according to a predetermined block rule, and the first fog density, the second fog density and the third fog density of each image block are calculated based on the divided image blocks. The average fog density of the image is calculated according to the fog density of each image block, which is the fog density of the image composed of multiple image blocks, and the fog density of the image is the fog density of the scene to be detected.
[0064] Alternatively, the first fog density, the second fog density and the third fog density of each pixel in the image can be calculated according to the first fog density, the second fog density and the third fog density of each pixel in the image, combined with a predetermined weight coefficient, and the average value of the fog density of each pixel is calculated to obtain the fog density of the entire image including each pixel, that is, the fog density of the scene to be detected.
[0065] When the first fog density of the image is determined based on the brightness of the pixels in the image, the brightness of each pixel can be calculated according to the color weight coefficient corresponding to different types of color types and the color channel value of each pixel after the image is divided into multiple image blocks. For example, the color types can include red, blue and green, and different color weight coefficients can be set for red, blue and green, such as first color weight coefficient, second color weight coefficient and third color weight coefficient. According to the different types of color channel values included in the pixel and the corresponding color weight coefficient, the brightness of the pixel determined by the color channel value can be calculated. According to the brightness of each pixel in the image block, the brightness of each image block can be obtained by calculating the average value of the brightness of each pixel in the image block. According to the predetermined corresponding relationship between the brightness and the fog density, the first fog density of the image block can be determined.
[0066] Alternatively, when the first fog density is the fog density of a single pixel in the image, the first fog density of the pixel can be directly calculated according to the brightness of the pixel, combined with the subsequently obtained second fog density and third fog density of the pixel to obtain the fog density of the pixel. The average value of the fog density of the pixel is calculated, or the fog density of the scene to be detected is calculated according to the fog density weight coefficient.
[0067] In a possible implementation, to optimize the calculation result of the fog density of the pixel, the third color weight coefficient can be set to be greater than the first color weight coefficient, and the first color weight coefficient can be set to be greater than the second color weight coefficient, so that the calculation result is more accurate. For example, the luminance calculation formula of the pixel can be represented as: Y = 0.299 * R + 0.587 * G + 0.114 * B, where Y is the luminance of the pixel, R is the red channel value of the pixel, G is the green channel value of the pixel, and B is the blue channel value of the pixel. According to the calculated luminance of the pixel, in combination with the pre-set corresponding relationship between the luminance and the fog density of the pixel, the fog density of the pixel obtained from the luminance of the pixel is determined.
[0068] In a possible implementation, because the image content included by different detection scenes can be different. Therefore, the image of different scenes can also have an influence on the detection result. To be able to improve the accuracy of the detection result, an image without fog, that is, an image with a fog density of 0, can be acquired in advance. According to the image without fog, one or more detection regions in the image are determined. Different corresponding relationships between the fog density and the luminance can be set for detection regions of different colors. For example, different corresponding relationships between the fog density and the luminance are set for a red detection region and a white detection region.
[0069] In S103, according to the texture intensity of the pixel in the image, the second fog density of the image is determined.
[0070] Because the area covered by fog, usually, cannot obtain clear edge and other details of the image. For example, the content such as street and tree in the image cannot obtain the texture data of the content clearly because it is covered by fog. Moreover, the higher the concentration of the fog is, the lower the texture intensity in the image is. Therefore, according to the size of the texture intensity, the second fog density of the current scene can be determined.
[0071] After the image is divided and calculated, when the second fog density of the image block is determined, the texture intensity of the image block can be determined first. When the texture intensity of the image block is calculated, the horizontal gradient and the vertical gradient of the pixel can be calculated, the horizontal texture of the pixel is determined according to the horizontal gradient, the vertical texture of the pixel is determined according to the vertical gradient, the texture intensity of the pixel is calculated according to the horizontal texture and the vertical texture of the pixel, and the texture intensity of the image block is obtained according to the average value of the texture intensity of the pixel in the image block. It can be understood that other direction texture calculation can also be added.
[0072] For example, when the texture intensity is calculated, the horizontal gradient and the vertical gradient of the pixel can be calculated by using the sobel operator. The sobel operator can include a horizontal gradient detection factor and a vertical gradient detection factor. The horizontal gradient detection factor can include, for example, The vertical gradient detection factor can include, for example, and the like.
[0073] The calculation of the horizontal gradient and the vertical gradient is performed according to the horizontal gradient detection factor and the vertical gradient detection factor respectively. The texture intensity of a pixel can be obtained by averaging the absolute values of the calculated horizontal gradient and vertical gradient. The texture intensity of an image block can be determined based on the average of the texture intensities of a plurality of pixels. According to a predetermined correspondence between the texture intensity and the fog density, the second fog density of the image block determined by the texture intensity of the image block is obtained.
[0074] Alternatively, when the second fog density is the fog density of a pixel in the image, the second fog density corresponding to the texture intensity of the pixel can be directly obtained according to the texture intensity of the pixel.
[0075] Since the texture intensities of different objects in different detection scenarios are different. In order to effectively adapt to the estimation of the fog density in different detection scenarios and further improve the estimation accuracy of the fog density, an image of a scene without fog can be obtained before the second fog density is determined. Different texture regions are determined according to the distribution of the texture intensities in the image of the scene without fog. That is, images with similar texture intensities or pixels with a similarity of the texture intensities satisfying a predetermined requirement are divided into the same region. Different correspondence between the texture intensity and the fog density can be set according to different texture regions. According to the detected texture intensity and the region where the texture intensity is located, the second fog density of the image is determined by searching the predetermined correspondence of the region.
[0076] In S104, a third fog density of the image is determined according to a color deviation degree of a color of a pixel in the image from white.
[0077] The fog area in the image is often close to white, so the third fog density can be determined according to the color deviation degree of the image from white.
[0078] The color deviation degree in the embodiment of the application is a deviation degree of a color of a detection point or a detection pixel from white. If the color of the pixel deviates from white more, such as the color of the pixel is red, green or blue, etc., it indicates that the color deviation degree of the pixel from white is greater.
[0079] In the fogging scene, the brightness of white may vary according to the brightness of the detection scene. In the fogging scene, if the scene brightness is relatively high, the detected color is white; if the scene brightness is relatively low, the detected color may be gray. That is, the ratios of different pixels in the detected image are relatively close. The greater the deviation of the value of any one or two colors from the average value, the greater the color deviation degree from white.
[0080] In a possible implementation, the third fog density of the image block can be determined according to the color deviation degree of the color of the pixel in the image block from white. The implementation process can be as followsFigure 2 As shown, comprising:
[0081] In S201, a ratio of color types of pixels in the image block is determined.
[0082] Since the pixel of the collected image is white or gray in the scene with large fog concentration, i.e., the values of each color type in the image are close. Therefore, the deviation degree of the pixel color from white or gray can be determined based on the size of the ratio.
[0083] In a possible implementation, if the pixel is an RGB pixel, the color types included in the pixel can be red, blue and green. The ratio of the color types of the pixel can be determined according to the RGB values in the pixel.
[0084] In S202, the color deviation degree of the pixel color from white in the image block is determined according to the ratio of the color types.
[0085] When determining the ratio of the color types, any color type needs to be compared with all other color types included in the pixel. For example, the ratio of the red channel value to the green channel value in the pixel can be taken as the first ratio, the ratio of the blue channel value to the green channel value in the pixel can be taken as the second ratio, and the ratio of the red channel value to the blue channel value in the pixel can be taken as the third ratio.
[0086] According to the above definition, the color deviation degree can be expressed as: Wherein, R represents the color channel value of red of the pixel, B represents the color channel value of blue of the pixel, and G represents the color channel value of green of the pixel.
[0087] It can be understood that it is not necessary to be limited to the above-mentioned way of determining the first ratio, the second ratio and the third ratio, and the positions of any two color channel values can be exchanged to obtain different expressions of the first ratio, the second ratio and the third ratio.
[0088] Wherein, when determining the color deviation degree, the average ratio is obtained by averaging the first ratio, the second ratio and the third ratio. If the color channel value of any color is much larger than the other two color channel values, and the other two color channel values are close, the average ratio will be much larger than 1 (for example, R or B is much larger than the other two color channel values in the above formula), or much smaller than 1 (for example, G is much larger than R and B, and R and B are close). The average value can be compared with a pre-set standard, such as 1, to determine the difference between the two.
[0089] In a possible implementation, the color deviation degree can also be expressed as: The greater the deviation of any one color channel value from the other two color channel values, the greater the value of the calculation result.
[0090] In S203, a third haze density of the image block is determined according to the color deviation degree of the white color of the pixel.
[0091] According to the calculated color deviation degree, the greater the deviation of any one color channel value from the other two color channel values, the greater the color deviation degree of the pixel color from the white color or the gray color, and thus the smaller the current haze density. The correspondence between the haze density and the color deviation degree can be preset.
[0092] When the third haze density is the haze density of the image block, the average value of the color deviation degrees of the plurality of pixels in the image block can be calculated to obtain the color deviation degree of the image block from the white color. According to the color deviation degree of the image block from the white color and the preset correspondence between the color deviation degree and the haze density, the haze density corresponding to the image block, i.e., the third haze density determined by the color deviation degree, can be found.
[0093] When the third haze density is the haze density of the pixel in the image, the color deviation degree of the pixel color from the white color can be calculated, and the third haze density corresponding to the pixel can be determined according to the preset correspondence between the color deviation degree and the haze density.
[0094] Since different detection scenes can have color differences. In order to reduce the influence of the colors in the scene on the calculation result, the image can be divided into regions according to the colors in the scene. The correspondence between the color deviation degree and the haze density is established according to different colors, so that a more accurate calculation result is obtained.
[0095] In S105, the haze density of the scene to be detected is estimated according to the first haze density, the second haze density, and the third haze density.
[0096] The haze density weight coefficients corresponding to the first haze density, the second haze density, and the third haze density can be preset, and the haze density of the image block after the image block of the scene to be detected is divided is calculated according to the haze density weight coefficients. For example, the haze density weight coefficients can be set to the same weight value, and when an error value occurs in one of the detection results, a more accurate haze density estimation result of the scene to be detected can still be obtained.
[0097] After the haze densities of the image blocks are determined, the haze density of the entire image, i.e., the haze density of the scene to be detected, can be calculated in a manner of estimating the average value of the haze densities of the image blocks, or according to the preset image block weight coefficients of the image blocks.
[0098] Or, the embodiment of the present application can estimate different fog concentrations of the same image or the same scene at the same time through different weight coefficients (including color weight coefficients of the image block, fog concentration weight coefficients, image block weight coefficients, etc.), perform the defogging processing according to the estimated different fog concentrations, determine the defogging effects of the same image at different estimated fog concentrations, determine a more accurate fourth fog concentration as the fog concentration of the scene according to the differences of the defogging effects of the same image. According to the weight coefficients (including color weight coefficients of the image block, fog concentration weight coefficients, image block weight coefficients, etc.) corresponding to the determined more accurate fourth fog concentration, the weight coefficients of the optimized fog concentration estimation are obtained, so that the fog concentration estimation of the scene to be detected can be performed based on the optimized weight coefficients.
[0099] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0100] Figure 3 A schematic diagram of a fog concentration estimation device provided by the embodiment of the present application is shown in FIG. 3. Figure 3 As shown in the figure, the device comprises:
[0101] An image acquisition unit 301 is configured to acquire an image comprising a scene to be detected.
[0102] A first fog concentration determination unit 302 is configured to determine a first fog concentration of the image according to the brightness of pixels in the image.
[0103] A second fog concentration determination unit 303 is configured to determine a second fog concentration of the image according to the texture intensity of pixels in the image.
[0104] A third fog concentration determination unit 304 is configured to determine a third fog concentration of the image according to the color deviation degree of the color of pixels in the image from white.
[0105] A fog concentration estimation unit 305 is configured to estimate the fog concentration of the scene to be detected according to the first fog concentration, the second fog concentration and the third fog concentration.
[0106] Figure 3 The fog concentration estimation device shown in FIG. 3 corresponds to the fog concentration estimation method shown in FIG. 2. Figure 1
[0107] Figure 4 A schematic diagram of a fog concentration estimation device provided by the embodiment of the present application is shown in FIG. 3. Figure 4 As shown, the fog concentration estimation device 4 of the embodiment includes a processor 40, a memory 41, and a computer program 42, e.g., a fog concentration estimation program, stored in the memory 41 and executable on the processor 40. The processor 40 implements the steps in the above-described various fog concentration estimation method embodiments when executing the computer program 42. Alternatively, the processor 40 implements the functions of the modules / units in the above-described various device embodiments when executing the computer program 42.
[0108] By way of example, the computer program 42 can be segmented into one or more modules / units stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules / units can be a series of computer program instruction segments capable of accomplishing a specific function, which are used to describe the execution process of the computer program 42 in the fog concentration estimation device 4.
[0109] The fog concentration estimation device can include, but is not limited to, the processor 40 and the memory 41. Those skilled in the art can understand that the fog concentration estimation device can include other components, such as an input / output device, a network access device, a bus, etc. Figure 4 The foregoing is merely an example of the fog concentration estimation device 4 and does not constitute a limitation on the fog concentration estimation device 4, which can include more or fewer components than those shown, or combine certain components, or include different components, e.g., the fog concentration estimation device can also include an input / output device, a network access device, a bus, etc.
[0110] The processor 40 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic components, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0111] The memory 41 can be an internal storage unit of the fog concentration estimation device 4, such as a hard disk or a memory of the fog concentration estimation device 4. The memory 41 can also be an external storage device of the fog concentration estimation device 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, and the like, equipped on the fog concentration estimation device 4. Further, the memory 41 can also include both the internal storage unit and the external storage device of the fog concentration estimation device 4. The memory 41 is used to store the computer program and other programs and data required by the fog concentration estimation device. The memory 41 can also be used to temporarily store data that has been output or is to be output.
[0112] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0113] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0114] Those of ordinary skill in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0115] In the embodiments of the present application, it should be understood that the disclosed apparatus / terminal device and method can be implemented in other manners. For example, the described apparatus / terminal device embodiments are merely schematic. For example, the division of the modules or units is merely logical function division. There can be another division manner for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different units, can be indirect couplings or communication connections through some interfaces, devices or units.
[0116] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0117] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0118] The integrated module / unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-described embodiment methods can also be completed by computer program instruction-related hardware. The computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of the above-described various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer readable medium can include appropriate contents according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electric carrier signal and telecommunication signal.
[0119] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A method of fog concentration estimation, characterized by, The method comprises: acquiring an image including a scene to be detected; determining a first fog density of the image according to brightness of pixels in the image; determining a second fog density of the image according to texture intensity of the pixels in the image; determining a third fog density of the image according to color deviation degree of the pixels in the image from white; estimating the fog density of the scene to be detected according to the first fog density, the second fog density and the third fog density.
2. The method of claim 1, wherein, Before determining the first fog density of the image according to the brightness of the pixels in the image, the method further comprises: dividing the image into a plurality of image blocks according to a predetermined block rule; the first fog density, the second fog density and the third fog density are the fog densities determined according to the respective image blocks; and estimating the fog density of the scene to be detected according to the first fog density, the second fog density and the third fog density comprises: determining the fog density of each image block according to the first fog density, the second fog density and the third fog density; estimating the fog density of the scene to be detected according to the fog densities of the respective image blocks.
3. The method of claim 2, wherein, Determining the first fog density of the image according to the brightness of the pixels in the image comprises: determining the brightness of the pixels in the image block according to color channel values of the pixels in the image block and combining color weight coefficients corresponding to color types preset in advance; determining the brightness of the image block according to the brightness of the pixels in the image block; determining the first fog density of the image block according to a preset corresponding relationship between brightness and fog density, wherein the color types include red, green and blue, the color weight coefficient of the green is greater than the color weight coefficient of the red, and the color weight coefficient of the red is greater than the color weight coefficient of the blue.
4. The method of claim 2, wherein, Determining the second fog density of the image according to the texture intensity of the pixels in the image comprises: determining longitudinal gradient and transverse gradient of the pixels in the image block according to a preset gradient operator; determining the texture intensity of the pixels in the image block according to the longitudinal gradient of the pixels and the transverse gradient of the pixels, and determining the texture intensity of the image block according to the texture intensity of the pixels in the image block; determining the second fog density of the image block according to a preset corresponding relationship between texture intensity and fog density.
5. The method of claim 2, wherein, Determining the third fog density of the image according to the color deviation degree of the pixels in the image from white comprises: determining a ratio of color types of the pixels in the image block; determining the color deviation degree of the pixels in the image block from white according to the ratio of the color types; determining the third fog density of the image block according to the color deviation degree of the pixels in the image block from white.
6. The method of claim 5, wherein, Determining the color deviation degree of the pixels in the image block from white according to the ratio of the color types comprises: determining a first ratio according to a red channel value and a green channel value of the pixels, a second ratio according to a blue channel value and the green channel value of the pixels, and a third ratio according to the red channel value and a blue channel value of the pixels; obtaining an average ratio according to the first ratio, the second ratio and the third ratio; According to the difference between the average ratio and a preset standard value, a color deviation degree of pixel color in the image block from white color is determined.
7. The method according to any one of claims 1 to 6, characterized in that, After estimating the fog density of the scene to be detected according to the first fog density, the second fog density and the third fog density, the method further comprises: According to the different fog densities of the same scene estimated according to the preset fog density weight coefficients, the image is dehazed; According to the difference between the image after dehazing and the image before dehazing, the fog density weight coefficients of the scene to be detected are updated.
8. A mist concentration estimation device characterized by comprising: The device comprises: An image acquisition unit configured to acquire an image comprising a scene to be detected; A first fog density determination unit configured to determine a first fog density of the image according to the brightness of pixels in the image; A second fog density determination unit configured to determine a second fog density of the image according to the texture intensity of pixels in the image; A third fog density determination unit configured to determine a third fog density of the image according to the color deviation degree of pixel color in the image from white color; A fog density estimation unit configured to estimate the fog density of the scene to be detected according to the first fog density, the second fog density and the third fog density.
9. A mist concentration estimation device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program implements the steps of the method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Patent Citations
RGB-IR sensor-based self-adaptive fog-transmitting method and terminal
CN107705263A
An image-based fog concentration detection and early warning method and system
CN109389132A