Change exact area in binary images from 1 to 0

1 Ansicht (letzte 30 Tage)
Eliska Paulikova
Eliska Paulikova am 5 Nov. 2022
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

Akzeptierte Antwort

Matt J
Matt J am 5 Nov. 2022
load BW
hole = bwareafilt(~BW,1,'smallest') ;
BW=BW& ~imdilate(hole,strel('disk',5));
imshow(BW)
  3 Kommentare
Matt J
Matt J am 5 Nov. 2022
Bearbeitet: Matt J am 5 Nov. 2022
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
Eliska Paulikova
Eliska Paulikova am 5 Nov. 2022
Thank you so much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by