How to remove unwanted object?

조회 수: 3 (최근 30일)
gugu
gugu 2018년 1월 2일
댓글: Image Analyst 2018년 1월 3일
I want to remove the pointed object in my attached image. The boundary between these two objects has been split using marker-controlled watershed. I've tried to remove this object using imclearborder with connectivity 4. But, it also removes the region of interest. I also tried to label the image(bwlabel). The number of object returned is 1. I think it should be 2.
How can I remove this unnecessary object?
  댓글 수: 2
Rik
Rik 2018년 1월 2일
If you look closely, you will see a gap in the border, just to the right of your arrow.
gugu
gugu 2018년 1월 2일
Is it the cause? How can I completely split these two objects?

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

답변 (1개)

Image Analyst
Image Analyst 2018년 1월 2일
If the remaining connection gugu pointed out is touching by just a corner, rather than a full side of a pixel, then you can change the connectedness of the process from the default 8 to 4:
binaryImage = imclearborder(binaryImage, 4);
  댓글 수: 4
gugu
gugu 2018년 1월 3일
편집: Image Analyst 2018년 1월 3일
I got it. Instead of using imclearborder in binary image, I tried using it in grayscale image. Thanks you for your time.
Image Analyst
Image Analyst 2018년 1월 3일
Yeah, it might work but it's description is SO vague, "For grayscale images, imclearborder tends to reduce the overall intensity level in addition to suppressing border structures" that who knows what it is really doing? I sure don't.

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

Community Treasure Hunt

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

Start Hunting!

Translated by