Binary Image enclosed Area

2 ビュー (過去 30 日間)
Ian Hersom
Ian Hersom 2016 年 8 月 1 日
編集済み: Image Analyst 2016 年 8 月 1 日
I am attempting to search within the boundaries of the ones in the attached binary image. I need to somehow find all the indices of the enclosed area in the binary image so I can search in the actual RGB image itself. I've tried using "edges" "boundary" etc. To clarify, I'm looking to use the information inside of the edges of the boundary.

回答 (1 件)

Image Analyst
Image Analyst 2016 年 8 月 1 日
Just use find():
[rows, columns] = find(binaryImage);
rows and columns will be vectors of the rows and columns (matched up) of every single white pixel in your binary image.
Other than that I'm not sure what you want because of the two situations you stated: one where you said you want the boundaries (perimeters) and the other where you said you wanted the enclosed coordinates. Is it one or the other or both?
I'm also unsure exactly what "search within" and "search in" means. Search for what?
You have hundreds of blobs there. If you just want the pixels inside each blob, but not on the boundary itself, then call imerode() to eat away one layer of pixels from all blobs. What's left will be just the "inside".
  2 件のコメント
Ian Hersom
Ian Hersom 2016 年 8 月 1 日
Let me clarify. I want to find the boundaries, so that I can use the enclosed area.
Image Analyst
Image Analyst 2016 年 8 月 1 日
編集済み: Image Analyst 2016 年 8 月 1 日
That's not clarified. What does "use" or "search in" mean? If you just want the boundaries, you can use bwboundaries(). But since you haven't said the boundaries of what - each blob or the cluster of blobs - you might need activecontour(). A demo is attached.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by