主要内容

拉东变换

R2026b

radon 函数计算图像矩阵沿指定方向的投影。

二维函数 f(x,y) 的投影是一组线积分。radon 函数计算来自多个源沿平行路径或光束在某个方向上的线积分。光束之间间隔 1 个像素单位。为表示图像,radon 函数通过围绕图像中心旋转源,从不同角度获取图像的多个平行光束投影。下图显示在指定旋转角度下的单个投影。

在旋转角度 theta 下的平行光束投影

Single projection of parallel beams at a rotation angle of theta about the center of the coordinate system.

例如,f(x,y) 在垂直方向上的线积分是 f(x,y) 在 x 轴上的投影;在水平方向上的线积分是 f(x,y) 在 y 轴上的投影。下图显示一个简单二维函数的水平和垂直投影。

简单函数的水平和垂直投影

For a 2-D rectangular object aligned with the x and y axes, the horizontal and vertical projections are 1-D box functions with the same vertical and horizontal spatial extents as the rectangle, respectively.

投影可以沿任何角度 theta (θ) 计算。通常,f(x,y) 的拉东变换是 f 平行于 y 轴的线积分

Rθ(x′)=∫−∞∞f(x′cosθ−y′sinθ,x′sinθ+y′cosθ)dy′

其中

[x′y′]=[ cosθsinθ−sinθcosθ][xy]

下图说明拉东变换的几何形状。

拉东变换的几何形状

The Radon transform of a square at an arbitrary projection angle is an isosceles trapezoid whose axis of symmetry is the y'-axis.

注意

有关基于沿从单个源辐射的路径(称为扇形光束投影)的线积分创建投影数据的信息,请参阅Fan-Beam Projection。要将平行束投影数据转换为扇形光束投影数据,请使用 para2fan 函数。

绘制图像的拉东变换

此示例说明如何使用 radon 函数计算图像在特定旋转角度集合下的拉东变换。

创建一个由单个正方形物品组成的小示例图像,并显示该图像。

I = zeros(100,100);
I(25:75,25:75) = 1;
imshow(I)

Figure contains an axes object. The hidden axes object contains an object of type image.

计算图像在 0° 和 30° 角度下的拉东变换。该函数返回 R,其中列包含 theta 中每个角度的拉东变换。该函数还返回向量 xp,其中包含沿 x 轴的对应坐标。I 的中心像素定义为 floor((size(I)+1)/2),即 x 轴上对应于 x' = 0 的像素。

theta = [0 30];
[R,xp] = radon(I,theta);

绘制在 0° 下的变换。

figure
plot(xp,R(:,1))
title("Radon Transform of Square Function at 0 Degrees")

Figure contains an axes object. The axes object with title Radon Transform of Square Function at 0 Degrees contains an object of type line.

绘制在 30° 下的变换。

plot(xp,R(:,2));
title("Radon Transform of Square Function at 30 Degrees")

Figure contains an axes object. The axes object with title Radon Transform of Square Function at 30 Degrees contains an object of type line.

拉东变换通常针对大量角度进行计算并显示为一个图像。计算正方形图像以 1° 为增量在 0° 到 180° 角度下的拉东变换。

theta = 0:180;
[R,xp] = radon(I,theta);

将二维拉东变换显示为一个正弦图。

figure
imagesc(theta,xp,R)
title("R_{\theta} (X\prime)")
xlabel("\theta (degrees)")
ylabel("X\prime")
set(gca,"XTick",0:20:180)
colormap(hot)
colorbar

Figure contains an axes object. The axes object with title R indexOf theta baseline (X prime ), xlabel theta (degrees), ylabel X prime contains an object of type image.

另请参阅

|

主题