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

📄 bafrit.m

📁 为stanford大学donoho教授所编写的redgit变换源代码。是用c编写的
💻 M
字号:
function [r, m, ind] = bafrit(x, n, l, wpar, tent, pent)
% BAFRIT  Block adaptive finite ridgelet transform
%	[r, m, ind] = bafrit(x, n, l, wpar, [tent, pent])
%
% Input:
%	x:	image matrix of size aN by bN, (2N-1) is a prime
%	n:	block size      
%	l:	number of wavelet decomposition levels
%	wpar:	parameters for spline biorthogonal filters, e.g. [1,3]
%	tent, pent:	[optional] type and parameter for entropy
%
% Output:
%	r:	block ridgelet coefficients in a matrix
%	m:	block mean values
%	ind:	block list of projections in which DWT is replaced by DCT
%
% Note:
%	This uses folded FRAT with symmetric extention and biorthogonal
%	symmetric wavelet transform (WaveLab function)
%
% See also:	AFRITFD

if ~isprime(2*n-1)
    error('Block size must be n where (2n-1) is prime');
end

[lx, wx] = size(x);

a = floor(lx / n);
b = floor(wx / n);

if ((a * n) ~= lx) | ((b * n) ~= wx)
    error('Input image sizes must be multiple of n');
end

% Transform bock-by-block
r = zeros(n * a, (n+1) * b);
m = zeros(a, b);
ind = cell(a, b);
for i = 1:a
    for j = 1:b
	[r((1+(i-1)*n):(i*n), (1+(j-1)*(n+1)):(j*(n+1))), ...
	 m(i, j), ind{i,j}] = ...
	    afritfd(x((1+(i-1)*n):(i*n), (1+(j-1)*n):(j*n)), ...
	    l, wpar);
    end
end

⌨️ 快捷键说明

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