-1

我需要对图像进行氡变换,但我不允许使用 MATLAB 的氡函数。所以我必须自己编写。

我为此做了一些研究,但找不到任何令人满意的例子。

  • 有没有其他方法可以在不使用氡的情况下获得图像的投影?
  • 如果没有,我该如何编写自己的氡函数(至少有一点线索)
4

2 回答 2

1

氡变换将 2D/伪 3D 图像转换为 1D 强度等效值。基本上,我们计算所有角度 theta 的一行像素的所有强度的总和。

Justin K. Romberg(莱斯大学)在https://www.clear.rice.edu/elec431/projects96/DSP/projections.html上的原始代码

预测.m

%%This MATLAB function takes an image matrix and vector of angles and
%%then finds the 1D projection (Radon transform) at each of the angles.
%%It returns a matrix whose columns are the projections at each angle.
%% Written by : Justin K. Romberg

function PR = projections(IMG, THETA)

% pad the image with zeros so we don't lose anything when we rotate.
[iLength, iWidth] = size(IMG);
iDiag = sqrt(iLength^2 + iWidth^2);
LengthPad = ceil(iDiag - iLength) + 2;
WidthPad = ceil(iDiag - iWidth) + 2;
padIMG = zeros(iLength+LengthPad, iWidth+WidthPad);
padIMG(ceil(LengthPad/2):(ceil(LengthPad/2)+iLength-1), ...
    ceil(WidthPad/2):(ceil(WidthPad/2)+iWidth-1)) = IMG;
% loop over the number of angles, rotate 90-theta (because we can easily sum
% if we look at stuff from the top), and then add up.  Don't perform any
% interpolation on the rotating.
n = length(THETA);
PR = zeros(size(padIMG,2), n);
for i = 1:n
   tic
   tmpimg = imrotate(padIMG, 90-THETA(i), 'bilinear', 'crop');
   PR(:,i) = (sum(tmpimg))';
   THETA(i)
   toc
end
于 2016-10-26T22:10:40.110 回答
0

我不知道它是否是您搜索的内容,但请看一下: 最后的 Matlab 代码。

于 2013-10-01T15:19:16.310 回答