How to remove unwanted object?
1 次查看(过去 30 天)
显示 更早的评论
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?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168377/image.png)
2 个评论
Rik
2018-1-2
If you look closely, you will see a gap in the border, just to the right of your arrow.
回答(1 个)
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 个评论
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!