fratfd.m

来自「脊波工具和相关实验以及有关实验数据」· M 代码 · 共 39 行

M
39
字号
function [r, m] = fratfd(f)
% FRATFD  Folded Finite Radon Transform
%
%       [r, m] = fratfd(f)
%
% Input:
%       f:      a N by N matrix where (2N-1) is a prime number.
%
% Output:
%       r:      a N by (N+1) matrix.  One projection per each column.
%       m:      (optional), normalized mean of the input matrix.
%               In this case, the mean is subtracted from each column of r.
%
% See also:     FRAT

if ndims(f) ~= 2
    error('Input must be a matrix of 2 dimensions');
end

n = size(f, 1);
p = 2 * n - 1;

if (size(f, 2) ~= n) | ~isprime(p)
    error('Input must be a N by N matrix, where (2N-1) is a prime number')
end

% Construct the folded image
fd = fold2(f);

% Compute the FRAT of the folded image
if nargout < 2
    r = frat(fd);
else    
    [r, m] = frat(fd);
end

% Extract the independent set of folded FRAT coefficients
r = r(1:n, 1:n+1);

⌨️ 快捷键说明

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