CN104008527A - Method for defogging single image - Google Patents

Method for defogging single image Download PDF

Info

Publication number
CN104008527A
CN104008527A CN201410153443.4A CN201410153443A CN104008527A CN 104008527 A CN104008527 A CN 104008527A CN 201410153443 A CN201410153443 A CN 201410153443A CN 104008527 A CN104008527 A CN 104008527A
Authority
CN
China
Prior art keywords
image
max
defogging
color
propagation map
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201410153443.4A
Other languages
Chinese (zh)
Other versions
CN104008527B (en
Inventor
丁萌
魏丽
王帮峰
刘中杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
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 Nanjing University of Aeronautics and Astronautics filed Critical Nanjing University of Aeronautics and Astronautics
Priority to CN201410153443.4A priority Critical patent/CN104008527B/en
Publication of CN104008527A publication Critical patent/CN104008527A/en
Application granted granted Critical
Publication of CN104008527B publication Critical patent/CN104008527B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)
  • Color Image Communication Systems (AREA)

Abstract

本发明一种单幅图像去雾方法,利用待去雾RGB图像I的区域颜色均值向量及其L2范数来获取传播图,再根据传播图和大气光值来计算去雾后的图像;该方法可以直接利用单幅RGB彩色图像,无需外界提供任何其他信息;同时本发明计算去雾图像过程中利用系数可以直接得到去雾图像,无需在去雾后进一步增加图像亮度以满足显示要求。

A method for defogging a single image of the present invention uses the regional color mean vector and L2 norm of the RGB image I to be defogged to obtain a propagation map, and then calculates the defogged image according to the propagation map and the atmospheric light value; The method can directly use a single RGB color image without any other information provided by the outside world; at the same time, the invention can directly obtain the defogged image by using coefficients in the process of calculating the defogged image, without further increasing the brightness of the image after defogging to meet the display requirements.

Description

一种单幅图像去雾方法A Single Image Dehazing Method

技术领域technical field

本发明属于数字图像处理领域,适用于计算机视觉应用的前期预处理,可广泛应用于道路、广场视频监控、行车记录仪等领域,更具体地说为一种单幅图像去雾方法。The invention belongs to the field of digital image processing, is suitable for preprocessing in the early stage of computer vision applications, and can be widely used in the fields of road, square video monitoring, driving recorder and the like, and more specifically is a method for defogging a single image.

背景技术Background technique

近年来,我国的大气污染越来越严重,由此产生的雾霾导致大气能见度降低,户外视频监视系统很难直接得到具有一定能见度的图像信息,直接导致监视系统的失效。为此在摄像机得到的图像基础上利用软件算法实现图像的去雾处理,增加图像的能见度显得意义重大。In recent years, my country's air pollution has become more and more serious. The resulting smog has reduced the visibility of the atmosphere. It is difficult for the outdoor video surveillance system to directly obtain image information with a certain degree of visibility, which directly leads to the failure of the surveillance system. Therefore, on the basis of the image obtained by the camera, it is of great significance to use the software algorithm to realize the image defogging process and increase the visibility of the image.

现有的图像去雾算法主要包括:基于多视图的方法、基于先验知识的方法、和直接利用单幅图像去雾的方法。基于多视图和先验知识的方法需要由外界提供深度等先验信息,在实际应用中这些深度信息很难获取,因此这两类方法的适用性不强。直接利用单幅图像去雾仅需要单幅图像,去雾所需的所有信息由算法从待去雾的单幅图像中自行获取,为目前常用方法。The existing image defogging algorithms mainly include: methods based on multi-view, methods based on prior knowledge, and methods that directly use a single image to defog. Methods based on multi-view and prior knowledge need prior information such as depth provided by the outside world. In practical applications, these depth information are difficult to obtain, so the applicability of these two types of methods is not strong. Directly using a single image to dehaze requires only a single image, and all the information required for dehazing is obtained by the algorithm from the single image to be dehazed, which is a commonly used method at present.

然而目前常用的单幅图像去雾方法中,大多利用大气光值及反映图像深度信息的传播图来计算去雾后的图像,然而获取传播图的方法大多基于暗通道来实现,如申请号为201210011326.5,名称为“一种单幅图像去雾方法及装置”的发明专利,而利用暗通道存在以下缺陷:However, in the currently commonly used single image defogging methods, most of them use the atmospheric light value and the propagation map reflecting the depth information of the image to calculate the defogged image. However, the methods for obtaining the propagation map are mostly based on dark channels. 201210011326.5, an invention patent titled "a method and device for defogging a single image", but the use of dark channels has the following defects:

暗通道方法对每个滑窗图像块需要进行两次计算最小值的运算,计算最小值的运算由于需要对图像块中所有像素按像素值进行排序操作,故计算较为耗时。The dark channel method needs to calculate the minimum value twice for each sliding window image block. The operation of calculating the minimum value requires sorting operation of all pixels in the image block by pixel value, so the calculation is more time-consuming.

发明内容Contents of the invention

本发明的主要发明点在于通过区域RGB颜色向量统计特征来获取传播图,该方法可以直接利用单幅RGB彩色图像,无需外界提供任何其他信息;同时本发明计算去雾图像过程中利用系数α可以直接得到去雾图像,无需在去雾后进一步增加图像亮度以满足显示要求。The main inventive point of the present invention is to obtain the propagation map through the statistical characteristics of the regional RGB color vectors. This method can directly use a single RGB color image without providing any other information from the outside; at the same time, the present invention can use the coefficient α in the process of calculating the defogged image. Obtain the defogged image directly without further increasing the brightness of the image after defogging to meet the display requirements.

为解决上述技术问题,本发明一种单幅图像去雾方法,该方法通过有雾RGB彩色图像的大气光值及反映图像深度信息的传播图来计算去雾后的图像,该方法中的传播图通过以下方法获取:In order to solve the above-mentioned technical problems, the present invention provides a method for defogging a single image, which calculates the image after defogging through the atmospheric light value of the foggy RGB color image and the propagation map reflecting the image depth information, and the propagation in the method The graph is obtained by:

步骤A、获取待去雾RGB图像I的区域颜色均值向量及其L2范数;Step A, obtaining the regional color mean vector and L2 norm of the RGB image I to be defogged;

步骤A-1、输入大小为m×n的待去雾RGB图像I,图像I中每个像素点对应一个1×3颜色向量[IR(i,j),IG(i,j),IB(i,j)],其中,i,j表示像素点坐标,i∈[1,m],j∈[1,n],m、n均为正整数;Step A-1. Input the RGB image I to be defogged with a size of m×n. Each pixel in the image I corresponds to a 1×3 color vector [I R (i,j), I G (i,j), I B (i, j)], where i, j represent pixel coordinates, i ∈ [1, m], j ∈ [1, n], m, n are both positive integers;

步骤A-2:获取图像I中满足以下条件的所有区域窗口Ω(i,j):以第i行第j列为中心像素点,构建大小为(2r+1)×(2r+1)的区域窗口;其中,i的取值范围是r+1到m-r之间的整数;j的取值范围是r+1到n-r之间的整数,r为区域窗口的半径;Step A-2: Obtain all area windows Ω(i,j) in the image I that meet the following conditions: take the i-th row and the j-th column as the center pixel, and construct a size of (2r+1)×(2r+1) Area window; wherein, the value range of i is an integer between r+1 and m-r; the value range of j is an integer between r+1 and n-r, and r is the radius of the area window;

步骤A-3:利用下式获取每个区域窗口Ω(i,j)对应的图像I区域颜色均值向量E(i,j)Step A-3: Use the following formula to obtain the image I region color mean vector E(i,j) corresponding to each region window Ω(i,j)

E(i,j)=[eR(i,j),eG(i,j),eB(i,j)]T,其中C∈{R,G,B};E(i,j)=[e R (i,j),e G (i,j),e B (i,j)] T , where C∈{R,G,B};

步骤A-4:根据每个E(i,j)得到对应的图像I区域颜色均值向量的L2范数u(i,j),其表达形式:u(i,j)=||E(i,j)||2Step A-4: Obtain the L2 norm u(i,j) of the color mean vector of the corresponding image I area according to each E(i,j), and its expression form: u(i,j)=||E(i ,j)|| 2 ;

步骤B、获取反映图像深度信息的传播图T;Step B. Obtain a propagation map T reflecting the depth information of the image;

步骤B-1、利用下式计算传播图T的初始值 Step B-1, use the following formula to calculate the initial value of the propagation map T

TT ~~ (( ii ,, jj )) == 11 -- AA TT EE. (( ii ,, jj )) -- uu (( ii ,, jj )) 22 || || AA || || 22 22 -- AA TT EE. (( ii ,, jj ))

式中,A为大气光值,AT表示对A进行转置运算;In the formula, A is the atmospheric light value, A T represents the transpose operation on A;

步骤B-2、利用引导滤波算法进一步优化传播图初始值得到反映图像深度信息的传播图T。Step B-2. Use the guided filtering algorithm to further optimize the initial value of the propagation map A propagation map T reflecting the depth information of the image is obtained.

本发明的另一个发明点,有雾RGB彩色图像的大气光值A的可以采用以下步骤获取:Another inventive point of the present invention, the atmospheric light value A of the foggy RGB color image can adopt the following steps to obtain:

