何凯明图像去雾--包含soft matting的matlab代码

img_name='333.jpg';
% 原始图像
I=double(imread(img_name))/255;

% 获取图像大小

[h,w,c]=size(I);
win_size = 7;
img_size=w*h;
dehaze=zeros(img_size*c,1);
dehaze=reshape(dehaze,h,w,c);


figure, imshow(I);
win_dark=zeros(img_size ,1);

for cc=1:img_size
   win_dark(cc)=1;
end

win_dark=reshape(win_dark,h,w);
%计算分块darkchannel
 for j=1+win_size:w-win_size
    for i=win_size+1:h-win_size
        m_pos_min = min(I(

你可能感兴趣的:(何凯明图像去雾--包含soft matting的matlab代码)