Radon transform of a circle. Error in imread function
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kim Y
am 21 Mär. 2019
Beantwortet: Walter Roberson
am 21 Mär. 2019
Hi everyone,
This is my code to radon transform a circle:
A = imread('circ3.png');
theta = 0:180;
[R,xp] = radon(A,theta);
imshow(R,[],'Xdata',theta,'Ydata',xp,'InitialMagnification','fit')
xlabel('\theta (degrees)')
ylabel('x''')
colormap(gca,hot), colorbar
However I am getting this error when I run my code:
Error in radon (line 63)
validateattributes(I,{'numeric','logical'},{'2d','nonsparse'},mfilename,'I',1);
Error in Untitled9 (line 3)
[R,xp] = radon(A,theta);
The image circ3.png is saved on my PC and imshow(A) works perfectly fine. I also tried the code with A=imread('circlesbrightdark.png.') and the code runs fine. But the image circlesbrightdark.png isnt saved on my PC? So where is the code reading the image from?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 21 Mär. 2019
You cannot apply radon() to an RGB image. Look at ndims(A) to see whether it is 2 (2D) or 3 (RGB or RGBA)
Note that some RGB images look grayscale, because they happen to have equal R G and B.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!