资源简介
用matlab实现ELad文章里的算法。图片也包含在里面。希望对研究此理论的人有所帮助。
代码片段和文件信息
function retimg = bialteral(img N sigma)
%% colorspace transformation
img = rgb2hsv(img);%convert rgb to hsv colorspace in order to process
%% pre-computer domain filtering
sigma_d = sigma(1);
sigma_r = sigma(2);
[XY] = meshgrid(-N:N-N:N);%generate two matrix
D = exp(-(X.^2+Y.^2)/(2*sigma_d^2));%domain weights with Euclidean distance
%% create waitbar
h = waitbar(0‘illumination retinex algorithm……‘);
set(h‘Name‘‘Illumination Retinex‘);
%% rang filtering in v layer
dim = size(img);%dim=[heightlength3]
B = zeros(dim);%create an image B with the same size and dimension with the zero value.
for i = 1:dim(1)
for j = 1:dim(2)
iMin = max(i-N1);
iMax = min(i+Ndim(1));
jMin = max(j-N1);
jMax = min(j+Ndim(2));
L = img(iMin:iMaxjMin:jMax3);%extract the local region
d = L-img(ij3);%the dissimilarity between the surroud and center
R = exp(-(d.^2)/(2*sigma_r^2));%range filter weights
F = R.*D((iMin:iMax)-i+N+1(jMin:jMax)-j+N+1);%its row is from iMin-i+N+1 to iMax-i+N+1and so as line
for m = 1:iMax-iMin+1
for n = 1:jMax-jMin+1
if d(mn) < 0
F(mn) = 0;
end
end
end
norm_F = sum(F(:));
B(ij3) = sum(sum(F.*L))/norm_F;
retimg(ij1) = img(ij1);
retimg(ij2) = img(ij2);
retimg(ij3) = B(ij3);
end
waitbar(i/dim(1));
end
close(h);%close the bar
%% display colorspace transformation
img = hsv2rgb(img);
retimg = hsv2rgb(retimg);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1674 2010-07-15 10:13 hsv\demo.m
文件 1660 2010-07-15 10:27 hsv\bialteral.m
文件 1196 2010-07-15 10:28 hsv\bialteral2.m
文件 1970126 2010-07-15 09:39 hsv\2005.bmp
文件 915894 2010-07-12 18:52 hsv\5.bmp
文件 1962090 2010-07-15 10:19 hsv\boy.bmp
文件 1969902 2010-07-15 10:19 hsv\girl.bmp
目录 0 2010-07-15 10:06 hsv
----------- --------- ---------- ----- ----
6822542 8
- 上一篇:Matlab编写NSGA-Ⅱ
- 下一篇:MATLAB与simuli
nk教程.rar
相关资源
- 信号处理滤波器设计-基于MATLAB和Mat
- 双边滤波 图像增强
- Retinex理论的matlab实现和雾天图像处理
- 粒子滤波matlab实现三套
- retinex的的matlab程序
- 数字滤波器的MATLAB与FPGA实现——杜勇
- Kalman filtering-theory and practice using MAT
- Adaptive Filtering 4th,MATLAB——Nonlinear
- kernel adapting filter
- 基于MATLAB的Filter使用,低通,带通和
- Multi-Scale Retinex with Color Restore 多尺度
- 在matlab比较filter函数 与filtfilt函数的
- Gaborfilter matlab
- 图像增强Matlab代码总结6种
- 汉宁窗FIR数字低通滤波器MATLAB
- kalmanfilter_fuben.slx
- retinex的matlab程序
- retinex的MATLAB实现程序
- 带色彩恢复的多尺度Retinex算法MSRCR
- 基于双边滤波器的retinex算法等代码
- Retinex Matlab算法
- 单尺度,多尺度的Retinex算法程序
- 自适应平滑滤波matlab
- 多维容积卡尔曼滤波CKF的函数
- KCF (Kernelized Correlation Filters)Matlab源
- 图像处理,matlab程序,retinex_frankle_
- Retinex的算法
- upf--The Unscented Particle Filter
- MATLAB-BOXFILTER
- MSR MATLAB程序
评论
共有 条评论