Isolate a large black island from a similarly colored border

조회 수: 2 (최근 30일)
Cyrus N
Cyrus N 2017년 7월 11일
답변: Image Analyst 2017년 7월 11일
What kind of command will let me extract a large black island in the center of the image from its surroundings. Surrounding the large black island is a thick white band ( which I want to keep) and surrounding that is a thick black band (same color as the island that i want to extract). How do I get rid of the outer black band.

답변 (1개)

Image Analyst
Image Analyst 2017년 7월 11일
Gosh, an image would have been so instructive. Since you forgot to post it, I can only imagine. Basically to turn the outermost black boundary white, I'd invert the image (so now it's white that touches the edge of the image, not black), then get rid of white blobs touching the edge of the image, then invert again to make your black band black again.
binaryImage = ~imclearborder(~binaryImage);
If that doesn't work, then attach your image.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by