资源简介
完整的tetrolet变换代码,包含全部组成函数及demo实例。
代码片段和文件信息
% BFILTER2gray Two dimensional bilateral filtering for grayscale images.
% This function implements 2-D bilateral filtering using
% the method outlined in:
%
% C. Tomasi and R. Manduchi. Bilateral Filtering for
% Gray and Color Images. In Proceedings of the IEEE
% International Conference on Computer Vision 1998.
%
% B = bfilter2(AWSIGMA) performs 2-D bilateral filtering
% for the grayscale or color image A. A should be a double
% precision matrix of size NxMx1 or NxMx3 (i.e. grayscale
% or color images respectively) with normalized values in
% the closed interval [01]. The half-size of the Gaussian
% bilateral filter window is defined by W. The standard
% deviations of the bilateral filter are given by SIGMA
% where the spatial-domain standard deviation is given by
% SIGMA(1) and the intensity-domain standard deviation is
% given by SIGMA(2).
%
% Douglas R. Lanman Brown University September 2006.
% dlanman@brown.edu http://mesh.brown.edu/dlanman
%
% 2009-02-20 jens.krommweh(at)uni-due.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Pre-process input and select appropriate filter.
function B = bfilter2gray(Awsigma)
% Verify that the input image exists and is valid.
if ~exist(‘A‘‘var‘) || isempty(A)
error(‘Input image A is undefined or invalid.‘);
end
if ~isfloat(A) || ~sum([13] == size(A3)) || ...
min(A(:)) < 0 || max(A(:)) > 1
error([‘Input image A must be a double precision ‘...
‘matrix of size NxMx1 on the closed interval [01].‘]);
end
% Verify bilateral filter window size.
if ~exist(‘w‘‘var‘) || isempty(w) || ...
numel(w) ~= 1 || w < 1
w = 1;
end
w = ceil(w);
% Verify bilateral filter standard deviations.
if ~exist(‘sigma‘‘var‘) || isempty(sigma) || ...
numel(sigma) ~= 2 || sigma(1) <= 0 || sigma(2) <= 0
sigma = [3 0.1];
end
% Apply grayscale bilateral filtering.
sigma_d = sigma(1);
sigma_r = sigma(2);
% Pre-compute Gaussian distance weights.
[XY] = meshgrid(-w:w-w:w);
G = exp(-(X.^2+Y.^2)/(2*sigma_d^2));
% Apply bilateral filter.
dim = size(A);
B = zeros(dim);
for i = 1:dim(1)
for j = 1:dim(2)
% Extract local region.
iMin = max(i-w1);
iMax = min(i+wdim(1));
jMin = max(j-w1);
jMax = min(j+wdim(2));
I = A(iMin:iMaxjMin:jMax);
% Compute Gaussian intensity weights.
H = exp(-(I-A(ij)).^2/(2*sigma_r^2));
% Calculate bilateral filter response.
F = H.*G((iMin:iMax)-i+w+1(jMin:jMax)-j+w+1);
B(ij) = sum(F(:).*I(:))/sum(F(:));
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-10-01 20:51 Tetrolet_Transform\
文件 6148 2009-10-05 14:38 Tetrolet_Transform\.DS_Store
文件 2752 2009-02-20 03:55 Tetrolet_Transform\bfilter2gray.m
文件 454 2009-02-19 07:21 Tetrolet_Transform\cost_wave.m
文件 296 2008-12-19 22:51 Tetrolet_Transform\cover.mat
文件 1077 2009-02-19 10:07 Tetrolet_Transform\create_matrices_tetro.m
文件 3816 2012-03-08 22:55 Tetrolet_Transform\decdemo.m
文件 2348 2012-03-20 15:15 Tetrolet_Transform\dec_tetro.m
文件 3097 2009-10-01 13:40 Tetrolet_Transform\dec_tetro_coeff.m
文件 2578 2009-09-30 15:04 Tetrolet_Transform\dec_tetro_edge.m
文件 2169 2009-09-30 15:07 Tetrolet_Transform\dec_tetro_rel.m
文件 2604 2009-09-30 15:24 Tetrolet_Transform\dec_tetro_rel_edge.m
文件 1479 2014-03-08 18:37 Tetrolet_Transform\demo_tetro.m
文件 6659 2014-03-28 08:50 Tetrolet_Transform\demo_tetro1.m
文件 519 2009-09-30 13:38 Tetrolet_Transform\edge_det.m
文件 544 2009-02-19 06:49 Tetrolet_Transform\entr.m
文件 890 2014-04-02 22:09 Tetrolet_Transform\fusion_tetro.m
文件 1558 2012-03-02 22:04 Tetrolet_Transform\init_tetro.asv
文件 1558 2012-03-02 22:04 Tetrolet_Transform\init_tetro.m
文件 59325 2008-04-23 13:33 Tetrolet_Transform\lena256.png
文件 9242 2009-02-19 09:49 Tetrolet_Transform\mat117.mat
文件 748 2009-02-19 10:07 Tetrolet_Transform\mat117P.mat
文件 1192 2009-02-19 09:50 Tetrolet_Transform\mat16.mat
文件 298 2009-02-19 10:06 Tetrolet_Transform\mat16P.mat
文件 1938 2009-02-19 09:50 Tetrolet_Transform\mat32.mat
文件 351 2009-02-19 10:07 Tetrolet_Transform\mat32P.mat
文件 4137 2009-02-19 09:50 Tetrolet_Transform\mat64.mat
文件 506 2009-02-19 10:07 Tetrolet_Transform\mat64P.mat
文件 892 2009-09-30 13:08 Tetrolet_Transform\opt_wave10.m
文件 1065 2009-10-05 14:48 Tetrolet_Transform\opt_wave10rel.m
文件 343 2009-03-20 11:53 Tetrolet_Transform\psnr.m
............此处省略8个文件信息
- 上一篇:BMD101通讯协议详解
- 下一篇:全国矢量数据图大全和真实三维地形构建
评论
共有 条评论