用于去雾的曝光增强算法

转载于:
https://blog.csdn.net/phoenixtree7/article/details/60769717


本文提到的这种图像曝光增强算法,是文章【1】提及的。具体原理比较简单,文章也是作为去雾算法的一个 postprocessing option 用很小的篇幅介绍。

【1】Tang K, Yang J, Wang J. Investigating haze-relevant features in a learning framework for image dehazing[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2014: 2995-3000.    [ download:http://www.juew.org/publication/dehazing_cvpr14.pdf ]

大家都知道,用DCP及其改进等去雾算法都会有曝光不足问题。开始,我也只是用简单的gamma变换等等简单的方法进行曝光改善,但并不理想。这里介绍的方法,感觉要合理很多,大家可以一试。

这里提供自己写的matlab代码。当然,也有python代码,大家可以下载。 [ download: https://github.com/caibolun?page=1&tab=stars,   在该网页找到 haze_2014 ]
 

MATLAB CODE

function [ exposureOutput,exposureScaling ] = imexposure(J,I,lambda)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is a function to enhance the input image's exposure.
% Image Exposure Algorithm using GIF
%
% Input  :
%        J        The poor exposure image, color image
%        I        The guidance of the Guided Image Filter, color image
%   lambda  The regular parameter
% Output:
%   exposureOutput     The exposure improved image
%   exposureScaling     The exposure scaling for each pixels
%
% This algorithm is derived by the artical of :
% Investigating Haze-relevant Features in A Learning Framework for Image Dehazing
% Ketan Tang et.al.    2014
%
% Edit by Dong Zhao, 2017
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

hsv_I = rgb2hsv(I);
hsv_J = rgb2hsv(J);
I_gray = rgn2gray(I);
luminance_I = hsv_I(:,:,3);
luminance_J = hsv_J(:,:,3);

%lambda = 0.1;
eps = 10^(-6);
r = 60;
IxI = lambda*luminance_I.*luminance_I;
JxJ = luminance_J.*luminance_J;
IxJ = luminance_J.*luminance_I;

S = (IxJ+IxI)./(JxJ+IxI);
S_GIF =  guidedfilter(I_gray,S,r,eps);  
%figure,imagesc(S_GIF); colormap jet;

hsv_J(:,:,3) = S_GIF.*hsv_J(:,:,3); %+hsv_J(:,:,3);
exposureScaling = S_GIF;
%figure,imshow(hsv_J(:,:,3) );colormap jet;

exposureOutput = hsv2rgb(hsv_J);
%figure,imshow(exposureOutput)


关于导向滤波器的代码 guidedfilter,网上一搜就能找到。


效果展示:

其中,lambda = 0.1

(a)  去雾图像,曝光不足


(b)  导向滤波器的 guidance,我们选择雾图像


(c)  计算得到的 scaling

(d)  曝光增强图像



Lambda

 lambda的调整:

 lambda>0, lambda 越小,曝光程度越强。

(e) lambda = 0.3 时的 scaling,发现增强程度不如 lambda = 0.1,即图 (c)。


(f) lambda = 0.3 的输出结果


当然,lambda 不能小于0!

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值