资源简介
在联合冲击滤波器和非线性各向异性扩散滤波器对含噪图像做预处理的基础上,利用边缘检测算子选取自适应参数,构建能同时兼顾图像平滑去噪与边缘保留的自适应全变分模型,并基于Bregman迭代正则化方法设计了其快速迭代求解算法。实验结果表明,自适应去噪模型及其求解算法在快速去除噪声的同时保留了图像的边缘轮廓和纹理等细节信息,得到的复原图像在客观评价标准和主观视觉效果方面均有所提高。
代码片段和文件信息
% Decompose textures in image with spectral TV gray-scale images
% script by Guy Gilboa (Jan 2015).
% based on: [1] G. Gilboa “A total variation spectral framework for scale and texture analysis.“ SIAM Journal on Imaging Sciences 7.4 (2014): 1937-1961.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Important params to change according to image / application %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Max_time = 1; % Maximal scale to be processed (in evolution time)
%Max_time = 40; % large scale
Num_of_bands = 50; % Number of bands phi(xt);
%%
dt = Max_time/Num_of_bands;
f = double(imread(‘fruits.bmp‘));
%f = f(50:10050:100); % debug
f = double(f);
f = f(21:18571:240); % fruits melon
f = f/255; % pixels are in the range [01]
figure(1); imshow(f); title(‘f‘)
% Compute Phi bands and residual f_r
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[STPhif_r] = specTV_evolve(f Max_time dt); % evolve image
% Define Filters
hp_i = 10;
bp_low_i=13; bp_high_i = 30; % incices of low and high bandpass cutoff
H1 = zeros(size(T));
H1(1:lp_i)=1; % high pass melon
H2 = zeros(size(T));
H2(bp_low_i:bp_high_i)=1; % band pass melon
% Reconstruct filtered image given Phi H and f_r
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
f_H1 = specTV_filter( Phi H1 f_r dt );
f_H2 = specTV_filter( Phi H2 f_r dt );
% Plot S(t) and filter response
figure(3); plot(TS‘b‘T(1:hp_i)S(1:hp_i)‘g‘T(bp_low_i:bp_high_i)S(bp_low_i:bp_high_i)‘r‘);
xlabel(‘t‘);
legend(‘Spectrum S(t)‘‘High Pass Filter H1(t)‘ ‘Band Pass Filter H2(t)‘)
% show a few Phi(t) instances
%phi_show = [4 20 30 50];
figure(4);
imshow(0.5+f_H1*2);
title(‘High Pass image f_{H1} x 2‘)
figure(5);
imshow(0.5+f_H2);
title(‘Band Pass image f_{H2}‘)
figure(6);
imshow(f_r); title(‘Residual f_r (Low-pass)‘)
Ind = 1:10; % Index of phi bands
RbyC = [2 5]; % Row by Column boxes
fignum =10; % Num of figure
Rescale = 1; % Possible image size rescaling (1 - no rescale >1 larger images)
contrast = 5;
I = specTV_show_phi( Phi*contrastdt Ind RbyC fignum Rescale);
title([‘A few instances of \phi(x;t) from bands ‘ num2str(Ind(1)) ‘ to ‘ num2str(Ind(end))])
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-02-09 18:28 SpecTV_grayscale\
文件 2022 2015-02-09 18:38 SpecTV_grayscale\demo_specTV_grayscale.asv
文件 2282 2015-02-09 19:05 SpecTV_grayscale\demo_specTV_grayscale.m
文件 90626 2001-11-19 16:54 SpecTV_grayscale\fruits.bmp
文件 1248 2013-04-08 23:42 SpecTV_grayscale\proj_tvl2.m
文件 1509 2015-02-09 18:51 SpecTV_grayscale\specTV_evolve.m
文件 421 2015-02-09 18:52 SpecTV_grayscale\specTV_filter.m
文件 1151 2015-02-09 17:52 SpecTV_grayscale\specTV_show_phi.m
- 上一篇:势函数的matlab实现
- 下一篇:local outlier factor检测
评论
共有 条评论