How the "radon" transform works in matlab????

9 views (last 30 days)
I need to find the thickness of a segmented object that is in binary image. So i am trying to use 'radon' transform to find the intensity values with the value as "1" (white color) along the specified orientation. In this way i can find thickness at specified locations as i want. Before using this function 'radon' i want to understand how it works. But i am not able to understand how radon works. As an example i took one simple image and coded as follows.
I = zeros(100,100);
I(1:25,1:25) = 1;
figure;imshow(I)
[R,xp] = radon(I, 90);
figure;plot(R)
I plotted R and checked for theta = 90,0. The plot shows impulse wave for both and there is a shift for theta = 0. The size® = 145. How does R takes 145, when the size of image is only 100? How could even for theta = 0, R gives some intensity values?? Can anyone give me a clear understanding on this radon??

Accepted Answer

Matt J
Matt J on 6 May 2013
Edited: Matt J on 6 May 2013
How does R takes 145, when the size of image is only 100?
RADON is choosing a grid size for R that will capture the projections of the entire 100x100 grid at all angles theta. At theta=45, the length of the grid's projection shadow is sqrt(2)*100 and so something like R=145 is required to cover it.
How could even for theta = 0, R gives some intensity values??
You have to explain why you don't think R should have intensity values. Your 25x25 square is viewable at all angles, theta.
  12 Comments
Matt J
Matt J on 7 May 2013
Edited: Matt J on 7 May 2013
Well, I don't know what you're seeing and how it compares with what you expect to see. It sounds like you want R to give you the cross-sectional lengths of an object at different angles and the code you posted confirms that that is the case. When I run the code, R shows a peak value of 25 at theta=0, which is fine because lines parallel to the sides of the square cut through the square with length 25. At theta=45, I see a peak of about 35 which is the diagonal length of a square whose sides are length 25. So, your examples all seem to support that RADON is doing what you want it to do.
Divya
Divya on 8 May 2013
Yeah Matt, I got that R(ceil(size(R,1)/2),:) can be taken as the thickness as it gives the line integral covering complete pixel but not sub pixel values. Thank you for clearing my doubts

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!