Radon transform of a circle. Error in imread function

3 visualizaciones (últimos 30 días)
Kim Y
Kim Y el 21 de Mzo. de 2019
Respondida: Walter Roberson el 21 de Mzo. de 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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Mzo. de 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.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by