WO2021000302A1 - Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device - Google Patents

Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device Download PDF

Info

Publication number
WO2021000302A1
WO2021000302A1 PCT/CN2019/094616 CN2019094616W WO2021000302A1 WO 2021000302 A1 WO2021000302 A1 WO 2021000302A1 CN 2019094616 W CN2019094616 W CN 2019094616W WO 2021000302 A1 WO2021000302 A1 WO 2021000302A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
cost function
value
haze image
super pixel
Prior art date
Application number
PCT/CN2019/094616
Other languages
French (fr)
Chinese (zh)
Inventor
储颖
游为麟
罗国星
朱泽轩
Original Assignee
深圳大学
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳大学 filed Critical 深圳大学
Priority to PCT/CN2019/094616 priority Critical patent/WO2021000302A1/en
Publication of WO2021000302A1 publication Critical patent/WO2021000302A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation

Definitions

  • the present invention relates to the technical field of image processing, and more specifically, to an image defogging method, system, storage medium and electronic equipment based on super pixel segmentation.
  • image defogging methods can be divided into two categories: the first category is defogging methods based on image enhancement, and the second category is defogging methods based on physical models.
  • the defogging method based on image enhancement does not consider the principle of image degradation, does not establish a complex physical model, and directly uses conventional image enhancement techniques to improve image contrast, color saturation, and clarity, and its defogging effect is limited.
  • the basic idea of the defogging method based on the physical model is to establish a physical model of image degradation under haze weather and restore the optical process of image degradation.
  • the reverse method is used to compensate the information loss in the degradation process, so as to obtain a clear image.
  • this type of method can retain more valuable information in the image, and the defogging results are more realistic and natural.
  • the current mainstream model is a physical model based on atmospheric scattering. In the application of defogging algorithms, it can be divided into several categories based on prior knowledge and based on machine learning. It specifically includes:
  • the contrast of a foggy image is lower. You can defog by maximizing the contrast of the image.
  • This type of method stipulates that the contrast of an image is represented by the gradient of the image, that is, the more obvious the edge of the image, the higher the contrast. The formula is expressed as follows:
  • C edges (I) represents the sum of the image gradient information
  • x represents the pixel point in the image
  • I c (x) represents the gradient value at point x.
  • the dark channel pixel value is very low, and the more severe the haze, the higher the dark channel pixel value.
  • J dark (x) represents the dark channel image composed of the minimum value of the three color channels of the image.
  • the dark channel value approaches zero. Therefore, by calculating the expression of the dark channel in the atmospheric scattering model and setting it to zero, a dehazing image is obtained.
  • the disadvantage of the dark channel a priori dehazing is that when the haze image contains a sky area, the image will be distorted in the sky area after dehazing.
  • the image surface shadow and the atmospheric transfer function are statistically uncorrelated in the local area of the image. It expresses the clear image J(x) in the atmospheric scattering model as the product of the transmittance map and the surface reflection coefficient R, and then decomposes R and the clear image I(x) into components R A and I in the direction parallel to the atmospheric light.
  • a (x) the vertical resolution of the atmosphere in the direction of the light components R 'and I R', transmittance FIG follows:
  • R A is the surface reflection coefficient
  • R' represents the residual vector perpendicular to the atmospheric light
  • I A (x) is the component parallel to the atmospheric light
  • the Markov random field is used to restore the transmittance map t(x).
  • This kind of method is based on the atmospheric scattering model, which can solve the depth map.
  • the haze image needs to have rich color information, it is not applicable to the dense fog image.
  • k represents brightness
  • c represents color saturation
  • represents random error
  • d represents scene depth
  • ⁇ 1 , ⁇ 2 and ⁇ 3 are the parameters of the linear regression model.
  • the global atmospheric light value A is estimated according to the depth of the scene and combined with the atmospheric scattering model to derive the original image.
  • This method is easy to fail when the haze density is large and the color characteristics are not obvious, and it is only suitable for the situation where the color saturation of the background object is high or the haze degree is low.
  • L represents the overall cost function in the block
  • L contrast represents the cost function of the intra-block contrast
  • Linfro represents the cost function of the information entropy in the block
  • represents the weight of the information entropy cost function in the overall cost function.
  • the intra-block contrast and information entropy are maximized by minimizing the cost function, so as to achieve the overall image defogging effect.
  • the cost function-based image defogging method directly divides the image to calculate the optimal transmittance map value in each rectangular block.
  • the transmittance map value is shared in the rectangular block, but the depth of the scene in the rectangular block may be inconsistent. Therefore, this method may cause errors in the estimation of the transmittance map.
  • the technical problem to be solved by the present invention is to provide an image defogging method, system, storage medium, and electronic device based on superpixel segmentation in view of the above-mentioned prior art defects of the prior art.
  • the technical solution adopted by the present invention to solve its technical problems is to construct an image defogging method based on super pixel segmentation, including:
  • the obtaining the global atmospheric light value corresponding to the haze image includes:
  • the segmenting the haze image through super pixel segmentation to obtain the super pixel set corresponding to the haze image includes: segmenting the haze image through SLIC super pixel segmentation; and/or
  • the obtaining an initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set includes:
  • the performing refinement processing on the initial transmittance map to obtain the target transmittance map includes: performing refinement processing on the initial transmittance map based on guided filtering; and/or
  • the obtaining a clear image corresponding to the haze image according to the transmittance map and the global atmospheric light value includes: obtaining a clear image corresponding to the haze image by using the following formula,
  • I(x) is the haze image
  • J(x) is the clear image
  • t is the target transmittance map
  • A is the global atmospheric light value.
  • the first cost function is a contrast cost function
  • the contrast cost function satisfies the following formula:
  • x is the position of the pixel
  • c ⁇ r,g,b ⁇ is a certain color channel of the pixel x
  • D is the superpixel area corresponding to any superpixel set
  • J c (x) is the clear image
  • N x is the number of pixels in the super pixel area
  • N x represents the number of pixels in any super pixel set
  • I c (x) represents the pixel value of pixel x in color channel c
  • the second cost function is an information entropy cost function, and the information entropy cost function satisfies the following formula:
  • min ⁇ 0, J c (p) ⁇ , max ⁇ 0, J c (p)-255 ⁇ represent the overflow value of pixel underflow and overflow respectively
  • h c (i) represents the histogram of the input pixel Take the value
  • ⁇ c and ⁇ c represent the pixel value that is truncated
  • the third cost function satisfies the following formula:
  • L contrast represents the contrast cost function
  • L info represents the information entropy cost function
  • ⁇ D is the weight parameter that coordinates the contrast loss and the information entropy loss.
  • the value of ⁇ D is 6.
  • the segmentation of the haze image by SLIC superpixel segmentation includes:
  • S121 Perform color space conversion on the haze image to obtain a CIELab color space, and obtain an initial center point of the haze image according to a preset size value of the superpixel set;
  • S122 Perform five-dimensional clustering on the pixel points of the haze image and the CIELab color space based on the initial center point to obtain an initial superpixel set;
  • the preset size value of the super pixel set satisfies the requirement of greater than 300 pixels and less than 1500 pixels; and/or
  • the preset count value is 10.
  • the preset size value of the super pixel set is 900 pixels.
  • the present invention also constructs an image defogging system based on super pixel segmentation, including:
  • the first processing unit is configured to obtain the global atmospheric light value corresponding to the haze image
  • a segmentation unit configured to segment the haze image through super pixel segmentation to obtain a super pixel set corresponding to the haze image
  • a second processing unit configured to obtain a transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
  • a third processing unit configured to refine the initial transmittance map to obtain a target transmittance map
  • the fourth processing unit is configured to obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
  • the present invention also constructs a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method for image defogging based on superpixel segmentation as described in any one of the above is realized.
  • the present invention also constructs an electronic device, including a memory and a processor
  • the memory is used to store computer programs
  • the processor is configured to execute the computer program to implement the image defogging method based on superpixel segmentation as described in any one of the above.
  • An image defogging method, system, storage medium, and electronic device based on superpixel segmentation implemented in the present invention have the following beneficial effects: both real haze images and synthetic haze image data sets have good defogging effects.
  • FIG. 1 is a program flowchart of an embodiment of an image defogging method based on superpixel segmentation of the present invention
  • FIG. 2 is a program flowchart of another embodiment of the image defogging method based on super pixel segmentation of the present invention
  • Figure 3 is an example diagram of global atmospheric light value estimation results
  • FIG. 4 is a program flowchart of another embodiment of the image defogging method based on super pixel segmentation of the present invention.
  • Figure 5 is a schematic diagram of the comparison of super pixel areas
  • Fig. 6 is a schematic diagram of a clustering search area of pixels
  • FIGS. 7-10 are schematic diagrams of iterative SLIC superpixel segmentation algorithm
  • FIG. 11 is a program flowchart of another embodiment of an image defogging method based on superpixel segmentation according to the present invention.
  • Figure 12 is a schematic diagram of pixel cut-off
  • Figure 13 shows the image defogging effect under different ⁇ D ;
  • Figures 14-15 are schematic diagrams showing the comparison of transmittance diagrams of different defogging methods
  • Figures 16-17 are schematic diagrams showing the comparison of defogging effects of haze images with different defogging methods.
  • the method includes:
  • the atmospheric scattering model which is widely used in the field of image processing under haze weather, describes the atmospheric scattering process and the principle of ambient light attenuation.
  • the detailed technical principle of the atmospheric scattering model under a single light source This model divides the light reaching the imaging device into two parts: one is directly attenuating the light, and the reflected light of the scene is scattered by particles in the air during the process of propagating to the imaging device The effect is that the incident light attenuation occurs, which is called direct light attenuation; the other part is that atmospheric light directly acts on the suspended particles in the air, is received by the imaging device after being scattered, and overlaps on the target image, which is called additional scattered light.
  • I(x) is the haze image
  • A is the global atmospheric light value
  • t(x) is the transmittance map
  • J(x) is the clear image.
  • the design of the cost function can be based on a variety of image characteristics, such as contrast, information entropy, saturation and other characteristics. Since the direct use of the transmittance map acquired based on the cost function will produce blockiness, it is necessary to refine the acquired initial transmittance map so that the transmittance map can obtain a texture close to the haze image to obtain the target transmission corresponding to the haze image Rate graph.
  • step S1 obtaining the global atmospheric light value corresponding to the haze image includes:
  • the traditional method for estimating the global atmospheric light value is to take a small number of pixels with the largest brightness in the picture, and use the average value of each channel of these pixels as the global atmospheric light value.
  • this paper adopts a quadtree estimation method based on contrast and brightness. The specific process is to evenly divide the haze image into four regions. After that, subtract the standard deviation from the average value of each area pixel to ensure that the area with the largest value has the largest average brightness and the smallest contrast. Finally, loop this process until the pixels in the area are less than the preset value.
  • the average brightness of each channel in the area is the global atmospheric light estimate.
  • Figure 3 shows an example graph of the global atmospheric light estimation results.
  • step S1 segmenting the haze image through super pixel segmentation to obtain a super pixel set corresponding to the haze image includes: segmenting the haze image through SLIC super pixel segmentation; specifically, SLIC super pixel Segmentation is an image segmentation algorithm with simple thinking and easy implementation. The algorithm has fast execution speed and can maintain the contour of the object relatively completely.
  • the generated super pixel blocks are uniformly distributed, compact in structure, similar in features, and easy to convert with pixel-based methods.
  • other image segmentation algorithms can also produce similar segmentation effects.
  • segmenting the haze image through SLIC superpixel segmentation includes:
  • the initial center point is defined as the seed point, and the number of center points is the same as the number of super pixel sets and remains constant during iterations.
  • SLIC super pixel segmentation will uniformly distribute seed points in the image according to the predefined super pixel set size.
  • the preset size of the super pixel set should not be too large, and the depth of the scene in the super pixel set should be consistent.
  • you can define the average size of the super pixel set that is, the average number of pixels in the super pixel.
  • the selection principle is to keep the scene depth in the super pixel set consistent.
  • Figure 5 shows the effect of the average superpixel set size on the segmentation results.
  • (a) is the original haze image
  • (b) is the super pixel set size of 1500
  • (c) is the super pixel set size of 900
  • (d) is the super pixel set size of 300.
  • the size of the super pixel set is 1500 pixels, because the value is too large, the consistency of the depth of field in some areas cannot be guaranteed.
  • the set size is set to 900, it can basically ensure the same depth of field in the super pixel set.
  • the parameter is set to 300, the total number of super pixel sets is too large, which will increase the amount of calculation.
  • the super pixel set size is set to 900.
  • S122 Perform five-dimensional clustering of the pixels of the haze image by coordinates and CIELab color space based on the initial center point to obtain the initial superpixel set; specifically, the SLIC superpixel segmentation is a clustering algorithm that specifies each pixel of the picture
  • the (x, y) coordinate value and (L, a, b) color value form a five-dimensional vector [x, y, L, a, b], and the similarity of two pixels is measured by the vector distance between them .
  • the search range of each pixel is a 2S ⁇ 2S area, where S is the distance between the initial seed points.
  • step S124 Perform five-dimensional clustering on the pixel points of the haze image according to the coordinates and CIELab color space based on the corrected initial center point to obtain the corrected initial superpixel set, and count it once to determine whether the current and past count times are Meet the pre-designed value, if not, go to step S123; if yes, go to step S125;
  • the upper limit of the number of iterations of SLIC superpixel segmentation is set to 10 times.
  • step S2 obtaining the initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set includes:
  • the design of the cost function can be based on a variety of image characteristics, such as contrast, information entropy, saturation and other characteristics.
  • contrast and information entropy are selected.
  • the third cost function is used to balance the information loss and contrast loss in the super pixel set at the same time.
  • the first cost function is a contrast cost function
  • the contrast cost function satisfies the following formula:
  • x is the position of the pixel
  • c ⁇ r,g,b ⁇ is a certain color channel of the pixel x
  • D is the superpixel area corresponding to any superpixel set
  • J c (x) is the clear image
  • N x is the number of pixels in the super pixel area
  • N x represents the number of pixels in any super pixel set
  • I c (x) represents the pixel value of pixel x in color channel c
  • the second cost function is the information entropy cost function, and the information entropy cost function satisfies the following formula:
  • min ⁇ 0, J c (p) ⁇ , max ⁇ 0, J c (p)-255 ⁇ represent the overflow value of pixel underflow and overflow respectively
  • h c (i) represents the histogram of the input pixel Take the value
  • ⁇ c and ⁇ c represent the pixel value that is truncated
  • the third cost function satisfies the following formula:
  • L contrast represents the contrast cost function
  • L info represents the information entropy cost function
  • ⁇ D is the weight parameter that coordinates the contrast loss and the information entropy loss.
  • the scene depth in the super pixel set is the same, and the transmittance map is also the same.
  • the formula (1) is modified to obtain the clear image corresponding to the super pixel set as:
  • A is the global atmospheric light value
  • I(x) is the haze image
  • t is the target transmittance map.
  • the mean square error contrast C MSE can be used to evaluate the contrast in the image area block to be restored.
  • the formula is as follows:
  • c ⁇ r,g,b ⁇ represents a certain color channel of pixel x.
  • J c (x) represents the pixel value of the pixel point x of the clear image in the block of the color channel c. Is the average value of J c (x) in the block, and N represents the number of pixels in the block.
  • I c (x) represents the pixel value of pixel x in color channel c
  • the contrast C MSE is a decreasing function of the transmittance t, that is, the smaller the transmittance t, the higher the contrast. Therefore, the contrast loss function L contrast can be defined as in formula (2). It can be seen that the smaller the contrast cost function L contrast , the greater the image contrast. Therefore, the contrast within the superpixel set can be maximized by minimizing the contrast cost function.
  • the mapping between the input pixel value I c (x) and the output pixel value J c (x) can be obtained according to formula (5).
  • the output value mapping interval is guaranteed to be [0, 255].
  • the effective range [ ⁇ , ⁇ ] of the input pixel value is determined by the transmittance map t.
  • the information entropy cost function L info can be defined as in formula (3), by minimizing the information entropy cost function L info , the information entropy loss in the super pixel set can be minimized.
  • an improved cost function related to the contrast cost function and the information entropy cost function is set to improve the image contrast and reduce the information loss. It satisfies the formula (4).
  • a larger value of ⁇ D can reduce the information entropy loss.
  • ⁇ D is infinite, no information entropy loss occurs.
  • Ac represents the global atmospheric light value in channel c
  • D represents the super pixel area
  • I c (x) represents the pixel value of pixel x in color channel c.
  • the weight parameter ⁇ D proposed in formula (4) has the meaning of weighing the importance of improving contrast and reducing information entropy.
  • ⁇ D 3
  • ⁇ D 6, a balance is struck between improving image contrast and suppressing information loss. Therefore, ⁇ D is set to 6 in the image defogging algorithm of super pixel cost function.
  • performing refinement processing on the initial transmittance map to obtain the target transmittance map includes: performing refinement processing on the initial transmittance map based on guided filtering; specifically, a dehazing method based on an atmospheric scattering model Among them, many methods, such as the dark channel prior method, the color attenuation prior method, etc., have insufficiently refined transmittance maps.
  • the commonly used transmittance map refinement methods include soft matting method and guided filtering method. In this article, the original transmittance map obtained by the cost function defogging method also needs to be refined. If it is used directly, it will cause blocking.
  • the guided filtering is used in this example to refine the transmittance map.
  • the specific process is to filter the input image with the guidance image, so that the input image retains the original features while obtaining the texture of the guidance image. If the output image is t, the relationship between the guidance image I(x) and the output image is as follows:
  • I(x) represents the guidance image
  • W xy (I(x)) represents the weight used in the weighted average operation determined by the guidance image
  • t(x) is the input image
  • is the offset.
  • the guided image for guided filtering may be the input image itself.
  • the input image here is the initial transmittance map of the haze image
  • the output image is the target transmittance map of the haze image.
  • Both the cost function defogging method and the SLIC superpixel cost function defogging method use guided filtering to refine the transmittance map.
  • the transmittance maps of different defogging methods have different edge retention effects.
  • FIG. 14 and Figure 15 show the comparison of the traditional cost function image defogging method and the superpixel cost function image defogging method.
  • (a) is the haze image
  • (c) cost function refinement is the super pixel method
  • (e) is the super pixel method refinement
  • (f) is the cost function detail
  • ( g) is the super pixel detail.
  • (e) is the defogging effect picture refined by the super pixel method through guided filtering.
  • step S4 obtaining a clear image corresponding to the haze image according to the transmittance map and the global atmospheric light value includes: obtaining a clear image corresponding to the haze image by using the following formula:
  • A is the global atmospheric light value
  • I(x) is the haze image
  • t is the target transmittance
  • (a) is the haze image
  • (b) is the defogging image of the histogram equalization method
  • (c) is the defogging image of the Retinex method. It can be seen that both methods exist Partially distorted, and the image color is not coordinated.
  • (d) is the defogging image of the dark channel prior defogging method, in which the sky part is over-enhanced.
  • (e) is the defogging image of the cost function
  • (f) is the defogging image of the superpixel cost function algorithm, both of which are more natural, but the image brightness of the superpixel cost function defogging algorithm is higher than the cost function .
  • a typical objective image quality evaluation algorithm is used to compare the effects of different defogging methods. Including: structure similarity, peak signal-to-noise ratio, gray-scale variance, Laplacian gradient and entropy function five methods.
  • Table 1 and Table 2 respectively show the objective evaluation results of image quality of different defogging algorithms on the HID2018 haze image database and NYU synthetic haze image database.
  • the super pixel cost function corresponds to the image defogging method based on super pixel of the present invention.
  • Table 1 shows the comparison of objective image quality evaluation results of different defogging algorithms on the HID2018 dataset
  • Table 2 shows the comparison of objective evaluation results of different defogging algorithms on the NYU synthetic haze image data set.
  • the structural similarity and the peak signal-to-noise ratio belong to the full-reference image quality evaluation method, which requires fog-free images for comparison. Therefore, the NYU synthetic haze image database was selected for testing.
  • the database contains original clear images and synthetic haze images.
  • the gray variance (SMD), Laplacian gradient function and entropy function are non-reference image quality evaluation methods, which can be directly tested using real haze images in the HID2018 database.
  • the performance of the superpixel-based image defogging method of the present invention is slightly lower than that of the cost function defogging method; and when Entropy is used, The performance of the superpixel-based image defogging method of the present invention is better than other methods.
  • the superpixel-based image defogging method of the present invention has the best performance.
  • the superpixel-based image defogging method of the present invention has a good defogging effect on both the real haze image and the synthetic haze image data set.
  • the image defogging system based on superpixel segmentation of the present invention includes:
  • the first processing unit is used to obtain the global atmospheric light value corresponding to the haze image
  • the segmentation unit is used to segment the haze image through super pixel segmentation to obtain the super pixel set corresponding to the haze image;
  • the second processing unit is configured to obtain a transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
  • the third processing unit is used to refine the initial transmittance map to obtain the target transmittance map
  • the fourth processing unit is used to obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
  • the specific coordination operation process between the units of the image defogging system based on superpixel segmentation can refer to the above-mentioned image defogging method based on superpixel segmentation, which will not be repeated here.
  • an electronic device of the present invention includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program to implement any of the above-mentioned methods for image defogging based on superpixel segmentation.
  • the process described above with reference to the flowchart can be implemented as a computer software program.
  • an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program when the computer program can be downloaded and installed by an electronic device and executed, it executes the above-mentioned functions defined in the method of the embodiment of the present invention.
  • the electronic device in the present invention can be a terminal such as a notebook, a desktop computer, a tablet computer, a smart phone, etc., or a server.
  • a computer storage medium of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, any one of the above methods for image defogging based on superpixel segmentation is realized.
  • the above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein.
  • This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium.
  • the computer-readable signal medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device .
  • the program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

