Unable to draw just the boundary of an image

1 ビュー (過去 30 日間)
Warid Islam
Warid Islam 2021 年 7 月 19 日
コメント済み: Warid Islam 2021 年 7 月 19 日
Hi,
I want to draw just the boundary of a ROI. segFP1.jpg is the original image. I applied the code below but I don't get the desired result. My result is displayed in e1.jpg. Any suggestions would be appreciated. Thank you.
I=imread('segFP1.jpg');
figure,imshow(I)
I1=bwperim(I,8);
figure,imshow(I1)

採用された回答

DGM
DGM 2021 年 7 月 19 日
編集済み: DGM 2021 年 7 月 19 日
Well, you're loading a grayscale image subject to destructive compression as a jpg file. At no point do you explicitly threshold the image, so it's probably just getting thresholded at I>0, and so a bunch of compression artifacts are part of the binarized image.
I=imread('segFP1.jpg'); % this is not a binary image
I = I>128; % threshold it somewhere
I1=bwperim(I,8); % otherwise this will
subplot(2,1,1)
imshow(I)
subplot(2,1,2)
imshow(I1)
  3 件のコメント
Warid Islam
Warid Islam 2021 年 7 月 19 日
Hi @DGM,
That worked perfectly. Thanks a lot.

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

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by