资源简介
图像去雾算法
代码片段和文件信息
clc;
clear all;
img_name=‘jiedao.jpg‘;
% 原始图像
I=double(imread(img_name))/255;
% 获取图像大小
[hwc]=size(I);
win_size = 7;
img_size=w*h;
figure imshow(I);
win_dark=ones(hw);
%计算分块darkchannel
for j=1+win_size:w-win_size
for i=win_size+1:h-win_size
m_pos_min = min(I(ij:));
for n=j-win_size:j+win_size
for m=i-win_size:i+win_size
if(win_dark(mn)>m_pos_min)
win_dark(mn)=m_pos_min;
end
end
end
end
end
%选定精确dark value坐标
% win_b = zeros(img_size1);
figure imshow(win_dark);
win_t=1-0.95*win_dark;
win_b=zeros(img_size1);
for ci=1:h
for cj=1:w
if(rem(ci-815)<1)
if(rem(cj-815)<1)
win_b(ci*w+cj)=win_t(ci*w+cj);
end
end
end
end
%显示分块darkchannel
%figure imshow(win_dark);
neb_size = 9;
win_size = 1;
epsilon = 0.000001;
%指定矩阵形状
indsM=reshape(1:img_sizehw);
%计算矩阵L
tlen = img_size*neb_size^2;
row_inds=zeros(tlen 1);
col_inds=zeros(tlen1);
vals=zeros(tlen1);
len=0;
for j=1+win_size:w-win_size
for i=win_size+1:h-win_size
if(rem(h-815)<1)
if(rem(w-815)<1)
continue;
end
end
win_inds=indsM(i-win_size:i+win_sizej-win_size:j+win_size);
win_inds=win_inds(:);%列显示
winI=I(i-win_size:i+win_sizej-win_size:j+win_size:);
winI=reshape(winIneb_sizec); %三个通道被拉平成为一个二维矩阵 9*3
win_mu=mean(winI1)‘; %求每一列的均值 如果第二个参数为2 则为求每一行的均值 //矩阵变向量
win_var=winI‘*winI/neb_size-win_mu*win_mu‘+epsilon/neb_size*eye(c); %求方差
winI=winI-repmat(win_mu‘neb_size1);%求离差
tvals=(1+winI/win_var*winI‘)/neb_size;% 求论文所指的矩阵L
row_inds(1+len:neb_size^2+len)=reshape(repmat(win_inds1neb_size)...
- 上一篇:手写数字的特征提取
- 下一篇:RNN算法打包matlab
相关资源
- 单一图像去雾
- MATLAB图像去雾处理
- MATLAB图像去雾程序.m
- matlab传统方法图像去雾
- matlab单幅图像去雾的实现
- darkchannel 用MATLAB实现的darkchannel算法
- Retinex 基于RETINEX理论的图像去雾
- Image-Haze-Removal 2009年CVPR最佳论文
- DeHaze 根据CVPR最佳论文实现的基于暗通
- 1 图像去雾基于暗原色先验去雾
- Dehazing-with-Boundary-Constraint 最新图像去
- 图像去雾MATLAB程序
- 2009年CVPR最佳论文去雾技术源代码.d
- 图像去雾技术毕业设计MATLAB
- 基于MATLAB的图像去雾技术.rar
- fattal的singel image dehazing
- matlab基于直方图优化的图像去雾技术
评论
共有 条评论