# Restricting the maximum boundary of region growing algorithm

1 回表示 (過去 30 日間)
Warid Islam 2021 年 3 月 27 日
コメント済み: Warid Islam 2021 年 3 月 28 日
Hi,
I am trying to implement a multilayer region growing algorithm for breast tumor segmentation. This is a reference of a previous question that I asked.
TM25.jpg is the original image. I want to restrict the boundary of the region growing algorithm. The boundary is defined as the rectangular region in e2.jpg. I want to manually select the seed point inside the rectangular ROI. However, after implementing the multilayer region growing algorithm , I get the result shown in e1.jpg which is not correct. Any suggestions would be appreciated.
I=rgb2gray(I);
imshow(I)
k = waitforbuttonpress;
point1 = get(gca,'CurrentPoint'); % button down detected
finalRect = rbbox; % return figure units
point2 = get(gca,'CurrentPoint'); % button up detected
point1 = point1(1,1:2); % extract x and y
point2 = point2(1,1:2);
p1 = min(point1,point2); % calculate locations
offset = abs(point1-point2); % and dimensions
x = [p1(1) p1(1)+offset(1) p1(1)+offset(1) p1(1) p1(1)];
y = [p1(2) p1(2) p1(2)+offset(2) p1(2)+offset(2) p1(2)];
hold on
axis manual
plot(x,y)
[x,y]=getpts;x=round(x);y=round(y);
a=imgaussfilt(I,2);
m=regiongrowing_MLT(b,x,y,12);
m=imfill(m,'holes');
figure,imshow(m)

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

### 採用された回答

Image Analyst 2021 年 3 月 27 日
You can call regionprops() on the regions and ask it for the perimeter. Take appropriate action if the perimeter is more than you like
allPerimeters = [props.Perimeter];
if any(allPerimeters) > maxAllowablePerimeter
% Do something...
end
##### 7 件のコメント5 件の古いコメントを表示5 件の古いコメントを非表示
Image Analyst 2021 年 3 月 28 日
You don't apply it to a screenshot of your gray scale image. Why is there that huge white surround around it anyway?
You need to apply regionprops() to your SEGMENTED image. So you need to find blobs of interest somehow and apply it to that binary image, not the grayscale image or screenshot image.
Warid Islam 2021 年 3 月 28 日
That helps a lot. Thank you.

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

### カテゴリ

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

R2020b

### Community Treasure Hunt

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

Start Hunting!

Translated by