Unable to select seed points manually in region growing algorithm

1 回表示 (過去 30 日間)
Warid Islam
Warid Islam 2021 年 3 月 24 日
コメント済み: Warid Islam 2021 年 3 月 24 日
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);

採用された回答

Rik
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).
  1 件のコメント
Warid Islam
Warid Islam 2021 年 3 月 24 日
Hi Rik,
Thank you very much for the help. It works.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by