⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resamp.m

📁 contourlet算法作为二阶小波算法的延续
💻 M
字号:
function y = resamp(x, type, shift, extmod)
% RESAMP   Resampling in 2D filterbank
%
%	y = resamp(x, type, [shift, extmod])
%
% Input:
%	x:	input image
%	type:	one of {1, 2, 3, 4} (see note)
%	shift:	[optional] amount of shift (default is 1)
%       extmod: [optional] extension mode (default is 'per').
%		Other options are:
%
% Output:
%	y:	resampled image.
%
% Note:
%	The resampling matrices are:
%		R1 = [1, 1;  0, 1];
%		R2 = [1, -1; 0, 1];
%		R3 = [1, 0;  1, 1];
%		R4 = [1, 0; -1, 1];
%
%	For type 1 and type 2, the input image is extended (for example
%	periodically) along the vertical direction;
%	while for type 3 and type 4 the image is extended along the 
%	horizontal direction.
%
%	Calling resamp(x, type, n) which n is positive integer is equivalent
%	to repeatly calling resamp(x, type) n times.
%
%	Input shift can be negative so that resamp(x, 1, -1) is the same
%	with resamp(x, 2, 1)

if ~exist('shift', 'var')
    shift = 1;
end

if ~exist('extmod', 'var')
    extmod = 'per';
end

switch type
    case {1, 2}
	y = resampc(x, type, shift, extmod);
	
    case {3, 4}
	y = resampc(x.', type - 2, shift, extmod).';
	
    otherwise
	error('The second input (type) must be one of {1, 2, 3, 4}');	
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -