frt_rp.m

来自「beamlet变化的工具箱」· M 代码 · 共 97 行

M
97
字号
function [Theta,Anomaly] = FRT_RP(Image)
% FDRT: Fast Discrete Ridgelet transform based on RectoPolar Coordinates
%  R = FRT_RP(Image)
% Inputs
%	Image	n*n image, n dyadic
% Outputs
%	Theta	n*2n transform, in two batches of n columns
%	Anomaly	2n	extra piece
% Description
%	Calculates an approximate Ridgelet transform
%	in a special X-geometry.  
%   The polar transform associated with continuum
%	data is replaced by a pair of X-s, and the transform
%	is evaluated in that geometry.  To calculate
%	the transform at the polar grid requires re-sampling.

% Programming Notes: 
% Note: use of .' for non-conjugate transpose
% Note: fft_ua requires row vector input

%
%	Diagnostics
%
	nn = size(Image);
	if nn(1) ~= nn(2),
		disp('Error in FDRT_RP: Image must be square')
	end
	n = nn(1);
%
%	Future step -- Pad by factor two at edges.
%
%
%	Unbiased Fourier Transform on rows, then columns
%
	UF = zeros(n,n);
	for i=1:n,
		UF(i,:) = fft_ua(Image(i,:));
	end
	for j=1:n,
		f = UF(:,j).';
		g = fft_ua(f);
		UF(:,j) = g.';
	end
%
%	Cartesian-to-Polar Conversion
%

	X = Cart_2_RectPolar(UF);
	Anomaly = imag(X(1,:));
	X(1,:) = real(X(1,:));

%
%	Future Step: Extend to 2n*n with Damping
%
%	Meyer Wavelet Transform of Columns
%
	Alpha1 = zeros(n,n);
	Alpha2 = zeros(n,n);
	for j=1:(n),
		Alpha1(:,j) = PFWT_YM(X(:,j  ).',3,3).';
		Alpha2(:,j) = PFWT_YM(X(:,j+n).',3,3).';
	end
%
%	Boundary-adjusted Wavelet Transform of Rows
%
	Theta1 = zeros(n,n);
	Theta2 = zeros(n,n);
	bump = 16;
	levl = 3;
	for j=1:(n),
		Theta1(j,:) = FWT_CDJV(Alpha1(j,:),levl,3);
		Theta2(j,:) = FWT_CDJV(Alpha2(j,:),levl,3);
		if j==bump,
			levl = levl+1;
			bump = 2*bump;
		end
	end
	Theta = [Theta1 Theta2];

%
% Copyright (c) 1998,1999,2000 David L. Donoho		
%	
%% Part of BeamLab Version:200% Built:Friday,23-Aug-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%%% Part of BeamLab Version:200% Built:Saturday,14-Sep-2002 00:00:00% This is Copyrighted Material% For Copying permissions see COPYING.m% Comments? e-mail beamlab@stat.stanford.edu%

⌨️ 快捷键说明

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