a、建立一个m×n的矩阵U,其中,矩阵U中第i行第j列元素为图像I区域颜色均值向量的L2范数u(i,j),当i<r+1或i>m-r且j<r+1或j>n-r时,u(i,j)=0;a. Establish a matrix U of m×n, where the i-th row and j-th column element in the matrix U is the L2 norm u(i,j) of the color mean vector of the image I area, when i<r+1 or i> When m-r and j<r+1 or j>n-r, u(i,j)=0;

b、选取矩阵U中最大元素对应的imax,jmaxb. Select i max and j max corresponding to the largest element in the matrix U;

c、在图像I中以imax,jmax为中心像素点,建立大小为(2r+1)×(2r+1)的区域窗口Ωmax(imax,jmax),r为区域窗口半径;C, in image I, take i max , j max as center pixel point, set up the area window Ω max (i max , j max ) that size is (2r+1) * (2r+1), r is the area window radius;

d、计算Ωmax(imax,jmax)中所有像素点对应的1×3颜色向量的L2范数,其中颜色向量L2范数中最大值对应的颜色向量即为大气光值A。d. Calculate the L2 norm of the 1×3 color vector corresponding to all pixels in Ω max (i max , j max ), where the color vector corresponding to the maximum value in the L2 norm of the color vector is the atmospheric light value A.

为了直接得到去雾图像,无需在去雾后进一步增加图像亮度以满足显示In order to directly obtain the defogged image, there is no need to further increase the image brightness after defogging to meet the display

要求,本发明单幅图像去雾方法中,根据下式计算去雾后图像J:Requirements, in the single image defogging method of the present invention, the image J after defogging is calculated according to the following formula:

JJ (( ii ,, jj )) == II (( ii ,, jj )) -- AA maxmax (( TT (( ii ,, jj )) ,, tt 00 )) ++ &alpha;A&alpha;A

式中,t0=0.3,a∈[0.6,0.9],T(i,j)为传播图,I(i,j)为待去雾原图;max(T(i,j),t0)表示当T(i,j)≥t0时,max(T(i,j),t0)=T(i,j);否则max(T(i,j),t0)=t0In the formula, t 0 =0.3, a∈[0.6,0.9], T(i,j) is the propagation map, I(i,j) is the original image to be dehazed; max(T(i,j),t 0 ) means that when T(i,j)≥t 0 , max(T(i,j),t 0 )=T(i,j); otherwise max(T(i,j),t 0 )=t 0 .

本发明与现有技术相比具有以下显著的优点:(1)基于区域RGB颜色向量统计特征的图像去雾方法,可以直接利用单幅RGB彩色图像,无需外界提供任何其他信息;(2)无需进行大量的搜索最小值运算,提高了图像去雾的实时性;(3)直接得到去雾图像,无需在去雾后进一步增加图像亮度以满足显示要求。Compared with the prior art, the present invention has the following significant advantages: (1) The image defogging method based on the statistical characteristics of the regional RGB color vector can directly use a single RGB color image without any other information provided by the outside world; (2) A large number of search minimum calculations are performed to improve the real-time performance of image defogging; (3) The defogged image is directly obtained without further increasing the image brightness after defogging to meet the display requirements.

附图说明Description of drawings

图1为获取图像I中满足条件的所有区域窗口Ω(i,j)示意图;Fig. 1 is a schematic diagram of obtaining all the region windows Ω(i, j) satisfying the conditions in the image I;

图2(a)为实施例原始雾天图像I;图2(b)为实施例中传播图的初始值图2(c)为实施例引导滤波后的传播图T;图2(d)实施例去雾后的图像J;Fig. 2 (a) is the original fog image I of the embodiment; Fig. 2 (b) is the initial value of the transmission map in the embodiment Fig. 2(c) is the transmission map T after guided filtering in the embodiment; Fig. 2(d) is the image J after defogging in the embodiment;

具体实施方式Detailed ways

本发明一种单幅图像去雾方法,该方法通过有雾RGB彩色图像的大气光值及反映图像深度信息的传播图来计算去雾后的图像,该方法中的传播图通过以下方法获取:The present invention is a method for defogging a single image. The method calculates the image after defogging through the atmospheric light value of the foggy RGB color image and the propagation map reflecting the depth information of the image. The propagation map in the method is obtained by the following method:

步骤A、获取待去雾RGB图像I的区域颜色均值向量及其L2范数;Step A, obtaining the regional color mean vector and L2 norm of the RGB image I to be defogged;

步骤A-1、输入大小为m×n的待去雾RGB图像I,图像I中每个像素点对应一个1×3颜色向量[IR(i,j),IG(i,j),IB(i,j)],其中,i,j表示像素点坐标,i∈[1,m],j∈[1,n],m、n均为正整数;Step A-1. Input the RGB image I to be defogged with a size of m×n. Each pixel in the image I corresponds to a 1×3 color vector [I R (i,j), I G (i,j), I B (i, j)], where i, j represent pixel coordinates, i ∈ [1, m], j ∈ [1, n], m, n are both positive integers;

步骤A-2:获取图像I中满足以下条件的所有区域窗口Ω(i,j):以第i行第j列为中心像素点,构建大小为(2r+1)×(2r+1)的区域窗口;其中,i的取值范围是r+1到m-r之间的整数;j的取值范围是r+1到n-r之间的整数,r为区域窗口的半径;Step A-2: Obtain all area windows Ω(i,j) in the image I that meet the following conditions: take the i-th row and the j-th column as the center pixel, and construct a size of (2r+1)×(2r+1) Area window; wherein, the value range of i is an integer between r+1 and m-r; the value range of j is an integer between r+1 and n-r, and r is the radius of the area window;

步骤A-3:利用下式获取每个区域窗口Ω(i,j)对应的图像I区域颜色均值向量E(i,j)Step A-3: Use the following formula to obtain the image I region color mean vector E(i,j) corresponding to each region window Ω(i,j)

E(i,j)=[eR(i,j),eG(i,j),eB(i,j)]T,其中C∈{R,G,B};E(i,j)=[e R (i,j),e G (i,j),e B (i,j)] T , where C∈{R,G,B};

步骤A-4:根据每个E(i,j)得到对应的图像I区域颜色均值向量的L2范数u(i,j),其表达形式:u(i,j)=||E(i,j)||2Step A-4: Obtain the L2 norm u(i,j) of the color mean vector of the corresponding image I area according to each E(i,j), and its expression form: u(i,j)=||E(i ,j)|| 2 ;

步骤B、获取反映图像深度信息的传播图T;Step B. Obtain a propagation map T reflecting the depth information of the image;

步骤B-1、利用下式计算传播图T的初始值 Step B-1, use the following formula to calculate the initial value of the propagation map T

TT ~~ (( ii ,, jj )) == 11 -- AA TT EE. (( ii ,, jj )) -- uu (( ii ,, jj )) 22 || || AA || || 22 22 -- AA TT EE. (( ii ,, jj ))

式中,A为大气光值,AT表示对A进行转置运算;In the formula, A is the atmospheric light value, A T represents the transpose operation on A;

步骤B-2、利用引导滤波算法进一步优化传播图初始值得到反映图像深度信息的传播图T;利用引导滤波算法进行进一步优化传播图初始值为本领域公知技术,具体参见He,K.M.,Sun,J.,and Tang,X.O.Guided ImageFiltering,IEEE Transactions on Pattern Analysis and MachineIntelligence,2013,35(6):1397-1409,此处不再赘述!Step B-2. Use the guided filtering algorithm to further optimize the initial value of the propagation map Obtain the propagation map T that reflects the depth information of the image; use the guided filtering algorithm to further optimize the initial value of the propagation map It is a well-known technology in the art. For details, see He, KM, Sun, J., and Tang, XOGuided ImageFiltering, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013, 35(6): 1397-1409, and will not repeat them here!

获取有雾RGB彩色图像的大气光值可以采用传统方法获取也可以采用以下步骤:Obtaining the atmospheric light value of the foggy RGB color image can be obtained by traditional methods or by the following steps:

a、建立一个m×n的矩阵U,其中,矩阵U中第i行第j列元素为图像I区域颜色均值向量的L2范数u(i,j),当i<r+1或i>m-r且j<r+1或j>n-r时,u(i,j)=0;a. Establish a matrix U of m×n, where the i-th row and j-th column element in the matrix U is the L2 norm u(i,j) of the color mean vector of the image I area, when i<r+1 or i> When m-r and j<r+1 or j>n-r, u(i,j)=0;

b、选取矩阵U中最大元素对应的imax,jmaxb. Select i max and j max corresponding to the largest element in the matrix U;

c、在图像I中以imax,jmax为中心像素点建立区域窗口Ωmax(imax,jmax),区域窗口大小为(2r+1)×(2r+1),r为区域窗口半径;c. In the image I, take i max and j max as the central pixel to establish a regional window Ω max (i max , j max ), the size of the regional window is (2r+1)×(2r+1), and r is the radius of the regional window ;

d、计算Ωmax(imax,jmax)中所有像素点对应的1×3颜色向量的L2范数,其中颜色向量L2范数中最大值对应的颜色向量即为大气光值A。d. Calculate the L2 norm of the 1×3 color vector corresponding to all pixels in Ω max (i max , j max ), where the color vector corresponding to the maximum value in the L2 norm of the color vector is the atmospheric light value A.

