Unable to select seed points manually in region growing algorithm
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I am trying to implement a multilayer region growing algorithm for breast tumor segmentation. I am trying to select the initial seed point manually. I left clicked on the center point on the image once and pressed enter, but it is showing me an error message. Any suggestions would be appreciated.
I= rgb2gray((imread('TM25.jpg')));
figure,imshow(I)
[x,y]=getpts;
% x=300; y=340;
a=imgaussfilt(I,2);
b=adapthisteq(a);
m=regiongrowing_MLT(b,x,y,12);
m=imfill(m,'holes');
figure,imshow(m)
The following error message is displayed.
Index in position 2 is invalid. Array indices must be positive integers or logical values.
Error in regiongrowing_MLT (line 6)
A1 = double(img(x,y));
Error in segm (line 8)
m=regiongrowing_MLT(b,x,y,12);
0 件のコメント
採用された回答
Rik
2021 年 3 月 24 日
編集済み: Rik
2021 年 3 月 24 日
getpts will return decimal values, so you will have to use round.
I= rgb2gray((imread('TM25.jpg')));
figure,imshow(I)
[x,y]=getpts;x=round(x);y=round(y);
% x=300; y=340;
a=imgaussfilt(I,2);
b=adapthisteq(a);
m=regiongrowing_MLT(b,x,y,12);
m=imfill(m,'holes');
figure,imshow(m)
Also, you might be interested in RegGrow, which doesn't require any toolbox and produces the same result on a wide range of runtimes (it works GNU Octave, and every release of Matlab of the past 2 decades).
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!