CN105989583B - A kind of image defogging method - Google Patents
A kind of image defogging method Download PDFInfo
- Publication number
- CN105989583B CN105989583B CN201610569218.8A CN201610569218A CN105989583B CN 105989583 B CN105989583 B CN 105989583B CN 201610569218 A CN201610569218 A CN 201610569218A CN 105989583 B CN105989583 B CN 105989583B
- Authority
- CN
- China
- Prior art keywords
- image
- value
- transmittance
- block
- rectangular sub
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000002834 transmittance Methods 0.000 claims abstract description 23
- 238000012545 processing Methods 0.000 claims description 8
- 230000000694 effects Effects 0.000 abstract description 3
- 125000001475 halogen functional group Chemical group 0.000 abstract description 2
- 238000012544 monitoring process Methods 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/73—Deblurring; Sharpening
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Investigating Or Analysing Materials By Optical Means (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种图像去雾方法,该方法使用新的透射率估算法代替软抠图法,通过有雾图像的三原色通道最小分量的增益干预来求得透射率,可以在避免光晕和快效应的前提下,快速求得近似暗通道图像强度,从而提高算法的实时性,并使用四叉树细分法估算大气光值,使得大气光值的精度提高,最后通过透射率和大气光值多图像进行去雾处理。本发明提高了去雾的实时性以及去雾图像的保真度。
The invention discloses an image defogging method, which uses a new transmittance estimation method instead of the soft matting method, and obtains the transmittance through the gain intervention of the minimum component of the three primary color channels of the foggy image, which can avoid halo and Under the premise of fast effect, quickly obtain the approximate dark channel image intensity, thereby improving the real-time performance of the algorithm, and use the quadtree subdivision method to estimate the atmospheric light value, so that the accuracy of the atmospheric light value is improved, and finally through the transmittance and atmospheric light Value multiple images are dehazed. The invention improves the real-time performance of defogging and the fidelity of defogging images.
Description
技术领域technical field
本发明属于数字图像处理和机器视觉技术领域,特别涉及了一种图像去雾方法。The invention belongs to the technical field of digital image processing and machine vision, and in particular relates to an image defogging method.
背景技术Background technique
随着科学技术的发展和人民生活水平的进步,实际生活中运用了越来越多的视觉系统,如:监控系统,智能交通系统等,人类生活质量和需求逐渐提高,这些应用系统与人类生活密切相关,直接影像着人类生活中。With the development of science and technology and the improvement of people's living standards, more and more visual systems are used in real life, such as: monitoring systems, intelligent transportation systems, etc., and the quality of human life and needs are gradually improving. These application systems are closely related to human life. It is closely related and directly affects human life.
空气质量的降低和能见度的降低对人们的生活以及工业的发展造成了很大的影响。由于光线被浑浊介质吸收和散射,在户外恶劣天气下拍摄的图片,使得光的强度降低,导致光学传感器接收的光强产生改变,最终导致色彩的保真度下降,存在严重的颜色失真与偏移,以及图像对比度的降低,图像细节信息丢失,清晰度不够,图片信息的辨识度大大降低。此外,大多数的自动系统,它强烈地依赖于输入图像的定义,退化的图像会导致自动系统不能正常工作,影响和限制了公路视觉监控、智能导航、遥感监控等工作。The reduction of air quality and the reduction of visibility have had a great impact on people's life and the development of industry. Due to the light being absorbed and scattered by the turbid medium, the pictures taken outdoors in bad weather will reduce the light intensity, resulting in a change in the light intensity received by the optical sensor, which will eventually lead to a decrease in color fidelity and serious color distortion and cast. shift, and the reduction of image contrast, the loss of image detail information, insufficient clarity, and the recognition of image information is greatly reduced. In addition, most automatic systems rely heavily on the definition of the input image, and degraded images will cause the automatic system to fail to work properly, affecting and limiting the work of highway visual monitoring, intelligent navigation, and remote sensing monitoring.
因此,对有雾图像的去雾处理具有广阔的应用前景,可应用于水下拍摄、航拍、户外监控甚至是医学图像等,经过去雾处理的图像和视频更具有价值,有利于许多图像理解和计算机视觉应用(如航空图像),图像分类,图像/视频检索,遥感和视频分析和识别,给人们的生活带来很多的便利。在图像处理领域中,图像去雾起步相对较晚。目前国内外学者提出的图像去雾的方法还不是特别完善,亟待改进和提高,尤其是如何提高去雾处理的实时性以及保真性是解决去雾问题的关键。Therefore, the defogging processing of foggy images has broad application prospects, and can be applied to underwater shooting, aerial photography, outdoor monitoring, and even medical images. Images and videos after defogging processing are more valuable and beneficial to many image understandings. And computer vision applications (such as aerial images), image classification, image/video retrieval, remote sensing and video analysis and recognition, bring a lot of convenience to people's lives. In the field of image processing, image defogging started relatively late. At present, the image defogging methods proposed by domestic and foreign scholars are not particularly perfect, and need to be improved and improved urgently. In particular, how to improve the real-time performance and fidelity of defogging processing is the key to solving the defogging problem.
发明内容Contents of the invention
为了解决上述背景技术提出的技术问题,本发明旨在提供一种图像去雾方法,采用改进的透射率和大气光值的计算方法,提高去雾的实时性以及去雾图像的精度。In order to solve the technical problems raised by the above-mentioned background technology, the present invention aims to provide an image defogging method, which adopts an improved calculation method of transmittance and atmospheric light value to improve the real-time performance of defogging and the accuracy of defogging images.
为了实现上述技术目的,本发明的技术方案为:In order to realize above-mentioned technical purpose, technical scheme of the present invention is:
一种图像去雾方法,包括以下步骤:A kind of image defogging method, comprises the following steps:
(1)计算有雾图像的透射率:(1) Calculate the transmittance of the foggy image:
t(x,y)=(1-Im(x,y))+gρ (1)t(x,y)=(1-I m (x,y))+gρ (1)
式(1)中,t(x,y)为透射率,(x,y)表示像素坐标,ρ是校准因子,g为增益常数:In formula (1), t(x, y) is the transmittance, (x, y) represents the pixel coordinates, ρ is the calibration factor, and g is the gain constant:
式(2)中,|Im|和|d|分别是Im和d的像素总数,对应的Im和d:In formula (2 ) , |I m | and |d| are the total number of pixels of Im and d respectively, corresponding to Im and d:
d(x,y)=Im(x,y)-Id(x,y) (4)d(x,y)=I m (x,y)-I d (x,y) (4)
式(3)中,Ic表示去雾图像的颜色通道;In formula (3), Ic represents the color channel of the defogged image;
式(4)中,Ω(x,y)表示以(x,y)为中心的方形区域,min表示取最小值;In formula (4), Ω(x,y) represents a square area centered on (x,y), and min represents the minimum value;
(2)采用四叉树细分法估计有雾图像的大气光值,具体步骤如下:(2) Use the quadtree subdivision method to estimate the atmospheric light value of the foggy image. The specific steps are as follows:
(a)将有雾图像划分成若干大小相等的矩形子块;(a) Divide the foggy image into several rectangular sub-blocks of equal size;
(b)计算每个矩形子块的平均像素值,保留平均像素值最大的矩形子块,并将该矩形子块的平均像素值记为最大像素值Amax;(b) calculate the average pixel value of each rectangular sub-block, retain the largest rectangular sub-block with an average pixel value, and record the average pixel value of this rectangular sub-block as the maximum pixel value Amax ;
(c)若最大像素值Amax比预设的像素阈值a小,且最大像素值Amax对应的矩形子块的大小大于等于预设的最小窗口大小,则返回步骤(a),进一步划分矩形子块,否则进入步骤(d);(c) If the maximum pixel value A max is smaller than the preset pixel threshold a, and the size of the rectangular sub-block corresponding to the maximum pixel value A max is greater than or equal to the preset minimum window size, return to step (a) and further divide the rectangle sub-block, otherwise enter step (d);
(d)将图像从RGB空间转换到YCbCr空间,且对应于最终保留的矩形子块,选择该矩形子块亮度分量的最大值作为大气光值Ac;(d) Convert the image from RGB space to YCbCr space, and corresponding to the finally reserved rectangular sub-block, select the maximum value of the luminance component of the rectangular sub-block as the atmospheric light value A c ;
(3)根据步骤(1)得到的透射率和步骤(2)得到的大气光值,对图像进行去雾处理:(3) Dehaze the image according to the transmittance obtained in step (1) and the atmospheric light value obtained in step (2):
式(5)中,J表示去雾处理后的图像,I为有雾图像,t0为透射率阈值,max表示取最大值。In formula (5), J represents the image after defogging processing, I represents the foggy image, t 0 is the transmittance threshold, and max represents the maximum value.
进一步地,在步骤(1)中,校准因子ρ的取值范围是[0.8,1]。Further, in step (1), the value range of the calibration factor ρ is [0.8,1].
进一步地,校准因子ρ的取值为0.9。Further, the value of the calibration factor ρ is 0.9.
进一步地,在步骤(3)中,透射率阈值t0的取值范围是[0.05,0.15]。Further, in step (3), the value range of the transmittance threshold t 0 is [0.05, 0.15].
进一步地,透射率阈值t0的取值是0.1。Further, the value of the transmittance threshold t 0 is 0.1.
采用上述技术方案带来的有益效果:The beneficial effect brought by adopting the above-mentioned technical scheme:
本发明相较于原有的暗通道算法中,使用新的透射率估算法代替软抠图法,通过有雾图像的三原色通道最小分量的增益干预来求得透射率,可以在避免光晕和快效应的前提下,快速求得近似暗通道图像强度,从而提高算法的实时性,并使用四叉树细分法估算大气光值,使得大气光值的精度提高,从而达到实时性好且保真度高的图像去雾的效果。Compared with the original dark channel algorithm, the present invention uses a new transmittance estimation method instead of the soft matting method, and obtains the transmittance through the gain intervention of the minimum component of the three primary color channels of the foggy image, which can avoid halo and Under the premise of fast effect, the approximate dark channel image intensity can be quickly obtained, thereby improving the real-time performance of the algorithm, and the quadtree subdivision method is used to estimate the atmospheric light value, which improves the accuracy of the atmospheric light value, thereby achieving good real-time performance and maintaining The effect of defogging the image with high degree of realism.
附图说明Description of drawings
图1是本发明的基本流程图。Figure 1 is a basic flow chart of the present invention.
图2是本发明中计算大气光值的流程图。Fig. 2 is a flow chart of calculating the atmospheric light value in the present invention.
具体实施方式Detailed ways
以下将结合附图,对本发明的技术方案进行详细说明。The technical solutions of the present invention will be described in detail below in conjunction with the accompanying drawings.
如图1所示,一种图像去雾方法,包括以下步骤:As shown in Figure 1, an image defogging method includes the following steps:
步骤1、计算有雾图像的透射率:Step 1. Calculate the transmittance of the foggy image:
t(x,y)=(1-Im(x,y))+gρ (1)t(x,y)=(1-I m (x,y))+gρ (1)
式(1)中,t(x,y)为透射率,(x,y)表示像素坐标,ρ是校准因子,ρ的取值通常在[0.8,1]中,本实施例可以令ρ=0.9,g为增益常数:In formula (1), t(x, y) is the transmittance, (x, y) represents the pixel coordinates, ρ is the calibration factor, and the value of ρ is usually in [0.8,1]. In this embodiment, ρ= 0.9, g is the gain constant:
式(2)中,|Im|和|d|分别是Im和d的像素总数,对应的Im和d:In formula (2 ) , |I m | and |d| are the total number of pixels of Im and d respectively, corresponding to Im and d:
d(x,y)=Im(x,y)-Id(x,y) (4)d(x,y)=I m (x,y)-I d (x,y) (4)
式(3)中,Ic表示去雾图像的颜色通道;In formula (3), Ic represents the color channel of the defogged image;
式(4)中,Ω(x,y)表示以(x,y)为中心的方形区域,min表示取最小值。In formula (4), Ω(x, y) represents a square area centered on (x, y), and min represents the minimum value.
步骤2、采用四叉树细分法估计有雾图像的大气光值,具体步骤如图2所示:Step 2. Estimate the atmospheric light value of the foggy image using the quadtree subdivision method. The specific steps are shown in Figure 2:
(a)将有雾图像划分成若干大小相等的矩形子块;(a) Divide the foggy image into several rectangular sub-blocks of equal size;
(b)计算每个矩形子块的平均像素值,保留平均像素值最大的矩形子块,并将该矩形子块的平均像素值记为最大像素值Amax;(b) calculate the average pixel value of each rectangular sub-block, retain the largest rectangular sub-block with an average pixel value, and record the average pixel value of this rectangular sub-block as the maximum pixel value Amax ;
(c)若最大像素值Amax比预设的像素阈值a小,且最大像素值Amax对应的矩形子块的大小大于等于预设的最小窗口大小,则返回步骤(a),进一步划分矩形子块,否则进入步骤(d);(c) If the maximum pixel value A max is smaller than the preset pixel threshold a, and the size of the rectangular sub-block corresponding to the maximum pixel value A max is greater than or equal to the preset minimum window size, return to step (a) and further divide the rectangle sub-block, otherwise enter step (d);
(d)将图像从RGB空间转换到YCbCr空间,且对应于最终保留的矩形子块,选择该矩形子块亮度分量的最大值作为大气光值Ac。(d) Convert the image from the RGB space to the YCbCr space, and corresponding to the finally reserved rectangular sub-block, select the maximum value of the luminance component of the rectangular sub-block as the atmospheric light value Ac .
步骤3、根据步骤1得到的透射率和步骤2得到的大气光值,对图像进行去雾处理:Step 3. Dehaze the image according to the transmittance obtained in step 1 and the atmospheric light value obtained in step 2:
式(5)中,J表示去雾处理后的图像,I为有雾图像,max表示取最大值,t0为透射率阈值,t0的取值范围是[0.05,0.15],本实施例可以令t0=0.1,用于限制透射率t(x,y),由于当t(x,y)→0时,J(x,y)t(x,y)也会趋近于0,使得去雾图像包含噪声,为避免这种情况的发生,设置t0来提高去雾图像的质量。In formula (5), J represents the image after defogging processing, I is a foggy image, max represents the maximum value, t0 is the transmittance threshold, and the value range of t0 is [0.05,0.15]. In this embodiment You can set t 0 =0.1 to limit the transmittance t(x,y), because when t(x,y)→0, J(x,y)t(x,y) will also approach 0, Make the dehazed image contain noise, in order to avoid this situation, set t 0 to improve the quality of the dehazed image.
以上实施例仅为说明本发明的技术思想,不能以此限定本发明的保护范围,凡是按照本发明提出的技术思想,在技术方案基础上所做的任何改动,均落入本发明保护范围之内。The above embodiments are only to illustrate the technical ideas of the present invention, and can not limit the protection scope of the present invention with this. All technical ideas proposed in accordance with the present invention, any changes made on the basis of technical solutions, all fall within the protection scope of the present invention. Inside.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610569218.8A CN105989583B (en) | 2016-07-19 | 2016-07-19 | A kind of image defogging method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610569218.8A CN105989583B (en) | 2016-07-19 | 2016-07-19 | A kind of image defogging method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105989583A CN105989583A (en) | 2016-10-05 |
CN105989583B true CN105989583B (en) | 2018-07-24 |
Family
ID=57044532
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610569218.8A Expired - Fee Related CN105989583B (en) | 2016-07-19 | 2016-07-19 | A kind of image defogging method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105989583B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106846260B (en) * | 2016-12-21 | 2019-06-07 | 常熟理工学院 | Video defogging method in a kind of computer |
CN107316284B (en) * | 2017-07-19 | 2019-01-08 | 山东财经大学 | Image defogging method and device under intense light source |
CN108765337B (en) * | 2018-05-28 | 2021-06-15 | 青岛大学 | A single color image dehazing method based on dark primary color prior and non-local MTV model |
CN112083716B (en) * | 2019-06-13 | 2024-07-12 | 天翼云科技有限公司 | Navigation method, device and system based on machine vision |
CN112949389A (en) * | 2021-01-28 | 2021-06-11 | 西北工业大学 | Haze image target detection method based on improved target detection network |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104252698A (en) * | 2014-06-25 | 2014-12-31 | 西南科技大学 | Semi-inverse method-based rapid single image dehazing algorithm |
-
2016
- 2016-07-19 CN CN201610569218.8A patent/CN105989583B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104252698A (en) * | 2014-06-25 | 2014-12-31 | 西南科技大学 | Semi-inverse method-based rapid single image dehazing algorithm |
Non-Patent Citations (4)
Title |
---|
A review on dark channel prior based image dehazing algorithms;Sungmin Lee et al;《EURASIP Journal on Image and Video Processing》;20160119;全文 * |
Single Image Defogging by Multiscale Depth Fusion;Yuan-Kai Wang et al;《IEEE TRANSACTIONS ON IMAGE PROCESSING》;20141130;第23卷(第11期);全文 * |
Single Image Haze Removal Using Dark Channel Prior;Kaiming He et al;《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》;20111231;第33卷(第12期);全文 * |
Visibility Restoration of Single Hazy Images Captured in Real-World Weather Conditions;Shih-Chia Huang et al;《IEEE TRANSACTIONS ON CIRCUITS AND SYSTEMS FOR VIDEO TECHNOLOGY》;20141031;第24卷(第10期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN105989583A (en) | 2016-10-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102750674B (en) | Video image defogging method based on self-adapting allowance | |
CN105989583B (en) | A kind of image defogging method | |
Huang et al. | An advanced single-image visibility restoration algorithm for real-world hazy scenes | |
CN108876743B (en) | A kind of image fast dehazing method, system, terminal and storage medium | |
CN102063706B (en) | Rapid defogging method | |
CN106530246B (en) | Image defogging method and system based on dark Yu non local priori | |
CN102768760B (en) | Quick image dehazing method on basis of image textures | |
WO2019042216A1 (en) | Image blurring processing method and device, and photographing terminal | |
CN103440674B (en) | A kind of rapid generation of digital picture wax crayon specially good effect | |
CN107301623A (en) | A kind of traffic image defogging method split based on dark and image and system | |
CN107895357B (en) | A kind of real-time water surface thick fog scene image Enhancement Method based on FPGA | |
CN108765336A (en) | Image defogging method based on dark bright primary colors priori with auto-adaptive parameter optimization | |
Zheng et al. | Infrared traffic image enhancement algorithm based on dark channel prior and gamma correction | |
CN106875351A (en) | A kind of defogging method towards large area sky areas image | |
CN108154492B (en) | An image haze removal method based on non-local mean filtering | |
CN107545544A (en) | The method and apparatus for removing the turbid object in image | |
CN108805942B (en) | Infrared image wide dynamic compression method | |
CN109493291A (en) | A kind of method for enhancing color image contrast ratio of adaptive gamma correction | |
CN108093175B (en) | A kind of adaptive defogging method of real-time high-definition video and device | |
CN110428439A (en) | A kind of shadow detection method based on shadow region color saturation property | |
CN111612725A (en) | An Image Fusion Method Based on Visible Light Image Contrast Enhancement | |
Khan et al. | Recent advancement in haze removal approaches | |
CN103347171A (en) | Foggy day video processing system and method based on DSPs | |
CN106709876B (en) | Optical remote sensing image defogging method based on dark image element principle | |
JP2024531746A (en) | Tone mapping method and system and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180724 Termination date: 20210719 |
|
CF01 | Termination of patent right due to non-payment of annual fee |