利用大气光值和传播图计算去雾图像时,可以采用传统公式来实现,但得到的去雾图像效果不佳,需要进一步进行图像增亮处理以达到显示效果;When calculating the dehazed image using the atmospheric light value and the propagation map, the traditional formula can be used However, the effect of the defogged image is not good, and further image brightening processing is required to achieve the display effect;

也可以采用本发明的去雾公式 J ( i , j ) = I ( i , j ) - A max ( T ( i , j ) , t 0 ) + &alpha;A , 其中t0=0.3,α∈[0.6,0.9],T(i,j)为传播图,I(i,j)为待去雾原图;max(T(i,j),t0)表示当T(i,j)≥t0时,max(T(i,j),t0)=T(i,j);否则max(T(i,j),t0)=t0,α=0.8为最优效果。Also can adopt defogging formula of the present invention J ( i , j ) = I ( i , j ) - A max ( T ( i , j ) , t 0 ) + &alpha;A , Where t 0 =0.3,α∈[0.6,0.9], T(i,j) is the propagation map, I(i,j) is the original image to be dehazed; max(T(i,j),t 0 ) means When T(i,j)≥t 0 , max(T(i,j),t 0 )=T(i,j); otherwise max(T(i,j),t 0 )=t 0 , α =0.8 is the best effect.

实施例Example

如图2(a)所示,大小为470×350的彩色待去雾图像I,其去雾过程具体如下:步骤A、获取待去雾RGB图像I的区域颜色均值向量及其L2范数;As shown in Figure 2(a), the dehazing process of the color image I to be defogged is 470×350 in detail as follows: Step A, obtain the regional color mean vector and L2 norm of the RGB image I to be defogged;

步骤A-1、输入大小为470×350的待去雾RGB图像I,图像I中每个像素点对应一个1×3颜色向量[IR(i,j),IG(i,j),IB(i,j)],其中i,j表示像素点坐标,i∈[1,470],j∈[1,350];Step A-1. Input the RGB image I to be defogged with a size of 470×350. Each pixel in the image I corresponds to a 1×3 color vector [I R (i,j), I G (i,j), I B (i, j)], where i, j represent pixel coordinates, i∈[1,470], j∈[1,350];

步骤A-2:获取图像I中满足以下条件的所有区域窗口Ω(i,j):该区域窗口以第i行第j列为中心像素点,大小为(2r+1)×(2r+1);其中,r为区域窗口半径,r=7表示取7个像素点,即该区域窗口大小为15×15,i的取值范围是8到463之间的整数;j的取值范围是8到354之间的整数;Step A-2: Get all the area windows Ω(i,j) in the image I that meet the following conditions: the area window takes the i-th row and j-th column as the center pixel point, and the size is (2r+1)×(2r+1 ); wherein, r is the radius of the region window, r=7 means to take 7 pixels, that is, the size of the region window is 15×15, and the value range of i is an integer between 8 and 463; the value range of j is an integer between 8 and 354;

步骤A-3:利用下式获取每个区域窗口Ω(i,j)对应的图像I区域颜色均值向量E(i,j)Step A-3: Use the following formula to obtain the image I region color mean vector E(i,j) corresponding to each region window Ω(i,j)

E(i,j)=[eR(i,j),eG(i,j),eB(i,j)]T,其中C∈{R,G,B};E(i,j)=[e R (i,j),e G (i,j),e B (i,j)] T , where C∈{R,G,B};

步骤A-4:根据每个E(i,j)得到对应的图像I区域颜色均值向量的L2范数u(i,j),其表达形式:u(i,j)=||E(i,j)||2Step A-4: Obtain the L2 norm u(i,j) of the color mean vector of the corresponding image I area according to each E(i,j), and its expression form: u(i,j)=||E(i ,j)|| 2 ;

步骤B、获取反映图像深度信息的传播图T;Step B. Obtain a propagation map T reflecting the depth information of the image;

步骤B-1、利用下式计算传播图T的初始值如图2(b)所示:Step B-1, use the following formula to calculate the initial value of the propagation map T As shown in Figure 2(b):

TT ~~ (( ii ,, jj )) == 11 -- AA TT EE. (( ii ,, jj )) -- uu (( ii ,, jj )) 22 || || AA || || 22 22 -- AA TT EE. (( ii ,, jj ))

式中,A为大气光值,AT表示对A进行转置运算,其中,大气光值A的计算过程如下:In the formula, A is the atmospheric light value, and A T represents the transposition operation on A, where the calculation process of the atmospheric light value A is as follows:

