Binary Image enclosed Area
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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 个评论
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!