Change exact area in binary images from 1 to 0

조회 수: 3 (최근 30일)
Eliska Paulikova
Eliska Paulikova 2022년 11월 5일
댓글: Eliska Paulikova 2022년 11월 5일
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
Eliska Paulikova
Eliska Paulikova 2022년 11월 5일
Thank you so much

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by