(1)建立一个470×350的矩阵U,其中,矩阵U中第i行第j列元素为图像I区域颜色均值向量的L2范数u(i,j),当i<8或i>463且j<8或j>354时,u(i,j)=0;(1) Establish a 470×350 matrix U, where the i-th row and j-th column element in the matrix U is the L2 norm u(i,j) of the color mean vector of the image I region, when i<8 or i>463 And when j<8 or j>354, u(i,j)=0;

(2)选取矩阵U中最大元素对应的imax,jmax(2) Select i max , j max corresponding to the largest element in the matrix U;

(3)在图像I中以imax,jmax为中心像素点建立区域窗口Ωmax(imax,jmax),区域窗口大小为(2r+1)×(2r+1),r为区域窗口半径,r=7,即窗口大小为15×15;(3) Establish a region window Ω max (i max , j max ) with i max and j max as the center pixel in image I, the size of the region window is (2r+1)×(2r+1), r is the region window Radius, r=7, that is, the window size is 15×15;

(4)计算Ωmax(imax,jmax)中所有元素的颜色向量的L2范数,其中颜色向量L2范数中最大值对应的颜色向量即为大气光值A;(4) Calculate the L2 norm of the color vectors of all elements in Ω max (i max , j max ), where the color vector corresponding to the maximum value in the L2 norm of the color vector is the atmospheric light value A;

步骤B-2、利用引导滤波算法进一步优化传播图初始值得到反映图像深度信息的传播图T如图2(c);Step B-2. Use the guided filtering algorithm to further optimize the initial value of the propagation map The transmission map T reflecting the depth information of the image is obtained as shown in Figure 2(c);

步骤C、利用传播图T以及大气光值A来计算去雾后图像J,如图2(d)所示:Step C, use the transmission map T and the atmospheric light value A to calculate the image J after defogging, as shown in Figure 2(d):

JJ (( ii ,, jj )) == II (( ii ,, jj )) -- AA maxmax (( TT (( ii ,, jj )) ,, tt 00 )) ++ &alpha;A&alpha;A

式中,t0=0.3,α=0.8,A=[0.9294,0.9373,0.9333];In the formula, t 0 =0.3, α=0.8, A=[0.9294,0.9373,0.9333];

本发明的单幅图像去雾方法,基于区域RGB颜色向量统计特征的图像去雾方法,可以直接利用单幅RGB彩色图像,无需外界提供任何其他信息;同时利用系数α可以直接得到去雾图像,无需在去雾后进一步增加图像亮度以满足显示要求。The single image defogging method of the present invention is an image defogging method based on the statistical characteristics of regional RGB color vectors, which can directly use a single RGB color image without any other information provided by the outside; at the same time, the defogged image can be directly obtained by using the coefficient α, There is no need to further increase image brightness after defogging to meet display requirements.

Claims (5)

