Error using radon Expected input number 1, I, to be two-dimensional.

my code is
ImageFile = imread('ct_brain2.jpg');
fotob = ImageFile; %the class is uint8
proy = 100;
cacah = 180/proy;
theta = 0:cacah:180-cacah;
[R,xp] = radon(fotob,theta);
citra = iradon(R,cacah);
imshow(citra)
I am getting an error as,
Error using radon
Expected input number 1, I, to be
two-dimensional.
Error in radon (line 63)
validateattributes(I,{'numeric','logical'},{'2d','nonsparse'},mfilename,'I',1);
Error in CT_test (line 57)
[R,xp] = radon(fotob,theta);

 採用された回答

Rik
Rik 2019 年 11 月 25 日

0 投票

Your jpg file is probably an RGB image (even if it doesn't look like a color image). That makes it a 3D array. You need to determine a way to reduce it to 1 color channel. In general for grayscale images you can simply select the first color channel.

3 件のコメント

Fariz
Fariz 2019 年 11 月 25 日
can you show me the code to reduce it to 1 color channel?
Rik
Rik 2019 年 11 月 25 日
This is likely what you need:
ImageFile=ImageFile(:,:,1);
You can verify this is what you need with imshow.
Fariz
Fariz 2019 年 11 月 25 日
ok thank you

サインインしてコメントする。

その他の回答 (0 件)

製品

リリース

R2016a

タグ

質問済み:

2019 年 11 月 25 日

コメント済み:

2019 年 11 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by