Change exact area in binary images from 1 to 0

1 次查看(过去 30 天)
Hello, I have this binary image, I know the center and the radius of that circle, and I would like to change this circle to black so from 1 to 0. My goal is to see only the little line without the circle. How can I do it?
Thank you so much

采纳的回答

Matt J
Matt J 2022-11-5
load BW
hole = bwareafilt(~BW,1,'smallest') ;
BW=BW& ~imdilate(hole,strel('disk',5));
imshow(BW)
  3 个评论
Matt J
Matt J 2022-11-5
编辑:Matt J 2022-11-5
You're welcome, but please Accept-click the answer if it addresses your question.
The ~ operator is logical complement,
~0,
ans = logical
1
~1
ans = logical
0

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by