1.一种单幅图像去雾方法,该方法通过有雾RGB彩色图像的大气光值及反映图像深度信息的传播图来计算去雾后的图像,其特征在于,该方法中的传播图通过以下方法获取:1. A single image defogging method, the method calculates the image after the fog removal by the atmospheric light value of the foggy RGB color image and the propagation map reflecting the image depth information, it is characterized in that the propagation map in the method is passed The following methods are obtained: 步骤A、获取待去雾RGB图像I的区域颜色均值向量及其L2范数;Step A, obtaining the regional color mean vector and L2 norm of the RGB image I to be defogged; 步骤A-1、输入大小为m×n的待去雾RGB图像I,图像I中每个像素点对应一个1×3颜色向量[IR(i,j),IG(i,j),IB(i,j)],其中,i,j表示像素点坐标,i∈[1,m],j∈[1,n],其中,m、n均为正整数;Step A-1. Input the RGB image I to be defogged with a size of m×n. Each pixel in the image I corresponds to a 1×3 color vector [I R (i,j), I G (i,j), I B (i, j)], where i, j represent pixel coordinates, i ∈ [1, m], j ∈ [1, n], where m, n are both positive integers; 步骤A-2:获取图像I中满足以下条件的所有区域窗口Ω(i,j):以第i行第j列为中心像素点,构建大小为(2r+1)×(2r+1)的区域窗口;其中,i的取值范围是r+1到m-r之间的整数;j的取值范围是r+1到n-r之间的整数,r区域窗口半径;Step A-2: Obtain all area windows Ω(i,j) in the image I that meet the following conditions: take the i-th row and the j-th column as the center pixel, and construct a size of (2r+1)×(2r+1) Area window; wherein, the value range of i is an integer between r+1 and m-r; the value range of j is an integer between r+1 and n-r, and the radius of the r area window; 步骤A-3:利用下式获取每个区域窗口Ω(i,j)对应的图像I区域颜色均值向量E(i,j)Step A-3: Use the following formula to obtain the image I region color mean vector E(i,j) corresponding to each region window Ω(i,j) E(i,j)=[eR(i,j),eG(i,j),eB(i,j)]T,其中C∈{R,G,B};E(i,j)=[e R (i,j),e G (i,j),e B (i,j)] T , where C∈{R,G,B}; 步骤A-4:根据每个E(i,j)得到对应的图像I区域颜色均值向量的L2范数u(i,j),其表达形式:u(i,j)=||E(i,j)||2Step A-4: Obtain the L2 norm u(i,j) of the color mean vector of the corresponding image I area according to each E(i,j), and its expression form: u(i,j)=||E(i ,j)|| 2 ; 步骤B、获取反映图像深度信息的传播图T;Step B. Obtain a propagation map T reflecting the depth information of the image; 步骤B-1、利用下式计算传播图T的初始值 Step B-1, use the following formula to calculate the initial value of the propagation map T TT ~~ (( ii ,, jj )) == 11 -- AA TT EE. (( ii ,, jj )) -- uu (( ii ,, jj )) 22 || || AA || || 22 22 -- AA TT EE. (( ii ,, jj )) 式中,A为大气光值,AT表示对A进行转置运算;In the formula, A is the atmospheric light value, A T represents the transpose operation on A; 步骤B-2、利用引导滤波算法进一步优化传播图初始值得到反映图像深度信息的传播图T。Step B-2. Use the guided filtering algorithm to further optimize the initial value of the propagation map A propagation map T reflecting the depth information of the image is obtained. 2.根据权利要求1所述的单幅图像去雾方法,其特征在于,有雾RGB彩色图像的大气光值A的获取步骤如下:2. The single image defogging method according to claim 1, wherein the acquisition steps of the atmospheric light value A of the foggy RGB color image are as follows: a、建立一个m×n的矩阵U,其中,矩阵U中第i行第j列元素为图像I区域颜色均值向量的L2范数u(i,j),当i<r+1或i>m-r且j<r+1或j>n-r时,u(i,j)=0;a. Establish an m×n matrix U, where the i-th row and j-th column element in the matrix U is the L2 norm u(i,j) of the color mean vector in the image I area, when i<r+1 or i> When m-r and j<r+1 or j>n-r, u(i,j)=0; b、选取矩阵U中最大元素对应的imax,jmaxb. Select i max and j max corresponding to the largest element in the matrix U; c、在图像I中以imax,jmax为中心像素点,建立大小为(2r+1)×(2r+1)的区域窗口Ωmax(imax,jmax);c. In the image I, take i max and j max as the center pixel, and set up a region window Ω max (i max , j max ) whose size is (2r+1)×(2r+1); d、计算Ωmax(imax,jmax)中所有像素点对应的1×3颜色向量的L2范数,其中颜色向量L2范数中最大值对应的1×3颜色向量即为大气光值A。d. Calculate the L2 norm of the 1×3 color vector corresponding to all pixels in Ω max (i max , j max ), where the 1×3 color vector corresponding to the maximum value in the L2 norm of the color vector is the atmospheric light value A . 3.根据权利要求1或2所述的单幅图像去雾方法,其特征在于,根据下式计算去雾后图像J:3. The method for defogging a single image according to claim 1 or 2, wherein the image J after defogging is calculated according to the following formula: JJ (( ii ,, jj )) == II (( ii ,, jj )) -- AA maxmax (( TT (( ii ,, jj )) ,, tt 00 )) ++ &alpha;A&alpha;A 式中,t0=0.3,α∈[0.6,0.9],T(i,j)为传播图,I(i,j)为待去雾原图;max(T(i,j),t0)表示当T(i,j)≥t0时,max(T(i,j),t0)=T(i,j);否则max(T(i,j),t0)=t0In the formula, t 0 =0.3,α∈[0.6,0.9], T(i,j) is the propagation map, I(i,j) is the original image to be dehazed; max(T(i,j),t 0 ) means that when T(i,j)≥t 0 , max(T(i,j),t 0 )=T(i,j); otherwise max(T(i,j),t 0 )=t 0 . 4.根据权利要求3所述的单幅图像去雾方法,其特征在于,所述α=0.8。4. The method for defogging a single image according to claim 3, wherein the α=0.8. 5.根据权利要求1或2所述的单幅图像去雾方法,其特征在于,区域窗口半径r=7。5. The method for defogging a single image according to claim 1 or 2, wherein the area window radius is r=7.
CN201410153443.4A 2014-04-16 2014-04-16 Method for defogging single image Expired - Fee Related CN104008527B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410153443.4A CN104008527B (en) 2014-04-16 2014-04-16 Method for defogging single image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410153443.4A CN104008527B (en) 2014-04-16 2014-04-16 Method for defogging single image

Publications (2)

