Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR07 / 2read / image processing toolbox guide.pdf
Скачиваний:
166
Добавлен:
18.03.2015
Размер:
18.08 Mб
Скачать

9 Transforms

R45o (x′)

80

70

60

50

40

30

20

10

0

−80

−60

−40

−20

0

20

40

60

80

Radon Transform of a Square Function at 45 Degrees

Viewing the Radon Transform as an Image

The Radon transform for a large number of angles is often displayed as an image. In this example, the Radon transform for the square image is computed at angles from 0° to 180°, in 1° increments.

theta = 0:180;

[R,xp] = radon(I,theta); imagesc(theta,xp,R); title('R_{\theta} (X\prime)'); xlabel('\theta (degrees)'); ylabel('X\prime'); set(gca,'XTick',0:20:180); colormap(hot);

colorbar

9-24

Radon Transform

Radon Transform Using 180 Projections

Detecting Lines Using the Radon Transform

The Radon transform is closely related to a common computer vision operation known as the Hough transform. You can use the radon function to implement a form of the Hough transform used to detect straight lines. The steps are

1Compute a binary edge image using the edge function.

I = fitsread('solarspectra.fts'); I = mat2gray(I);

BW = edge(I);

imshow(I), figure, imshow(BW)

9-25

9 Transforms

2Compute the Radon transform of the edge image.

theta = 0:179;

[R,xp] = radon(BW,theta);

figure, imagesc(theta, xp, R); colormap(hot); xlabel('\theta (degrees)'); ylabel('x\prime'); title('R_{\theta} (x\prime)');

colorbar

9-26

Radon Transform

Radon Transform of an Edge Image

3Find the locations of strong peaks in the Radon transform matrix. The locations of these peaks correspond to the locations of straight lines in the original image.

In the following figure, the strongest peaks in R correspond to = 1 and

x′ = −80 . The line perpendicular to that angle and located at x′ = −80 is shown below, superimposed in red on the original image. The Radon transform geometry is shown in black. Notice that the other strong lines

parallel to the red line also appear as peaks at = 1 in the transform. Also, the lines perpendicular to this line appear as peaks at = 91 .

9-27

9 Transforms

Radon Transform Geometry and the Strongest Peak (Red)

9-28

Соседние файлы в папке 2read