Disclosed are an image dehazing method and system based on superpixel segmentation, and a storage medium and an electronic device, wherein same can achieve a great dehazing effect on a real haze image and a synthetic haze image data set. The method comprises: acquiring a global atmospheric light value corresponding to a haze image, and segmenting the haze image through superpixel segmentation to acquire a superpixel set corresponding to the haze image (S1); acquiring, by means of a preset cost function and on the basis of the superpixel set, an initial transmittance graph corresponding to the haze image (S2); performing refinement processing on the initial transmittance graph to acquire a target transmittance graph (S3); and acquiring, according to the target transmittance graph and the global atmospheric light value, a clear image corresponding to the haze image (S4).

Description

基于超像素分割的图像去雾方法、系统、存储介质及电子设备Image defogging method, system, storage medium and electronic equipment based on super pixel segmentation 技术领域Technical field
本发明涉及图像处理技术领域,更具体地说,涉及一种基于超像素分割的图像去雾方法、系统、存储介质及电子设备。The present invention relates to the technical field of image processing, and more specifically, to an image defogging method, system, storage medium and electronic equipment based on super pixel segmentation.
背景技术Background technique
目前图像去雾方法可分为两类:第一类是基于图像增强的去雾方法,第二类是基于物理模型的去雾方法。At present, image defogging methods can be divided into two categories: the first category is defogging methods based on image enhancement, and the second category is defogging methods based on physical models.
基于图像增强的去雾方法不考虑图像退化的原理,不建立复杂的物理模型,直接利用常规的图像增强技术提高图像的对比度、色彩饱和度和清晰度等特征,其去雾效果有限。The defogging method based on image enhancement does not consider the principle of image degradation, does not establish a complex physical model, and directly uses conventional image enhancement techniques to improve image contrast, color saturation, and clarity, and its defogging effect is limited.
基于物理模型的去雾方法基本思想是:建立雾霾天气下图像降质的物理模型,还原图像退化的光学过程。运用逆向方法补偿退化过程的信息损失,从而获得清晰图像。相比基于图像增强的去雾方法,此类方法能保留图像中更多有价值的信息,去雾结果更为真实、自然。目前主流的模型是基于大气散射的物理模型。在去雾算法应用上,又可分为基于先验知识和基于机器学习等几类。其具体包括:The basic idea of the defogging method based on the physical model is to establish a physical model of image degradation under haze weather and restore the optical process of image degradation. The reverse method is used to compensate the information loss in the degradation process, so as to obtain a clear image. Compared with defogging methods based on image enhancement, this type of method can retain more valuable information in the image, and the defogging results are more realistic and natural. The current mainstream model is a physical model based on atmospheric scattering. In the application of defogging algorithms, it can be divided into several categories based on prior knowledge and based on machine learning. It specifically includes:
(1)对比度先验:(1) Contrast prior:
相比无雾图像,有雾图像的对比度较低,可通过最大化图像的对比度进行去雾。此类方法规定,图像的对比度由图像的梯度表示,即图像边缘越明显,对比度越高,公式表达如下:Compared with a non-fog image, the contrast of a foggy image is lower. You can defog by maximizing the contrast of the image. This type of method stipulates that the contrast of an image is represented by the gradient of the image, that is, the more obvious the edge of the image, the higher the contrast. The formula is expressed as follows:
Figure PCTCN2019094616-appb-000001
Figure PCTCN2019094616-appb-000001
其中,C edges(I)表示图像梯度信息的总和,x表示图像中的像素点,I c(x)表示点x处的梯度值。 Among them, C edges (I) represents the sum of the image gradient information, x represents the pixel point in the image, and I c (x) represents the gradient value at point x.
不过,此类方法容易使图像发生过饱和,在场景深度突变的边缘地带容易出现光晕。However, this kind of method is prone to oversaturate the image, and halo is prone to appear at the edge of the scene with sudden depth changes.
(2)暗通道先验(2) Dark channel prior
绝大多数的户外无雾图像,对每个像素点取其颜色通道的最小值,形成的图像称为暗通道。对于户外无雾图像,其暗通道像素值很低,而雾霾越严重,暗通道像素值越高。For most outdoor images without fog, the minimum value of the color channel is taken for each pixel, and the resulting image is called the dark channel. For outdoor images without fog, the dark channel pixel value is very low, and the more severe the haze, the higher the dark channel pixel value.
Figure PCTCN2019094616-appb-000002
Figure PCTCN2019094616-appb-000002
其中,J dark(x)表示图像的三颜色通道取最小值组成的暗通道图像。 Among them, J dark (x) represents the dark channel image composed of the minimum value of the three color channels of the image.
在无雾图像中,暗通道值趋近于零。因此,通过计算大气散射模型中暗通道的表达式,并将其设置为零,得到去雾图像。In a fog-free image, the dark channel value approaches zero. Therefore, by calculating the expression of the dark channel in the atmospheric scattering model and setting it to zero, a dehazing image is obtained.
暗通道先验去雾的缺点是,当雾霾图片中含有天空区域,去雾后图像会在天空区域出现失真现象。The disadvantage of the dark channel a priori dehazing is that when the haze image contains a sky area, the image will be distorted in the sky area after dehazing.
(3)色彩先验(3) Color prior
图像表面阴影于大气传递函数在图像局部区域具有统计上的不相关性。其将大气散射模型中的清晰图像J(x)表示为透射率图与表面反射系数R的乘积,然后将R和清晰图像I(x)在平行大气光方向上的分解为分量R A和I A(x),在垂直于大气光方向上分解为的分量R'和I R',透射率图表示如下: The image surface shadow and the atmospheric transfer function are statistically uncorrelated in the local area of the image. It expresses the clear image J(x) in the atmospheric scattering model as the product of the transmittance map and the surface reflection coefficient R, and then decomposes R and the clear image I(x) into components R A and I in the direction parallel to the atmospheric light. a (x), the vertical resolution of the atmosphere in the direction of the light components R 'and I R', transmittance FIG follows:
Figure PCTCN2019094616-appb-000003
Figure PCTCN2019094616-appb-000003
其中,R A为表面反射系数,R'表示与大气光垂直的残余向量,I A(x)为平行于大气光的分量,并采用马尔可夫随机场修复得到透射率图t(x)。 Among them, R A is the surface reflection coefficient, R'represents the residual vector perpendicular to the atmospheric light, and I A (x) is the component parallel to the atmospheric light, and the Markov random field is used to restore the transmittance map t(x).
此类方法基于大气散射模型,可求解出深度图。但是,由于需要雾霾图像具有丰富的色彩信息,对浓雾图像不适用。This kind of method is based on the atmospheric scattering model, which can solve the depth map. However, since the haze image needs to have rich color information, it is not applicable to the dense fog image.
(4)基于线性回归和颜色衰减先验的去雾方法。由于清晰图像的色彩饱和度与亮度相近,但雾霾图像会发生色彩饱和度下降而亮度升高的现象。因此,采用饱和度与亮度来估算雾霾的浓度,又由于入射光的衰减率与场景深度有关,因此其采用了色彩饱和度与亮度的线性模型预测场景深度,表示如下:(4) Dehazing method based on linear regression and color attenuation prior. Since the color saturation of a clear image is similar to the brightness, the color saturation of the haze image will decrease and the brightness will increase. Therefore, saturation and brightness are used to estimate the concentration of haze, and because the attenuation rate of incident light is related to the depth of the scene, it uses a linear model of color saturation and brightness to predict the depth of the scene, which is expressed as follows:
d(x)=θ 01k(x)+θ 2c(x)+ε(x) d(x)=θ 01 k(x)+θ 2 c(x)+ε(x)
其中,k表示亮度,c表示色彩饱和度,ε表示随机误差,d表示场景深度,θ 1,θ 2和θ 3为线性回归模型的参数。 Among them, k represents brightness, c represents color saturation, ε represents random error, d represents scene depth, and θ 1 , θ 2 and θ 3 are the parameters of the linear regression model.
之后,根据场景深度估计全局大气光值A,并结合大气散射模型推导出原 始图像。该方法在雾霾浓度较大,色彩特征不明显时容易失效,仅适用于背景物体色彩饱和度较高或雾霾程度较低的情况。After that, the global atmospheric light value A is estimated according to the depth of the scene and combined with the atmospheric scattering model to derive the original image. This method is easy to fail when the haze density is large and the color characteristics are not obvious, and it is only suitable for the situation where the color saturation of the background object is high or the haze degree is low.
(5)基于成本函数的去雾方法。(5) Dehazing method based on cost function.
基于成本函数的图像去雾算法流程如下:The process of image dehazing algorithm based on cost function is as follows:
首先,对图像切割分块,并假设块内透射率图一致。First, cut the image into blocks, and assume that the transmittance maps within the blocks are consistent.
之后,设计关于图像对比度和信息熵的成本函数,通过最小化成本函数来求解块内透射率图,公式如下:After that, design a cost function about image contrast and information entropy, and solve the intra-block transmittance map by minimizing the cost function. The formula is as follows:
L=L contrast+λL info L=L contrast +λL info
其中,L表示块内总体的成本函数,L contrast表示块内对比度的成本函数,L infro表示块内信息熵的成本函数,λ表示总体成本函数中信息熵成本函数的权重。 Among them, L represents the overall cost function in the block, L contrast represents the cost function of the intra-block contrast, Linfro represents the cost function of the information entropy in the block, and λ represents the weight of the information entropy cost function in the overall cost function.
之后,通过最小化成本函数使块内对比度和信息熵最大化,从而实现图像整体去雾效果。After that, the intra-block contrast and information entropy are maximized by minimizing the cost function, so as to achieve the overall image defogging effect.
现有方案中,基于成本函数的图像去雾方法通过对图像直接分割,计算每一个矩形块内的最优透射率图值。矩形块内共享透射率图值,但由于矩形块内的场景深度有可能不一致。因此,这种方法有可能造成透射率图的估算误差。In the existing solutions, the cost function-based image defogging method directly divides the image to calculate the optimal transmittance map value in each rectangular block. The transmittance map value is shared in the rectangular block, but the depth of the scene in the rectangular block may be inconsistent. Therefore, this method may cause errors in the estimation of the transmittance map.
综上,现有图像去雾方法的性能还有较大的提升空间,有必要进行改进。In summary, the performance of existing image defogging methods still has a large room for improvement, and it is necessary to improve.
发明内容Summary of the invention
本发明要解决的技术问题在于,针对现有技术的上述现有技术缺陷,提供一种基于超像素分割的图像去雾方法、系统、存储介质及电子设备。The technical problem to be solved by the present invention is to provide an image defogging method, system, storage medium, and electronic device based on superpixel segmentation in view of the above-mentioned prior art defects of the prior art.
本发明解决其技术问题所采用的技术方案是:构造一种基于超像素分割的图像去雾方法,包括:The technical solution adopted by the present invention to solve its technical problems is to construct an image defogging method based on super pixel segmentation, including:
S1、获取雾霾图像对应的全局大气光值,并通过超像素分割对所述雾霾图像进行分割,以获取所述雾霾图像对应的超像素集;S1. Obtain the global atmospheric light value corresponding to the haze image, and segment the haze image by super pixel segmentation to obtain a super pixel set corresponding to the haze image;
S2、基于所述超像素集通过预设成本函数获取所述雾霾图像对应的初始透射率图;S2. Obtain an initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
S3、对所述初始透射率图进行细化处理以获取目标透射率图;S3. Refine the initial transmittance map to obtain a target transmittance map;
S4、根据所述目标透射率图和所述全局大气光值获取所述雾霾图像对应的 清晰图像。S4. Obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
优选地,所述步骤S1中,所述获取所述雾霾图像对应的全局大气光值包括:Preferably, in the step S1, the obtaining the global atmospheric light value corresponding to the haze image includes:
S111、划分所述雾霾图像为四个区域;S111. Divide the haze image into four regions.
S112、获取每个区域的像素平均值与标准差的差值,并获取最大差值所对应的区域;S112. Obtain the difference between the average value of the pixels and the standard deviation of each area, and obtain the area corresponding to the maximum difference.
S113、判定所述区域是否小于一预设值,若否,则执行步骤S114,若是,则执行步骤S115;S113: Determine whether the area is smaller than a preset value, if not, perform step S114, if yes, perform step S115;
S114、将所述区域划分为四个区域,并执行步骤S112;S114: Divide the area into four areas, and execute step S112;
S115、获取所述区域中像素平均值以设为所述雾霾图像对应的全局大气光值;和/或S115. Obtain the average value of pixels in the area to set it as the global atmospheric light value corresponding to the haze image; and/or
在所述步骤S1中,所述通过超像素分割对雾霾图像进行分割,以获取所述雾霾图像对应的超像素集包括:通过SLIC超像素分割对雾霾图像进行分割;和/或In the step S1, the segmenting the haze image through super pixel segmentation to obtain the super pixel set corresponding to the haze image includes: segmenting the haze image through SLIC super pixel segmentation; and/or
在所述步骤S2中,所述基于所述超像素集通过预设成本函数获取所述雾霾图像对应的初始透射率图包括:In the step S2, the obtaining an initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set includes:
S21、获取所述超像素集的对比度对应的第一成本函数,以及所述超像素集的信息熵对应的第二成本函数;S21: Acquire a first cost function corresponding to the contrast of the super pixel set, and a second cost function corresponding to the information entropy of the super pixel set;
S22、基于所述第一成本函数和所述第二成本函数获取所述超像素集对应的第三成本函数;S22: Obtain a third cost function corresponding to the super pixel set based on the first cost function and the second cost function;
S23、基于所述第三成本函数进行迭代以获取使所述第三成本函数为最小值时对应的透射率图为所述雾霾图像对应的初始透射率图;和/或S23. Perform iteration based on the third cost function to obtain the transmittance map corresponding to the minimum value of the third cost function as the initial transmittance map corresponding to the haze image; and/or
在所述步骤S3中,所述对所述初始透射率图进行细化处理以获取目标透射率图包括:基于导向滤波对所述初始透射率图进行细化处理;和/或In the step S3, the performing refinement processing on the initial transmittance map to obtain the target transmittance map includes: performing refinement processing on the initial transmittance map based on guided filtering; and/or
在所述步骤S4中,所述根据所述透射率图和所述全局大气光值获取所述雾霾图像对应的清晰图像包括:采用以下公式获取所述雾霾图像对应的清晰图像,In the step S4, the obtaining a clear image corresponding to the haze image according to the transmittance map and the global atmospheric light value includes: obtaining a clear image corresponding to the haze image by using the following formula,
Figure PCTCN2019094616-appb-000004
Figure PCTCN2019094616-appb-000004
其中,I(x)为雾霾图像,J(x)为清晰图像,t为所述目标透射率图,A为全局大气光值。Among them, I(x) is the haze image, J(x) is the clear image, t is the target transmittance map, and A is the global atmospheric light value.
优选地,所述第一成本函数为对比度成本函数,所述对比度成本函数满足如下公式:Preferably, the first cost function is a contrast cost function, and the contrast cost function satisfies the following formula:
Figure PCTCN2019094616-appb-000005
Figure PCTCN2019094616-appb-000005
其中,x为像素点的位置,c∈{r,g,b}为像素点x的某个颜色通道,D为任一超像素集对应的超像素区域,J c(x)为清晰图像在c通道内的像素值,N x为所述超像素区域的像素点个数;
Figure PCTCN2019094616-appb-000006
为所述超像素区域的J c(x)的平均值,N x表示所述任一超像素集的像素点个数,I c(x)表示像素点x在颜色通道c中的像素值,
Figure PCTCN2019094616-appb-000007
是雾霾图像区域块内I c(x)的平均值;
Where x is the position of the pixel, c∈{r,g,b} is a certain color channel of the pixel x, D is the superpixel area corresponding to any superpixel set, and J c (x) is the clear image The pixel value in the c channel, N x is the number of pixels in the super pixel area;
Figure PCTCN2019094616-appb-000006
Is the average value of J c (x) of the super pixel area, N x represents the number of pixels in any super pixel set, I c (x) represents the pixel value of pixel x in color channel c,
Figure PCTCN2019094616-appb-000007
Is the average value of I c (x) in the haze image area;
所述第二成本函数为信息熵成本函数,所述信息熵成本函数满足如下公式:The second cost function is an information entropy cost function, and the information entropy cost function satisfies the following formula:
Figure PCTCN2019094616-appb-000008
Figure PCTCN2019094616-appb-000008
其中,min{0,J c(p)}、max{0,J c(p)-255}分别表示像素点下溢和上溢的溢出值,h c(i)表示输入像素点的直方图取值,α c和β c表示发生截断的像素值; Among them, min{0, J c (p)}, max{0, J c (p)-255} represent the overflow value of pixel underflow and overflow respectively, and h c (i) represents the histogram of the input pixel Take the value, α c and β c represent the pixel value that is truncated;
所述第三成本函数满足以下公式:The third cost function satisfies the following formula:
L=L contrastDL infoL=L contrastD L info ,
其中,L contrast表示对比度成本函数,L info表示信息熵成本函数,λ D是协调对比度损失和信息熵损失的权重参数。 Among them, L contrast represents the contrast cost function, L info represents the information entropy cost function, and λ D is the weight parameter that coordinates the contrast loss and the information entropy loss.
优选地,λ D取值为6。 Preferably, the value of λ D is 6.
优选地,所述通过SLIC超像素分割对雾霾图像进行分割包括:Preferably, the segmentation of the haze image by SLIC superpixel segmentation includes:
S121、对所述雾霾图像进行颜色空间转换以获取CIELab颜色空间,根据所述超像素集的预设大小值获取所述雾霾图像的初始中心点;S121: Perform color space conversion on the haze image to obtain a CIELab color space, and obtain an initial center point of the haze image according to a preset size value of the superpixel set;
S122、基于所述初始中心点对所述雾霾图像的像素点按坐标和所述CIELab颜色空间进行五维类聚,以获取初始超像素集;S122: Perform five-dimensional clustering on the pixel points of the haze image and the CIELab color space based on the initial center point to obtain an initial superpixel set;
S123、获取所述初始超像素集像素点的梯度值,修正所述初始中心点与最小梯度值所对应,以获取修正后的初始中心点;S123: Obtain a gradient value of a pixel point of the initial super pixel set, and correct the initial center point corresponding to the minimum gradient value to obtain a corrected initial center point;
S124、基于所述修正后的初始中心点对所述雾霾图像的像素点按坐标和所述CIELab颜色空间进行五维类聚,以获取修正后的初始超像素集,并计数一次,判定当前及以往的计数次数是否满足预设计数值,若否,执行所述步骤S123;若是,则执行步骤S125;S124. Perform five-dimensional clustering on the pixel points of the haze image and the CIELab color space based on the corrected initial center point to obtain a corrected initial superpixel set, and count once to determine the current And whether the previous count times meet the pre-designed value, if not, execute the step S123; if yes, execute the step S125;
S125、以所述修正后的初始超像素集为所述雾霾图像对应的超像素集。S125. Use the corrected initial super pixel set as a super pixel set corresponding to the haze image.
优选地,Preferably,
所述超像素集的预设大小值满足大于300个像素点小于1500个像素点;和/或The preset size value of the super pixel set satisfies the requirement of greater than 300 pixels and less than 1500 pixels; and/or
所述预设计数值为10。The preset count value is 10.
优选地,所述超像素集的预设大小值为900个像素点。Preferably, the preset size value of the super pixel set is 900 pixels.
本发明还构造一种基于超像素分割的图像去雾系统,包括:The present invention also constructs an image defogging system based on super pixel segmentation, including:
第一处理单元,用于获取所述雾霾图像对应的全局大气光值;The first processing unit is configured to obtain the global atmospheric light value corresponding to the haze image;
分割单元,用于通过超像素分割对雾霾图像进行分割,以获取所述雾霾图像对应的超像素集;A segmentation unit, configured to segment the haze image through super pixel segmentation to obtain a super pixel set corresponding to the haze image;
第二处理单元,用于基于所述超像素集通过预设成本函数获取所述雾霾图像对应的透射率图;A second processing unit, configured to obtain a transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
第三处理单元,用于对所述初始透射率图进行细化处理以得到目标透射率图;A third processing unit, configured to refine the initial transmittance map to obtain a target transmittance map;
第四处理单元,用于根据所述目标透射率图和所述全局大气光值获取所述雾霾图像对应的清晰图像。The fourth processing unit is configured to obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
本发明还构造一种计算机存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上面任意一项所述的基于超像素分割的图像去雾 方法。The present invention also constructs a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method for image defogging based on superpixel segmentation as described in any one of the above is realized.
本发明还构造一种电子设备,包括存储器和处理器;The present invention also constructs an electronic device, including a memory and a processor;
所述存储器用于存储计算机程序;The memory is used to store computer programs;
所述处理器用于执行所述计算机程序实现如上面任意一项所述的基于超像素分割的图像去雾方法。The processor is configured to execute the computer program to implement the image defogging method based on superpixel segmentation as described in any one of the above.
实施本发明的一种基于超像素分割的图像去雾方法、系统、存储介质及电子设备,具有以下有益效果:真实雾霾图像与合成雾霾图像数据集上均具有良好的去雾效果。An image defogging method, system, storage medium, and electronic device based on superpixel segmentation implemented in the present invention have the following beneficial effects: both real haze images and synthetic haze image data sets have good defogging effects.
附图说明Description of the drawings
下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with the accompanying drawings and embodiments. In the accompanying drawings:
图1是本发明基于超像素分割的图像去雾方法一实施例的程序流程图;FIG. 1 is a program flowchart of an embodiment of an image defogging method based on superpixel segmentation of the present invention;
图2是本发明基于超像素分割的图像去雾方法另一实施例的程序流程图;2 is a program flowchart of another embodiment of the image defogging method based on super pixel segmentation of the present invention;
图3是全局大气光值估计结果示例图;Figure 3 is an example diagram of global atmospheric light value estimation results;
图4是本发明基于超像素分割的图像去雾方法另一实施例的程序流程图;4 is a program flowchart of another embodiment of the image defogging method based on super pixel segmentation of the present invention;
图5是超像素面积对比示意图;Figure 5 is a schematic diagram of the comparison of super pixel areas;
图6是像素点的聚类搜索区域示意图;Fig. 6 is a schematic diagram of a clustering search area of pixels;
图7-图10是SLIC超像素分割算法迭代示意图;Figures 7-10 are schematic diagrams of iterative SLIC superpixel segmentation algorithm;
图11是本发明基于超像素分割的图像去雾方法另一实施例的程序流程图;FIG. 11 is a program flowchart of another embodiment of an image defogging method based on superpixel segmentation according to the present invention;
图12是像素截断示意图;Figure 12 is a schematic diagram of pixel cut-off;
图13是不同λ D下的图像去雾效果; Figure 13 shows the image defogging effect under different λ D ;
图14-图15为不同去雾方法透射率图对比示意图;Figures 14-15 are schematic diagrams showing the comparison of transmittance diagrams of different defogging methods;
图16-图17为不同去雾方法雾霾图像去雾效果对比示意图。Figures 16-17 are schematic diagrams showing the comparison of defogging effects of haze images with different defogging methods.
具体实施方式Detailed ways
为了对本发明的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本发明的具体实施方式。In order to have a clearer understanding of the technical features, objectives and effects of the present invention, the specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
如图1所示,在本发明的基于超像素分割的图像去雾方法第一实施例中, 包括:As shown in FIG. 1, in the first embodiment of the image defogging method based on superpixel segmentation of the present invention, the method includes:
S1、获取雾霾图像对应的全局大气光值,并通过超像素分割对雾霾图像进行分割,以获取雾霾图像对应的超像素集;S2、基于超像素集通过预设成本函数获取雾霾图像对应的初始透射率图;S3、对初始透射率图进行细化处理以获取目标透射率图;S4、根据目标透射率图和全局大气光值获取雾霾图像对应的清晰图像。S1. Obtain the global atmospheric light value corresponding to the haze image, and segment the haze image by superpixel segmentation to obtain the superpixel set corresponding to the haze image; S2, obtain the haze through the preset cost function based on the superpixel set The initial transmittance map corresponding to the image; S3, the initial transmittance map is refined to obtain the target transmittance map; S4, the clear image corresponding to the haze image is obtained according to the target transmittance map and the global atmospheric light value.
具体的,广泛应用于雾霾天气下的图像处理领域的大气散射模型描述了大气散射过程和环境光衰减的原理。其详细的技术原理单光源下的大气散射模型,该模型将到达成像设备的光线分为两部分:一部分是直接衰减光线,场景的反射光传播到成像设备的过程中,受空气中颗粒物的散射作用,发生入射光衰减,称为直接光衰减;另一部分是大气光直接作用在空气中的悬浮颗粒上,散射后被成像设备接收,并在目标图像上发生重叠,称为附加散射光线。通常这两部分光线都存在,雾霾程度越低的图像,直接衰减光线在图像中占比越高;雾霾程度越高的图像,附加散射光线在图像中占比越高。在上面的基础上,在图像去雾领域,根据有雾图像和去雾图像的关系参照下列公式。Specifically, the atmospheric scattering model, which is widely used in the field of image processing under haze weather, describes the atmospheric scattering process and the principle of ambient light attenuation. The detailed technical principle of the atmospheric scattering model under a single light source. This model divides the light reaching the imaging device into two parts: one is directly attenuating the light, and the reflected light of the scene is scattered by particles in the air during the process of propagating to the imaging device The effect is that the incident light attenuation occurs, which is called direct light attenuation; the other part is that atmospheric light directly acts on the suspended particles in the air, is received by the imaging device after being scattered, and overlaps on the target image, which is called additional scattered light. Usually these two parts of light exist, the lower the haze degree, the higher the proportion of the direct attenuation light in the image; the higher the haze degree, the higher the proportion of additional scattered light in the image. On the basis of the above, in the field of image defogging, refer to the following formula according to the relationship between the foggy image and the defogging image.
I(x)=J(x)t(x)+A(1-t(x))                      (1)I(x)=J(x)t(x)+A(1-t(x)) (1)
其中,I(x)为雾霾图像,A为全局大气光值,t(x)为透射率图,J(x)为清晰图像。在上面的基础上,先获取雾霾图像对应的全局大气光值,然后获取雾霾图像对应的透射率图,其雾霾图像对应的透视率获取过程,先通过像素点聚类,得到紧凑、近似的超像素集。同时定义成本函数,通过最小化成本函数得到超像素集合内的透射率图最优解即为雾霾图像的初始透射率图。成本函数的设计可基于多种图像特征,例如:对比度、信息熵、饱和度等特征。由于直接使用基于成本函数获取的透射率图会产生块效应,需要对获取的初始透射率图使透射率图获得接近雾霾图像的纹理即进行细化处理,以得到雾霾图像对应的目标透射率图。Among them, I(x) is the haze image, A is the global atmospheric light value, t(x) is the transmittance map, and J(x) is the clear image. On the basis of the above, first obtain the global atmospheric light value corresponding to the haze image, and then obtain the transmittance map corresponding to the haze image. The process of obtaining the perspective ratio corresponding to the haze image is first through pixel clustering to obtain compact, Approximate set of superpixels. At the same time, the cost function is defined, and the optimal solution of the transmittance map in the super pixel set is obtained by minimizing the cost function, which is the initial transmittance map of the haze image. The design of the cost function can be based on a variety of image characteristics, such as contrast, information entropy, saturation and other characteristics. Since the direct use of the transmittance map acquired based on the cost function will produce blockiness, it is necessary to refine the acquired initial transmittance map so that the transmittance map can obtain a texture close to the haze image to obtain the target transmission corresponding to the haze image Rate graph.
进一步的,如图2所示,步骤S1中,获取雾霾图像对应的全局大气光值包括:Further, as shown in FIG. 2, in step S1, obtaining the global atmospheric light value corresponding to the haze image includes:
S111、划分雾霾图像为四个区域;S111. Divide the haze image into four regions;
S112、获取每个区域的像素平均值与标准差的差值,并获取最大差值所对应的区域;S112. Obtain the difference between the average value of the pixels and the standard deviation of each area, and obtain the area corresponding to the maximum difference.
S113、判定区域是否小于一预设值,若否,则执行步骤S114,若是,则执行步骤S115;S113: Determine whether the area is smaller than a preset value, if not, perform step S114, if yes, perform step S115;
S114、将区域划分为四个区域,并执行步骤S112;S114: Divide the area into four areas, and execute step S112;
S115、获取区域中像素平均值以设为雾霾图像对应的全局大气光值;S115. Obtain an average value of pixels in the area to set the global atmospheric light value corresponding to the haze image;
具体的,传统的全局大气光值估计方法是:取图片亮度最大的少量像素点,将这些像素点各通道的平均值作为全局大气光值。但是,图片中若出现车灯、路灯等人造光源,全局大气光值就可能估计错误。为提高全局大气光值的估算精度,本文采用基于对比度和亮度的四叉树估算方法。其具体过程为,将雾霾图像均匀划分为四个区域。之后,并将每个区域像素的平均值减去标准差,保证其值最大的区域平均亮度最大且对比度最小。最后,循环此过程,直至区域内像素点小于预设值。此时,该区域各通道的平均亮度就是全局大气光估计值。图3展示了全局大气光估计结果的示例图。通过选取平均亮度减去对比度值最大的区域块,最终选定白色高亮区域中各通道亮度的最大值作为此幅雾霾图像的全局大气光值。Specifically, the traditional method for estimating the global atmospheric light value is to take a small number of pixels with the largest brightness in the picture, and use the average value of each channel of these pixels as the global atmospheric light value. However, if artificial light sources such as car lights and street lights appear in the picture, the global atmospheric light value may be estimated incorrectly. In order to improve the estimation accuracy of global atmospheric light value, this paper adopts a quadtree estimation method based on contrast and brightness. The specific process is to evenly divide the haze image into four regions. After that, subtract the standard deviation from the average value of each area pixel to ensure that the area with the largest value has the largest average brightness and the smallest contrast. Finally, loop this process until the pixels in the area are less than the preset value. At this time, the average brightness of each channel in the area is the global atmospheric light estimate. Figure 3 shows an example graph of the global atmospheric light estimation results. By selecting the average brightness minus the area block with the largest contrast value, the maximum value of each channel brightness in the white highlight area is finally selected as the global atmospheric light value of this haze image.
可选的,在步骤S1中,通过超像素分割对雾霾图像进行分割,以获取雾霾图像对应的超像素集包括:通过SLIC超像素分割对雾霾图像进行分割;具体的,SLIC超像素分割是一种思想简单,易于实现的图像分割算法。该算法执行速度快,能较完整地保持物体轮廓,生成的超像素块分布均匀、结构紧凑、特征近似,且易于与基于像素的方法相互转换。其他的实施例中,采用其它图像分割算法也可产生类似的分割效果。Optionally, in step S1, segmenting the haze image through super pixel segmentation to obtain a super pixel set corresponding to the haze image includes: segmenting the haze image through SLIC super pixel segmentation; specifically, SLIC super pixel Segmentation is an image segmentation algorithm with simple thinking and easy implementation. The algorithm has fast execution speed and can maintain the contour of the object relatively completely. The generated super pixel blocks are uniformly distributed, compact in structure, similar in features, and easy to convert with pixel-based methods. In other embodiments, other image segmentation algorithms can also produce similar segmentation effects.
进一步的,如图4所示,通过SLIC超像素分割对雾霾图像进行分割包括:Further, as shown in Figure 4, segmenting the haze image through SLIC superpixel segmentation includes:
S121、对雾霾图像进行颜色空间转换以获取CIELab颜色空间,根据超像素集的预设大小值获取雾霾图像的初始中心点;具体的,虽然图像在RGB空间或CIELab空间都可直接进行SLIC超像素分割。但是图像在CIELab空间的分割效果比在其它颜色空间更好,分割后的超像素块更细致。中心点个数与超像素集平均大小有关。计算中心点的方法是:将图像的总像素数除以超像素集大 小,并取整。超像素集初始大小需要预定义。初始中心点定义为种子点,中心点的个数与超像素集的数量相同,并在迭代中保持恒定。SLIC超像素分割会按预定义的超像素集大小在图像内均匀分配种子点。超像素集预设大小不宜过大,保证超像素集合内场景深度一致即可。超像素分割过程中,可自行定义超像素集平均大小,即超像素内像素点的平均个数。选取原则是:使超像素集内的场景深度保持一致。图5展示了平均超像素集大小对分割结果的影响。其中(a)为原始雾霾图像,(b)为超像素集大小为1500,(c)为超像素集大小为900,(d)为超像素集大小为300。当超像素集大小为1500像素点时,由于取值过大,部分区域内景深一致性已无法保证。当集合大小设为900时,基本可以保证超像素集合内景深一致。而当参数取为300时,超像素集合总数过多,会增加计算量。本实施例中,超像素集大小设为900。S121. Perform color space conversion on the haze image to obtain the CIELab color space, and obtain the initial center point of the haze image according to the preset size value of the superpixel set; specifically, although the image can be directly SLIC in the RGB space or the CIELab space Super pixel segmentation. But the image segmentation effect in CIELab space is better than in other color spaces, and the segmented super pixel blocks are more detailed. The number of center points is related to the average size of the superpixel set. The method of calculating the center point is to divide the total number of pixels of the image by the size of the super pixel set and round up. The initial size of the super pixel set needs to be predefined. The initial center point is defined as the seed point, and the number of center points is the same as the number of super pixel sets and remains constant during iterations. SLIC super pixel segmentation will uniformly distribute seed points in the image according to the predefined super pixel set size. The preset size of the super pixel set should not be too large, and the depth of the scene in the super pixel set should be consistent. In the process of super pixel segmentation, you can define the average size of the super pixel set, that is, the average number of pixels in the super pixel. The selection principle is to keep the scene depth in the super pixel set consistent. Figure 5 shows the effect of the average superpixel set size on the segmentation results. Where (a) is the original haze image, (b) is the super pixel set size of 1500, (c) is the super pixel set size of 900, and (d) is the super pixel set size of 300. When the size of the super pixel set is 1500 pixels, because the value is too large, the consistency of the depth of field in some areas cannot be guaranteed. When the set size is set to 900, it can basically ensure the same depth of field in the super pixel set. When the parameter is set to 300, the total number of super pixel sets is too large, which will increase the amount of calculation. In this embodiment, the super pixel set size is set to 900.
S122、基于初始中心点对雾霾图像的像素点按坐标和CIELab颜色空间进行五维类聚,以获取初始超像素集;具体的,SLIC超像素分割是聚类算法,规定图片每一像素点的(x,y)坐标值和(L,a,b)颜色值构成一个五维向量[x,y,L,a,b],两个像素点的相似性由它们之间的向量距离度量。如图6所示的像素点的聚类搜索区域,每个像素点的搜索范围为2S×2S的领域,其中S为初始种子点之间的距离。这种局部聚类策略可以加速收敛,并保持区域块的连通性。S122. Perform five-dimensional clustering of the pixels of the haze image by coordinates and CIELab color space based on the initial center point to obtain the initial superpixel set; specifically, the SLIC superpixel segmentation is a clustering algorithm that specifies each pixel of the picture The (x, y) coordinate value and (L, a, b) color value form a five-dimensional vector [x, y, L, a, b], and the similarity of two pixels is measured by the vector distance between them . As shown in FIG. 6 for the cluster search area of pixels, the search range of each pixel is a 2S×2S area, where S is the distance between the initial seed points. This local clustering strategy can accelerate convergence and maintain the connectivity of regional blocks.
S123、获取初始超像素集像素点的梯度值,修正初始中心点与最小梯度值所对应,以获取修正后的初始中心点;具体的,计算每个超像素集合内所有像素点的梯度值,将中心点移到该邻域内梯度最小处。这样做可以避免中心点落在梯度较大的边界上,影响后续聚类效果。S123. Obtain the gradient values of the pixels of the initial superpixel set, and correct the initial center point and the minimum gradient value to obtain the corrected initial center point; specifically, calculate the gradient values of all pixels in each superpixel set, Move the center point to the smallest gradient in the neighborhood. This can prevent the center point from falling on the boundary with a larger gradient, which will affect the subsequent clustering effect.
S124、基于修正后的初始中心点对雾霾图像的像素点按坐标和CIELab颜色空间进行五维类聚,以获取修正后的初始超像素集,并计数一次,判定当前及以往的计数次数是否满足预设计数值,若否,执行步骤S123;若是,则执行步骤S125;S124. Perform five-dimensional clustering on the pixel points of the haze image according to the coordinates and CIELab color space based on the corrected initial center point to obtain the corrected initial superpixel set, and count it once to determine whether the current and past count times are Meet the pre-designed value, if not, go to step S123; if yes, go to step S125;
S125、以修正后的初始超像素集为雾霾图像对应的超像素集。具体的,新的中心点位置确认后,基于修正后的初始中心点对雾霾图像的像素点按坐标和 CIELab颜色空间进行五维类聚,以获取修正后的初始超像素集进行迭代。当迭代超过一定次数即预设计数值,图像超像素分割结果将不再变化。SLIC超像素分割方法迭代10次以后,分割结果通常开始变得稳定。图7至图10为分别迭代4次,6次、8次和10次的分割结果,由图7和图8可知,6次迭代后,图片中的电视塔区域对应图中方框标识区域被切割出来;图9和图10可知,8次迭代与10次迭代的分割结果变化不大。S125. Use the corrected initial super pixel set as the super pixel set corresponding to the haze image. Specifically, after the position of the new center point is confirmed, five-dimensional clustering is performed on the pixel coordinates of the haze image and the CIELab color space based on the corrected initial center point to obtain a corrected initial superpixel set for iteration. When the iteration exceeds a certain number of times, the pre-designed value, the image superpixel segmentation result will no longer change. After 10 iterations of the SLIC superpixel segmentation method, the segmentation results usually start to become stable. Figures 7 to 10 show the segmentation results of 4 iterations, 6, 8, and 10 iterations respectively. It can be seen from Figures 7 and 8 that after 6 iterations, the TV tower area in the picture is cut corresponding to the box mark area in the figure. Come out; Figure 9 and Figure 10 show that the segmentation results of 8 iterations and 10 iterations do not change much.
本实施例中,SLIC超像素分割迭代次数上限设为10次。In this embodiment, the upper limit of the number of iterations of SLIC superpixel segmentation is set to 10 times.
可选的,如图11所示,在步骤S2中,基于超像素集通过预设成本函数获取雾霾图像对应的初始透射率图包括:Optionally, as shown in FIG. 11, in step S2, obtaining the initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set includes:
S21、获取超像素集的对比度对应的第一成本函数,以及超像素集的信息熵对应的第二成本函数;S21: Obtain a first cost function corresponding to the contrast of the super pixel set, and a second cost function corresponding to the information entropy of the super pixel set;
S22、基于第一成本函数和第二成本函数获取超像素集对应的第三成本函数;S22: Obtain a third cost function corresponding to the super pixel set based on the first cost function and the second cost function;
S23、基于第三成本函数进行迭代以获取使第三成本函数为最小值对应的透射率图为雾霾图像对应的初始透射率图;S23: Perform iteration based on the third cost function to obtain the transmittance map corresponding to the minimum value of the third cost function as the initial transmittance map corresponding to the haze image;
具体的,完成超像素分割图像后,需要估计超像素集合内的透射率图。在透射率图的计算过程中,成本函数的设计可基于多种图像特征,如:对比度、信息熵、饱和度等特征。本实施例中选取对比度和信息熵。为提高去雾图像的信息熵和对比度,本实施例中,同时通过第三成本函数均衡超像素集合内的信息损失和对比度损失。Specifically, after completing the superpixel segmentation image, it is necessary to estimate the transmittance map in the superpixel set. In the calculation process of the transmittance map, the design of the cost function can be based on a variety of image characteristics, such as contrast, information entropy, saturation and other characteristics. In this embodiment, contrast and information entropy are selected. In order to improve the information entropy and contrast of the defogging image, in this embodiment, the third cost function is used to balance the information loss and contrast loss in the super pixel set at the same time.
进一步的,第一成本函数为对比度成本函数,对比度成本函数满足如下公式:Further, the first cost function is a contrast cost function, and the contrast cost function satisfies the following formula:
Figure PCTCN2019094616-appb-000009
Figure PCTCN2019094616-appb-000009
其中,x为像素点的位置,c∈{r,g,b}为像素点x的某个颜色通道,D为任一超像素集对应的超像素区域,J c(x)为清晰图像在c通道内的像素值,N x为超像素区域的像素点个数;
Figure PCTCN2019094616-appb-000010
为超像素区域的J c(x)的平均值,N x表示任一 超像素集的像素点个数,I c(x)表示像素点x在颜色通道c中的像素值,
Figure PCTCN2019094616-appb-000011
是雾霾图像区域块内I c(x)的平均值;
Where x is the position of the pixel, c∈{r,g,b} is a certain color channel of the pixel x, D is the superpixel area corresponding to any superpixel set, and J c (x) is the clear image The pixel value in the c channel, N x is the number of pixels in the super pixel area;
Figure PCTCN2019094616-appb-000010
Is the average value of J c (x) in the super pixel area, N x represents the number of pixels in any super pixel set, and I c (x) represents the pixel value of pixel x in color channel c,
Figure PCTCN2019094616-appb-000011
Is the average value of I c (x) in the haze image area;
第二成本函数为信息熵成本函数,信息熵成本函数满足如下公式:The second cost function is the information entropy cost function, and the information entropy cost function satisfies the following formula:
Figure PCTCN2019094616-appb-000012
Figure PCTCN2019094616-appb-000012
其中,min{0,J c(p)}、max{0,J c(p)-255}分别表示像素点下溢和上溢的溢出值,h c(i)表示输入像素点的直方图取值,α c和β c表示发生截断的像素值; Among them, min{0, J c (p)}, max{0, J c (p)-255} represent the overflow value of pixel underflow and overflow respectively, and h c (i) represents the histogram of the input pixel Take the value, α c and β c represent the pixel value that is truncated;
第三成本函数满足以下公式:The third cost function satisfies the following formula:
L=L contrastDL info                            (4) L=L contrastD L info (4)
其中,L contrast表示对比度成本函数,L info表示信息熵成本函数,λ D是协调对比度损失和信息熵损失的权重参数。 Among them, L contrast represents the contrast cost function, L info represents the information entropy cost function, and λ D is the weight parameter that coordinates the contrast loss and the information entropy loss.
具体的,图像分割后,超像素集合内场景深度相同,透射率图也相同。对公式(1)进行变形,得到超像素集对应的清晰图像的公式为:Specifically, after the image is divided, the scene depth in the super pixel set is the same, and the transmittance map is also the same. The formula (1) is modified to obtain the clear image corresponding to the super pixel set as:
Figure PCTCN2019094616-appb-000013
Figure PCTCN2019094616-appb-000013
其中,A为全局大气光值,I(x)为雾霾图像,t为目标透射率图。Among them, A is the global atmospheric light value, I(x) is the haze image, and t is the target transmittance map.
在本实施例中,可采用均方差对比度C MSE评估待复原图像区域块内的对比度。公式如下: In this embodiment, the mean square error contrast C MSE can be used to evaluate the contrast in the image area block to be restored. The formula is as follows:
Figure PCTCN2019094616-appb-000014
Figure PCTCN2019094616-appb-000014
其中,c∈{r,g,b},表示像素点x的某个颜色通道。J c(x)表示清晰图像的像素点x在颜色通道c的块内像素值。
Figure PCTCN2019094616-appb-000015
是块内J c(x)的平均值,N表示块内的像素点个数,将公式(5)代入(6),得到:
Among them, c∈{r,g,b} represents a certain color channel of pixel x. J c (x) represents the pixel value of the pixel point x of the clear image in the block of the color channel c.
Figure PCTCN2019094616-appb-000015
Is the average value of J c (x) in the block, and N represents the number of pixels in the block. Substitute formula (5) into (6) to obtain:
Figure PCTCN2019094616-appb-000016
Figure PCTCN2019094616-appb-000016
其中,I c(x)表示像素点x在颜色通道c中的像素值,
Figure PCTCN2019094616-appb-000017
是雾霾图像区域块内I c(x)的平均值。
Among them, I c (x) represents the pixel value of pixel x in color channel c,
Figure PCTCN2019094616-appb-000017
Is the average value of I c (x) in the haze image area.
从公式(7)中可以看出,对比度C MSE是关于透射率t的递减函数,即透射率t越小,对比度越高。因此,可定义对比度损失函数L contrast如公式(2),可见,对比度成本函数L contrast越小,图像对比度越大。因此,可通过最小化对比度成本函数来最大化超像素集合内的对比度。 It can be seen from formula (7) that the contrast C MSE is a decreasing function of the transmittance t, that is, the smaller the transmittance t, the higher the contrast. Therefore, the contrast loss function L contrast can be defined as in formula (2). It can be seen that the smaller the contrast cost function L contrast , the greater the image contrast. Therefore, the contrast within the superpixel set can be maximized by minimizing the contrast cost function.
同时,在确定全局大气光值A和超像素内透射率t后,根据公式(5)可得到输入像素值I c(x)与输出像素值J c(x)的映射。如图12所示,输入像素值在[α,β]范围内,即可保证输出值映射区间为[0,255]。输入像素值的有效范围[α,β]由透射率图t决定。当超像素集合所有像素值属于[α,β]时,输出像素值分布于[0,255],图像对比度较高;若超像素集合内像素值不属于[α,β],则输出像素值超出灰度值有效区域[0,255]。这种情况下,超出合法区域的输出像素值被截断,出现信息丢失(如图12中黑色区域所示),并导致图像信息熵下降。经分析可知:透射率图t越大,黑色区域面积越小,[α,β]区间长度越大。即:透射率图t越大,待复原图像中被截断的像素就越少,信息丢失越少,信息熵越高。因此:可定义信息熵成本函数L info如公式(3),通过最小化信息熵成本函数L info,可使超像素集合内信息熵损失最小。 At the same time, after determining the global atmospheric light value A and the intra-superpixel transmittance t, the mapping between the input pixel value I c (x) and the output pixel value J c (x) can be obtained according to formula (5). As shown in Figure 12, if the input pixel value is in the range of [α, β], the output value mapping interval is guaranteed to be [0, 255]. The effective range [α, β] of the input pixel value is determined by the transmittance map t. When all the pixel values of the super pixel set belong to [α, β], the output pixel value is distributed in [0,255], and the image contrast is high; if the pixel value in the super pixel set does not belong to [α, β], the output pixel value exceeds gray Valid area of degree value [0,255]. In this case, the output pixel values beyond the legal area are cut off, information loss occurs (as shown in the black area in FIG. 12), and the image information entropy decreases. The analysis shows that the larger the transmittance graph t, the smaller the area of the black area, and the greater the length of the [α, β] interval. That is: the larger the transmittance map t, the fewer pixels to be truncated in the image to be restored, the less information is lost, and the higher the information entropy. Therefore: the information entropy cost function L info can be defined as in formula (3), by minimizing the information entropy cost function L info , the information entropy loss in the super pixel set can be minimized.
在获取了对比度成本函数和信息熵成本函数,设置与对比度成本函数和信息熵成本函数相关的改进成本函数,来提高图像对比度和降低信息损失。其具体满足公式(4),λ D取较大值可以减小信息熵损失,当λ D取无穷大时不发生信息熵损失,此时: After obtaining the contrast cost function and the information entropy cost function, an improved cost function related to the contrast cost function and the information entropy cost function is set to improve the image contrast and reduce the information loss. It satisfies the formula (4). A larger value of λ D can reduce the information entropy loss. When λ D is infinite, no information entropy loss occurs. At this time:
Figure PCTCN2019094616-appb-000018
Figure PCTCN2019094616-appb-000018
Figure PCTCN2019094616-appb-000019
Figure PCTCN2019094616-appb-000019
其中,A c表示通道c中的全局大气光值,D表示超像素区域,I c(x)表示像素点x在颜色通道c中的像素值。 Among them, Ac represents the global atmospheric light value in channel c, D represents the super pixel area, and I c (x) represents the pixel value of pixel x in color channel c.
将公式(8)和(9)合并:Combine formulas (8) and (9):
Figure PCTCN2019094616-appb-000020
Figure PCTCN2019094616-appb-000020
通过公式(10)中可看出,透射率图t越小,对比度损失函数L contrast越小,即对比度越高。所以,在信息熵损失可接受的条件下,透射率图的取值应为: It can be seen from formula (10) that the smaller the transmittance graph t, the smaller the contrast loss function L contrast , that is, the higher the contrast. Therefore, under the condition that the loss of information entropy is acceptable, the value of the transmittance map should be:
Figure PCTCN2019094616-appb-000021
Figure PCTCN2019094616-appb-000021
综上,公式(10)的约束条件与暗通道先验中的约束条件相同,公式(11)约束了像素点去雾后可能出现的灰度值上溢,可看做对暗通道先验方法的补充。本文将改进后的算法命名为超像素成本函数算法,实验结果表明,该方法可更有效地估算透射率图t。同时,通过调节参数λ D的取值,可在增加对比度和减少信息熵损失之间取得较好的平衡。 In summary, the constraint conditions of formula (10) are the same as those in the dark channel prior. Formula (11) constrains the gray value overflow that may occur after the pixels are defogged, which can be regarded as a priori method for the dark channel Supplement. In this paper, the improved algorithm is named the superpixel cost function algorithm. The experimental results show that this method can more effectively estimate the transmittance map t. At the same time, by adjusting the value of the parameter λ D , a better balance can be achieved between increasing the contrast and reducing the loss of information entropy.
公式(4)提出的权重参数λ D,其意义在于,权衡提高对比度与减少信息熵的重要性。根据图13的λ D不同取值的去雾效果,其中(a)为原始雾霾图像,(b)为λ D=3的去雾效果,(c)为λ D=6的去雾效果,(d)为λ D=10的去雾效果,可得到:当λ D=3时,去雾后图像的对比度有所提高,但由于产生较多信息截断,图片中过暗和过亮的像素点较多。当λ D=10时,信息丢失产生的不自然像素有所减少,但对比度过低,不能完全去雾。当λ D=6时,在提高图像对比度和抑制信息损失之间取得平衡。因此,超像素成本函数图像去雾算法中λ D设置为6。 The weight parameter λ D proposed in formula (4) has the meaning of weighing the importance of improving contrast and reducing information entropy. According to the defogging effect of different values of λ D in Figure 13, (a) is the original haze image, (b) is the defogging effect of λ D =3, (c) is the defogging effect of λ D =6, (d) The defogging effect of λ D =10 can be obtained: When λ D =3, the contrast of the image after defogging is improved, but because more information is cut off, the pixels in the picture are too dark and too bright More points. When λ D =10, the unnatural pixels caused by the loss of information are reduced, but the contrast is too low to completely remove the fog. When λ D =6, a balance is struck between improving image contrast and suppressing information loss. Therefore, λ D is set to 6 in the image defogging algorithm of super pixel cost function.
可选的,在步骤S3中,对初始透射率图进行细化处理以获取目标透射率图包括:基于导向滤波对初始透射率图进行细化处理;具体的,基于大气散射模型的去雾方法中,许多方法,如:暗通道先验方法、颜色衰减先验方法等,得到的透射率图细化程度不够。常用的透射率图细化的方法有软抠图方法、导向滤波法等。本文中,成本函数去雾方法得到的原始透射率图也需要进行细化处理,如直接使用会产生块效应。鉴于导向滤波方法细化效果好、速度高,本实例中使用导向滤波来细化透射率图。其具体过程为是指以导向图像对输入图像进行滤波处理,使输入图像在保留原本特征的同时,获得导向图像的纹理。若输出图像为t,导向图像I(x)与输出图像关系如下:Optionally, in step S3, performing refinement processing on the initial transmittance map to obtain the target transmittance map includes: performing refinement processing on the initial transmittance map based on guided filtering; specifically, a dehazing method based on an atmospheric scattering model Among them, many methods, such as the dark channel prior method, the color attenuation prior method, etc., have insufficiently refined transmittance maps. The commonly used transmittance map refinement methods include soft matting method and guided filtering method. In this article, the original transmittance map obtained by the cost function defogging method also needs to be refined. If it is used directly, it will cause blocking. In view of the good refinement effect and high speed of the guided filtering method, the guided filtering is used in this example to refine the transmittance map. The specific process is to filter the input image with the guidance image, so that the input image retains the original features while obtaining the texture of the guidance image. If the output image is t, the relationship between the guidance image I(x) and the output image is as follows:
Figure PCTCN2019094616-appb-000022
Figure PCTCN2019094616-appb-000022
其中,I(x)表示导向图像,W xy(I(x))表示由导向图像确定的加权平均运算所采用的权值,t(x)为输入图像,β为偏移量。导向滤波的导向图像可以是输入图像本身。当输入图像作为导向图像时,导向滤波的作用退化为边缘保持滤波器。在这里输入图像为雾霾图像的初始透射率图,其输出图像为雾霾图像的目标透 射率图图。成本函数去雾方法与SLIC超像素成本函数去雾方法都采用导向滤波细化透射率图。不同去雾方法的透射率图,具有不同的边缘保持效果。较好的去雾方法,其透射率图的纹理与原始图像更接近。图14和图15展示了传统的成本函数图像去雾方法与超像素成本函数图像去雾方法的透射率图对比。其中(a)为雾霾图像,(b)成本函数,(c)成本函数细化,(d)为超像素方法,(e)为超像素方法细化,(f)为成本函数细节,(g)为超像素细节。(e)为超像素方法经导向滤波细化后的去雾效果图。 Among them, I(x) represents the guidance image, W xy (I(x)) represents the weight used in the weighted average operation determined by the guidance image, t(x) is the input image, and β is the offset. The guided image for guided filtering may be the input image itself. When the input image is used as a guide image, the role of the guide filter is degenerated into an edge preservation filter. The input image here is the initial transmittance map of the haze image, and the output image is the target transmittance map of the haze image. Both the cost function defogging method and the SLIC superpixel cost function defogging method use guided filtering to refine the transmittance map. The transmittance maps of different defogging methods have different edge retention effects. A better defogging method, the texture of the transmittance map is closer to the original image. Figure 14 and Figure 15 show the comparison of the traditional cost function image defogging method and the superpixel cost function image defogging method. Among them (a) is the haze image, (b) cost function, (c) cost function refinement, (d) is the super pixel method, (e) is the super pixel method refinement, (f) is the cost function detail, ( g) is the super pixel detail. (e) is the defogging effect picture refined by the super pixel method through guided filtering.
对比图14中(b)和图14(c),并将其细节放大至图15中(f)和图15(g)可见,方框内第一行树叶边缘处、第二行山坡处和第三行草垛处,SLIC超像素成本函数的透射率图比传统成本函数去雾方法的的透射率图所提取的纹理更细致、且提取纹理更接近雾霾图像。Compare Figure 14 (b) and Figure 14 (c), and enlarge the details to Figure 15 (f) and Figure 15 (g). It can be seen that the edge of the first row of leaves in the box, the second row of hillsides and At the third row of haystacks, the transmittance map of the SLIC superpixel cost function is more detailed than the transmittance map of the traditional cost function defogging method, and the extracted texture is closer to the haze image.
可选的,在步骤S4中,根据透射率图和全局大气光值获取雾霾图像对应的清晰图像包括:采用以下公式获取雾霾图像对应的清晰图像,Optionally, in step S4, obtaining a clear image corresponding to the haze image according to the transmittance map and the global atmospheric light value includes: obtaining a clear image corresponding to the haze image by using the following formula:
Figure PCTCN2019094616-appb-000023
Figure PCTCN2019094616-appb-000023
其中,A为全局大气光值,I(x)为雾霾图像,t为目标透射率。Among them, A is the global atmospheric light value, I(x) is the haze image, and t is the target transmittance.
如图16和图17,其中,(a)为雾霾图像,(b)为直方图均衡方法的去雾图像,(c)为Retinex方法的去雾图像,可以看出这两种方法都存在部分失真,且图像色彩不协调。(d)为暗通道先验去雾方法的去雾图像,其中天空部分,存在过增强。(e)为成本函数的去雾图像,(f)与超像素成本函数算法的去雾图像,这两者均较为自然,但其超像素成本函数去雾算法的图像亮度相比成本函数更高。As shown in Figure 16 and Figure 17, (a) is the haze image, (b) is the defogging image of the histogram equalization method, and (c) is the defogging image of the Retinex method. It can be seen that both methods exist Partially distorted, and the image color is not coordinated. (d) is the defogging image of the dark channel prior defogging method, in which the sky part is over-enhanced. (e) is the defogging image of the cost function, (f) is the defogging image of the superpixel cost function algorithm, both of which are more natural, but the image brightness of the superpixel cost function defogging algorithm is higher than the cost function .
为客观比较去雾效果,典型的客观图像质量评价算法,对比不同去雾方法的效果。包括:结构相似度、峰值信噪比、灰度方差、Laplacian梯度和熵函数五种方法。表1和表2分别展示了不同去雾算法在HID2018雾霾图像数据库和NYU合成雾霾图像数据库上的图像质量客观评价结果。其中超像素成本函数对应本发明的基于超像素的图像去雾方法。其中表1为不同去雾算法在HID2018数据集上的图像质量客观评价结果对比,表2为不同去雾算法在NYU合成雾霾图像数据集上的图像质量客观评价结果对比。In order to objectively compare the effect of defogging, a typical objective image quality evaluation algorithm is used to compare the effects of different defogging methods. Including: structure similarity, peak signal-to-noise ratio, gray-scale variance, Laplacian gradient and entropy function five methods. Table 1 and Table 2 respectively show the objective evaluation results of image quality of different defogging algorithms on the HID2018 haze image database and NYU synthetic haze image database. The super pixel cost function corresponds to the image defogging method based on super pixel of the present invention. Table 1 shows the comparison of objective image quality evaluation results of different defogging algorithms on the HID2018 dataset, and Table 2 shows the comparison of objective evaluation results of different defogging algorithms on the NYU synthetic haze image data set.
表1Table 1
Figure PCTCN2019094616-appb-000024
Figure PCTCN2019094616-appb-000024
表2Table 2
Figure PCTCN2019094616-appb-000025
Figure PCTCN2019094616-appb-000025
图像质量评价算法中,结构相似度与峰值信噪比属于全参考型图像质量评价方法,需要无雾图像作对比。因此,选择NYU合成雾霾图像数据库进行测试。该数据库中有原始清晰图像和合成的雾霾图像。而灰度方差(SMD)、Laplacian梯度函数和熵函数属于无参考型图像质量评价方法,可使用HID2018数据库中的真实雾霾图像直接测试。从表1中可看出,HID2018数据集上,采用SMD和Laplacian梯度函数指标时,本发明的基于超像素的图像去雾方法性能稍低于成本函数去雾方法;而采用Entropy评价指标时,本发明的基于超像素的图像去雾方法性能优于其它方法。在NYU数据集上,本发明的基于超像素的图像去雾方法性能最优。综上,本发明的基于超像素的图像去雾方法在真实雾霾图像与合成雾霾图像数据集上均具有良好的去雾效果。In the image quality evaluation algorithm, the structural similarity and the peak signal-to-noise ratio belong to the full-reference image quality evaluation method, which requires fog-free images for comparison. Therefore, the NYU synthetic haze image database was selected for testing. The database contains original clear images and synthetic haze images. The gray variance (SMD), Laplacian gradient function and entropy function are non-reference image quality evaluation methods, which can be directly tested using real haze images in the HID2018 database. It can be seen from Table 1 that on the HID2018 data set, when SMD and Laplacian gradient function indicators are used, the performance of the superpixel-based image defogging method of the present invention is slightly lower than that of the cost function defogging method; and when Entropy is used, The performance of the superpixel-based image defogging method of the present invention is better than other methods. On the NYU data set, the superpixel-based image defogging method of the present invention has the best performance. In summary, the superpixel-based image defogging method of the present invention has a good defogging effect on both the real haze image and the synthetic haze image data set.
另,本发明的基于超像素分割的图像去雾系统,包括:In addition, the image defogging system based on superpixel segmentation of the present invention includes:
第一处理单元,用于获取雾霾图像对应的全局大气光值;The first processing unit is used to obtain the global atmospheric light value corresponding to the haze image;
分割单元,用于通过超像素分割对雾霾图像进行分割,以获取雾霾图像对 应的超像素集;The segmentation unit is used to segment the haze image through super pixel segmentation to obtain the super pixel set corresponding to the haze image;
第二处理单元,用于基于超像素集通过预设成本函数获取雾霾图像对应的透射率图;The second processing unit is configured to obtain a transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
第三处理单元,用于对初始透射率图进行细化处理以得到目标透射率图;The third processing unit is used to refine the initial transmittance map to obtain the target transmittance map;
第四处理单元,用于根据目标透射率图和全局大气光值获取雾霾图像对应的清晰图像。The fourth processing unit is used to obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
具体的,这里的基于超像素分割的图像去雾系统各单元之间具体的配合操作过程具体可以参照上述基于超像素分割的图像去雾方法,这里不再赘述。Specifically, the specific coordination operation process between the units of the image defogging system based on superpixel segmentation can refer to the above-mentioned image defogging method based on superpixel segmentation, which will not be repeated here.
另,本发明的一种电子设备,包括存储器和处理器;存储器用于存储计算机程序;处理器用于执行计算机程序实现如上面任意的基于超像素分割的图像去雾方法。具体的,根据本发明的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过电子设备下载和安装并且执行时,执行本发明实施例的方法中限定的上述功能。本发明中的电子设备可为笔记本、台式机、平板电脑、智能手机等终端,也可为服务器。In addition, an electronic device of the present invention includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program to implement any of the above-mentioned methods for image defogging based on superpixel segmentation. Specifically, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, when the computer program can be downloaded and installed by an electronic device and executed, it executes the above-mentioned functions defined in the method of the embodiment of the present invention. The electronic device in the present invention can be a terminal such as a notebook, a desktop computer, a tablet computer, a smart phone, etc., or a server.
另,本发明的一种计算机存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上面任意一项的基于超像素分割的图像去雾方法。具体的,需要说明的是,本发明上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者 与其结合使用。而在本发明中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。In addition, a computer storage medium of the present invention has a computer program stored thereon, and when the computer program is executed by a processor, any one of the above methods for image defogging based on superpixel segmentation is realized. Specifically, it should be noted that the above-mentioned computer-readable medium of the present invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, and a computer-readable program code is carried therein. This propagated data signal can take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium. The computer-readable signal medium may send, propagate or transmit the program for use by or in combination with the instruction execution system, apparatus, or device . The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wire, optical cable, RF (Radio Frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist alone without being assembled into the electronic device.
可以理解的,以上实施例仅表达了本发明的优选实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制;应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,可以对上述技术特点进行自由组合,还可以做出若干变形和改进,这些都属于本发明的保护范围;因此,凡跟本发明权利要求范围所做的等同变换与修饰,均应属于本发明权利要求的涵盖范围。It is understandable that the above examples only express the preferred embodiments of the present invention, and the description is more specific and detailed, but it should not be construed as a limitation on the scope of the present invention; it should be pointed out that for those of ordinary skill in the art In other words, without departing from the concept of the present invention, the above technical features can be freely combined, and several modifications and improvements can be made. These all belong to the scope of protection of the present invention; therefore, everything that follows the scope of the claims of the present invention All equivalent changes and modifications shall fall within the scope of the claims of the present invention.

Claims (10)

  1. 一种基于超像素分割的图像去雾方法,其特征在于,包括:An image defogging method based on superpixel segmentation, which is characterized in that it includes:
    S1、获取雾霾图像对应的全局大气光值,并通过超像素分割对所述雾霾图像进行分割,以获取所述雾霾图像对应的超像素集;S1. Obtain the global atmospheric light value corresponding to the haze image, and segment the haze image by super pixel segmentation to obtain a super pixel set corresponding to the haze image;
    S2、基于所述超像素集通过预设成本函数获取所述雾霾图像对应的初始透射率图;S2. Obtain an initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
    S3、对所述初始透射率图进行细化处理以获取目标透射率图;S3. Refine the initial transmittance map to obtain a target transmittance map;
    S4、根据所述目标透射率图和所述全局大气光值获取所述雾霾图像对应的清晰图像。S4. Obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
  2. 根据权利要求1所述的基于超像素分割的图像去雾方法,其特征在于,The image defogging method based on superpixel segmentation according to claim 1, wherein:
    所述步骤S1中,所述获取所述雾霾图像对应的全局大气光值包括:In the step S1, the obtaining the global atmospheric light value corresponding to the haze image includes:
    S111、划分所述雾霾图像为四个区域;S111. Divide the haze image into four regions.
    S112、获取每个区域的像素平均值与标准差的差值,并获取最大差值所对应的区域;S112. Obtain the difference between the average value of the pixels and the standard deviation of each area, and obtain the area corresponding to the maximum difference.
    S113、判定所述区域是否小于一预设值,若否,则执行步骤S114,若是,则执行步骤S115;S113: Determine whether the area is smaller than a preset value, if not, perform step S114, if yes, perform step S115;
    S114、将所述区域划分为四个区域,并执行步骤S112;S114: Divide the area into four areas, and execute step S112;
    S115、获取所述区域中像素平均值以设为所述雾霾图像对应的全局大气光值;和/或S115. Obtain the average value of pixels in the area to set it as the global atmospheric light value corresponding to the haze image; and/or
    在所述步骤S1中,所述通过超像素分割对雾霾图像进行分割,以获取所述雾霾图像对应的超像素集包括:通过SLIC超像素分割对雾霾图像进行分割;和/或In the step S1, the segmenting the haze image through super pixel segmentation to obtain the super pixel set corresponding to the haze image includes: segmenting the haze image through SLIC super pixel segmentation; and/or
    在所述步骤S2中,所述基于所述超像素集通过预设成本函数获取所述雾霾图像对应的初始透射率图包括:In the step S2, the obtaining an initial transmittance map corresponding to the haze image through a preset cost function based on the super pixel set includes:
    S21、获取所述超像素集的对比度对应的第一成本函数,以及所述超像素集的信息熵对应的第二成本函数;S21: Acquire a first cost function corresponding to the contrast of the super pixel set, and a second cost function corresponding to the information entropy of the super pixel set;
    S22、基于所述第一成本函数和所述第二成本函数获取所述超像素集对应的第三成本函数;S22: Obtain a third cost function corresponding to the super pixel set based on the first cost function and the second cost function;
    S23、基于所述第三成本函数进行迭代以获取使所述第三成本函数为最小值时对应的透射率图为所述雾霾图像对应的初始透射率图;和/或S23. Perform iteration based on the third cost function to obtain the transmittance map corresponding to the minimum value of the third cost function as the initial transmittance map corresponding to the haze image; and/or
    在所述步骤S3中,所述对所述初始透射率图进行细化处理以获取目标透射率图包括:基于导向滤波对所述初始透射率图进行细化处理;和/或In the step S3, the performing refinement processing on the initial transmittance map to obtain the target transmittance map includes: performing refinement processing on the initial transmittance map based on guided filtering; and/or
    在所述步骤S4中,所述根据所述目标透射率图和所述全局大气光值获取所述雾霾图像对应的清晰图像包括:采用以下公式获取所述雾霾图像对应的清晰图像,In the step S4, the obtaining a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value includes: obtaining a clear image corresponding to the haze image by using the following formula,
    Figure PCTCN2019094616-appb-100001
    Figure PCTCN2019094616-appb-100001
    其中,I(x)为雾霾图像,J(x)为清晰图像,t为所述目标透射率图,A为全局大气光值。Among them, I(x) is the haze image, J(x) is the clear image, t is the target transmittance map, and A is the global atmospheric light value.
  3. 根据权利要求2所述的基于超像素分割的图像去雾方法,其特征在于,所述第一成本函数为对比度成本函数,所述对比度成本函数满足如下公式:The method for image defogging based on superpixel segmentation according to claim 2, wherein the first cost function is a contrast cost function, and the contrast cost function satisfies the following formula:
    Figure PCTCN2019094616-appb-100002
    Figure PCTCN2019094616-appb-100002
    其中,x为像素点的位置,c∈{r,g,b}为像素点x的某个颜色通道,D为任一超像素集对应的超像素区域,J c(x)为清晰图像在c通道内的像素值,N x为所述超像素区域的像素点个数;
    Figure PCTCN2019094616-appb-100003
    为所述超像素区域的J c(x)的平均值,N x表示所述任一超像素集的像素点个数,I c(x)表示像素点x在颜色通道c中的像素值,
    Figure PCTCN2019094616-appb-100004
    是雾霾图像区域块内I c(x)的平均值;
    Where x is the position of the pixel, c∈{r,g,b} is a certain color channel of the pixel x, D is the superpixel area corresponding to any superpixel set, and J c (x) is the clear image The pixel value in the c channel, N x is the number of pixels in the super pixel area;
    Figure PCTCN2019094616-appb-100003
    Is the average value of J c (x) of the super pixel area, N x represents the number of pixels in any super pixel set, I c (x) represents the pixel value of pixel x in color channel c,
    Figure PCTCN2019094616-appb-100004
    Is the average value of I c (x) in the haze image area;
    所述第二成本函数为信息熵成本函数,所述信息熵成本函数满足如下公式:The second cost function is an information entropy cost function, and the information entropy cost function satisfies the following formula:
    Figure PCTCN2019094616-appb-100005
    Figure PCTCN2019094616-appb-100005
    其中,min{0,J c(p)}、max{0,J c(p)-255}分别表示像素点下溢和上溢的溢出值,h c(i)表示输入像素点的直方图取值,α c和β c表示发生截断的像素值; Among them, min{0, J c (p)}, max{0, J c (p)-255} represent the overflow value of pixel underflow and overflow respectively, and h c (i) represents the histogram of the input pixel Take the value, α c and β c represent the pixel value that is truncated;
    所述第三成本函数满足以下公式:The third cost function satisfies the following formula:
    L=L contrastDL infoL=L contrastD L info ,
    其中,L contrast表示对比度成本函数,L info表示信息熵成本函数,λ D是协调对比度损失和信息熵损失的权重参数。 Among them, L contrast represents the contrast cost function, L info represents the information entropy cost function, and λ D is the weight parameter that coordinates the contrast loss and the information entropy loss.
  4. 根据权利要求3所述的基于超像素分割的图像去雾方法,其特征在于,λ D取值为6。 The image defogging method based on super pixel segmentation according to claim 3, wherein the value of λ D is 6.
  5. 根据权利要求2所述的基于超像素分割的图像去雾方法,其特征在于,所述通过SLIC超像素分割对雾霾图像进行分割包括:The method for image defogging based on superpixel segmentation according to claim 2, wherein said segmenting the haze image by SLIC superpixel segmentation comprises:
    S121、对所述雾霾图像进行颜色空间转换以获取CIELab颜色空间,根据所述超像素集的预设大小值获取所述雾霾图像的初始中心点;S121: Perform color space conversion on the haze image to obtain a CIELab color space, and obtain an initial center point of the haze image according to a preset size value of the superpixel set;
    S122、基于所述初始中心点对所述雾霾图像的像素点按坐标和所述CIELab颜色空间进行五维类聚,以获取初始超像素集;S122: Perform five-dimensional clustering on the pixel points of the haze image and the CIELab color space based on the initial center point to obtain an initial superpixel set;
    S123、获取所述初始超像素集像素点的梯度值,修正所述初始中心点与最小梯度值所对应,以获取修正后的初始中心点;S123: Obtain a gradient value of a pixel point of the initial super pixel set, and correct the initial center point corresponding to the minimum gradient value to obtain a corrected initial center point;
    S124、基于所述修正后的初始中心点对所述雾霾图像的像素点按坐标和所述CIELab颜色空间进行五维类聚,以获取修正后的初始超像素集,并计数一次,判定当前及以往的计数次数是否满足预设计数值,若否,执行所述步骤S123;若是,则执行步骤S125;S124. Perform five-dimensional clustering on the pixel points of the haze image and the CIELab color space based on the corrected initial center point to obtain a corrected initial superpixel set, and count once to determine the current And whether the previous count times meet the pre-designed value, if not, execute the step S123; if yes, execute the step S125;
    S125、以所述修正后的初始超像素集为所述雾霾图像对应的超像素集。S125. Use the corrected initial super pixel set as a super pixel set corresponding to the haze image.
  6. 根据权利要求5所述的基于超像素分割的图像去雾方法,其特征在于,The image defogging method based on superpixel segmentation according to claim 5, characterized in that,
    所述超像素集的预设大小值满足大于300个像素点和小于1500个像素点;The preset size value of the super pixel set satisfies greater than 300 pixels and less than 1500 pixels;
    所述预设计数值为10。The preset count value is 10.
  7. 根据权利要求6所述的基于超像素分割的图像去雾方法,其特征在于,所述超像素集的预设大小值为900个像素点。The image defogging method based on super pixel segmentation according to claim 6, wherein the preset size value of the super pixel set is 900 pixels.
  8. 一种基于超像素分割的图像去雾系统,其特征在于,包括:An image defogging system based on superpixel segmentation, which is characterized in that it includes:
    第一处理单元,用于获取所述雾霾图像对应的全局大气光值;The first processing unit is configured to obtain the global atmospheric light value corresponding to the haze image;
    分割单元,用于通过超像素分割对雾霾图像进行分割,以获取所述雾霾图像对应的超像素集;A segmentation unit, configured to segment the haze image through super pixel segmentation to obtain a super pixel set corresponding to the haze image;
    第二处理单元,用于基于所述超像素集通过预设成本函数获取所述雾霾图像对应的透射率图;A second processing unit, configured to obtain a transmittance map corresponding to the haze image through a preset cost function based on the super pixel set;
    第三处理单元,用于对所述初始透射率图进行细化处理以得到目标透射率图;A third processing unit, configured to refine the initial transmittance map to obtain a target transmittance map;
    第四处理单元,用于根据所述目标透射率图和所述全局大气光值获取所述雾霾图像对应的清晰图像。The fourth processing unit is configured to obtain a clear image corresponding to the haze image according to the target transmittance map and the global atmospheric light value.
  9. 一种计算机存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任意一项所述的基于超像素分割的图像去雾方法。A computer storage medium having a computer program stored thereon, wherein the computer program implements the image defogging method based on superpixel segmentation according to any one of claims 1 to 7 when the computer program is executed by a processor.
  10. 一种电子设备,其特征在于,包括存储器和处理器;An electronic device, characterized in that it includes a memory and a processor;
    所述存储器用于存储计算机程序;The memory is used to store computer programs;
    所述处理器用于执行所述计算机程序实现如权利要求1至7中任意一项所述的基于超像素分割的图像去雾方法。The processor is configured to execute the computer program to implement the image defogging method based on superpixel segmentation according to any one of claims 1 to 7.
PCT/CN2019/094616 2019-07-03 2019-07-03 Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device WO2021000302A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/094616 WO2021000302A1 (en) 2019-07-03 2019-07-03 Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/094616 WO2021000302A1 (en) 2019-07-03 2019-07-03 Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device

Publications (1)

Publication Number Publication Date
WO2021000302A1 true WO2021000302A1 (en) 2021-01-07

Family

ID=74100467

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/094616 WO2021000302A1 (en) 2019-07-03 2019-07-03 Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device

Country Status (1)

Country Link
WO (1) WO2021000302A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113628145A (en) * 2021-08-27 2021-11-09 燕山大学 Image sharpening method, system, equipment and storage medium
CN113763259A (en) * 2021-02-18 2021-12-07 北京沃东天骏信息技术有限公司 Image defogging method and device
CN114066745A (en) * 2021-10-13 2022-02-18 南京邮电大学 Image defogging method based on regional line prior
CN117314770A (en) * 2023-09-05 2023-12-29 西南交通大学 Image deblurring system and method thereof
CN117788336A (en) * 2024-02-28 2024-03-29 山东昆仲信息科技有限公司 Data optimization acquisition method and system in homeland space planning process
CN118052737A (en) * 2024-01-18 2024-05-17 北京交通大学 Unmanned aerial vehicle image defogging algorithm based on perception guidance of super-pixel scene priori
CN118115391A (en) * 2024-04-29 2024-05-31 湖南中飞时代智能科技有限公司 Intelligent regulation and control method and system for mist sprayer operation
CN118279196A (en) * 2024-06-04 2024-07-02 泉州职业技术大学 Image defogging method and device for scale-adaptive Retinex algorithm
CN118505565A (en) * 2024-05-28 2024-08-16 江苏海洋大学 Tugboat visual angle image defogging method for enhancing local contrast
CN118565634A (en) * 2024-07-31 2024-08-30 瑞安市瑞鑫电器有限公司 Online monitoring method and system for temperature of generator carbon brush holder

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169487A (en) * 2017-04-19 2017-09-15 西安电子科技大学 The conspicuousness object detection method positioned based on super-pixel segmentation and depth characteristic

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169487A (en) * 2017-04-19 2017-09-15 西安电子科技大学 The conspicuousness object detection method positioned based on super-pixel segmentation and depth characteristic

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
ACHANTA, RADHAKRISHNA ET AL.: "SLIC Superpixels Compared to State-of-the-Art Superpixel Methods.", IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE., vol. 34,, no. 11, 22 May 2012 (2012-05-22), XP011490750, ISSN: 1939-3539, DOI: 20200308135435A *
HE, KAIMING ET AL.: "Guided Image Filtering.", IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE., vol. 35, no. 6, 1 October 2012 (2012-10-01), XP055553272, ISSN: 1939-3539, DOI: 20200308141053A *
KIM, JIN-HWAN ET AL. .: "Optimized contrast enhancement for real-time image and video dehazing.", JOURNAL OF VISUAL COMMUNICATION AND IMAGE REPRESENTATION., vol. 24, no. 3, 18 February 2013 (2013-02-18), XP028996774, ISSN: 1047-3203, DOI: 20200308134505Y *
LI, CHANGLI ET AL.: "An improved image defogging method based on dark channel prior.", 2017 2ND INTERNATIONAL CONFERENCE ON IMAGE, VISION AND COMPUTING., 20 July 2017 (2017-07-20), XP033124800, DOI: 20200308142405A *
ZHAO, YUEXIU ET AL.: "Research on Image Dehazing of Sea-Sky Background", COMPUTER SYSTEMS & APPLICATIONS, vol. 27, no. 12, 3 December 2018 (2018-12-03), ISSN: 1003-3254, DOI: 20200308133911X *
ZHAO, YUEXIU ET AL.: "Research on Image Dehazing of Sea-Sky Background", COMPUTER SYSTEMS & APPLICATIONS, vol. 27, no. 12, 3 December 2018 (2018-12-03), ISSN: 1003-3254, DOI: 20200308134010Y *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763259A (en) * 2021-02-18 2021-12-07 北京沃东天骏信息技术有限公司 Image defogging method and device
CN113628145A (en) * 2021-08-27 2021-11-09 燕山大学 Image sharpening method, system, equipment and storage medium
CN113628145B (en) * 2021-08-27 2024-02-02 燕山大学 Image sharpening method, system, device and storage medium
CN114066745A (en) * 2021-10-13 2022-02-18 南京邮电大学 Image defogging method based on regional line prior
CN117314770A (en) * 2023-09-05 2023-12-29 西南交通大学 Image deblurring system and method thereof
CN118052737A (en) * 2024-01-18 2024-05-17 北京交通大学 Unmanned aerial vehicle image defogging algorithm based on perception guidance of super-pixel scene priori
CN117788336A (en) * 2024-02-28 2024-03-29 山东昆仲信息科技有限公司 Data optimization acquisition method and system in homeland space planning process
CN117788336B (en) * 2024-02-28 2024-05-24 山东昆仲信息科技有限公司 Data optimization acquisition method and system in homeland space planning process
CN118115391A (en) * 2024-04-29 2024-05-31 湖南中飞时代智能科技有限公司 Intelligent regulation and control method and system for mist sprayer operation
CN118505565A (en) * 2024-05-28 2024-08-16 江苏海洋大学 Tugboat visual angle image defogging method for enhancing local contrast
CN118279196A (en) * 2024-06-04 2024-07-02 泉州职业技术大学 Image defogging method and device for scale-adaptive Retinex algorithm
CN118565634A (en) * 2024-07-31 2024-08-30 瑞安市瑞鑫电器有限公司 Online monitoring method and system for temperature of generator carbon brush holder

Similar Documents

Publication Publication Date Title
WO2021000302A1 (en) Image dehazing method and system based on superpixel segmentation, and storage medium and electronic device
CN108876743B (en) Image rapid defogging method, system, terminal and storage medium
CN108596849B (en) Single image defogging method based on sky region segmentation
CN110428371A (en) Image defogging method, system, storage medium and electronic equipment based on super-pixel segmentation
Gao et al. Sand-dust image restoration based on reversing the blue channel prior
CN103679173B (en) Method for detecting image salient region
WO2021004245A1 (en) Depth image processing method and apparatus, and electronic device
Wang et al. Variational single nighttime image haze removal with a gray haze-line prior
TWI489416B (en) Image recovery method
Dharejo et al. A color enhancement scene estimation approach for single image haze removal
CN105447825B (en) Image defogging method and its system
CN105959510B (en) A kind of video rapid defogging method
CN108133462B (en) Single image restoration method based on gradient field region segmentation
CN115456905A (en) Single image defogging method based on bright and dark region segmentation
CN105023246B (en) A kind of image enchancing method based on contrast and structural similarity
CN108462866A (en) A kind of 3D stereo-picture color calibration methods based on matching and optimization
Tan et al. Image haze removal based on superpixels and Markov random field
Raikwar et al. An improved linear depth model for single image fog removal
CN109949239B (en) Self-adaptive sharpening method suitable for multi-concentration multi-scene haze image
CN106709876B (en) Optical remote sensing image defogging method based on dark image element principle
CN115187688A (en) Fog map reconstruction method based on atmospheric light polarization orthogonal blind separation and electronic equipment
CN112907461B (en) Defogging enhancement method for infrared foggy-day degraded image
CN110796181B (en) Cultural relic disease high-precision automatic extraction method based on texture
CN113379620B (en) Optical remote sensing satellite image cloud detection method
Xie et al. Image defogging method combining light field depth estimation and dark channel

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19936252

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29.04.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19936252

Country of ref document: EP

Kind code of ref document: A1