Publication Number Publication Date
CN104008527A true CN104008527A (en) 2014-08-27
CN104008527B CN104008527B (en) 2017-02-01

Family

ID=51369168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410153443.4A Expired - Fee Related CN104008527B (en) 2014-04-16 2014-04-16 Method for defogging single image

Country Status (1)

Country Link
CN (1) CN104008527B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104599266A (en) * 2014-12-31 2015-05-06 小米科技有限责任公司 Detection method for fog area in image, device and terminal
CN108093175A (en) * 2017-12-25 2018-05-29 北京航空航天大学 A kind of adaptive defogging method of real-time high-definition video and device
CN108898562A (en) * 2018-06-22 2018-11-27 大连海事大学 A kind of mobile device image defogging method based on deep learning

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61112285A (en) * 1984-11-07 1986-05-30 Hitachi Ltd Conversational image emphasis system
CN102170574A (en) * 2011-05-23 2011-08-31 北京工业大学 Real-time video defogging system
CN102289791A (en) * 2011-06-29 2011-12-21 清华大学 Method for quickly demisting single image
CN102609909A (en) * 2012-01-13 2012-07-25 安科智慧城市技术(中国)有限公司 Method and device for defogging single image
CN103578083A (en) * 2013-09-07 2014-02-12 西安电子科技大学 Single image defogging method based on joint mean shift

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61112285A (en) * 1984-11-07 1986-05-30 Hitachi Ltd Conversational image emphasis system
CN102170574A (en) * 2011-05-23 2011-08-31 北京工业大学 Real-time video defogging system
CN102289791A (en) * 2011-06-29 2011-12-21 清华大学 Method for quickly demisting single image
CN102609909A (en) * 2012-01-13 2012-07-25 安科智慧城市技术(中国)有限公司 Method and device for defogging single image
CN103578083A (en) * 2013-09-07 2014-02-12 西安电子科技大学 Single image defogging method based on joint mean shift

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104599266A (en) * 2014-12-31 2015-05-06 小米科技有限责任公司 Detection method for fog area in image, device and terminal
CN104599266B (en) * 2014-12-31 2017-07-14 小米科技有限责任公司 The detection method in fog region, device and terminal in image
CN108093175A (en) * 2017-12-25 2018-05-29 北京航空航天大学 A kind of adaptive defogging method of real-time high-definition video and device
CN108093175B (en) * 2017-12-25 2018-11-13 北京航空航天大学 A kind of adaptive defogging method of real-time high-definition video and device
CN108898562A (en) * 2018-06-22 2018-11-27 大连海事大学 A kind of mobile device image defogging method based on deep learning
CN108898562B (en) * 2018-06-22 2022-04-12 大连海事大学 A deep learning-based image dehazing method for mobile devices

Also Published As

Publication number Publication date
CN104008527B (en) 2017-02-01

Similar Documents

Publication Publication Date Title
CN102063706B (en) Rapid defogging method
CN102682443B (en) Rapid defogging algorithm based on polarization image guide
CN102254313B (en) Image Dehazing Method Based on Foggy Image Restoration and Image Fusion
CN108269244B (en) An Image Dehazing System Based on Deep Learning and Prior Constraints
US20130071043A1 (en) Image defogging method and system
CN105139347A (en) Polarization imaging defogging method combined with dark channel prior principle
CN102750674A (en) Video image defogging method based on self-adapting allowance
CN105701785B (en) The image haze minimizing technology of Weighted T V transmissivities optimization is divided based on sky areas
CN103500449B (en) Visible remote sensing image cloud detection method of optic on a kind of star
CN107958465A (en) A kind of single image to the fog method based on depth convolutional neural networks
CN105046666A (en) Dark channel prior based traffic video real-time defogging method
CN106127715A (en) A kind of image defogging method and system
CN105279739A (en) Self-adaptive fog-containing digital image defogging method
CN103489161A (en) Gray level image colorizing method and device
CN101770639A (en) Enhancement method of low-illumination image
CN103700079A (en) Image defogging method and device
CN104517126A (en) Air quality assessment method based on image analysis
CN107146233B (en) Particle segmentation method based on polarized sequence map of rock slices
CN104008527B (en) Method for defogging single image
CN110310238A (en) A Single Image Rain Removal Method Based on Compressed Reward and Punishment Neural Network Reusing Original Information
CN107730472A (en) A kind of image defogging optimized algorithm based on dark primary priori
CN104318528A (en) Foggy weather image restoration method based on multi-scale WLS filtering
CN103778605A (en) Greasy weather image enhancement method
CN105989583A (en) Image defogging method
CN103106663B (en) Realize the method for SIM card defects detection based on image procossing in computer system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170201

Termination date: 20190416

CF01 Termination of patent right due to non-payment of annual fee