How to fit rectangles on blobs on binary image

조회 수: 12 (최근 30일)
Peter Vala
Peter Vala 2021년 1월 7일
답변: Image Analyst 2021년 1월 7일
I have this binary image:
I need to find 2 rectangles that fit around the two blobs as best as possible. What's the best method to apply?
Thanks for any help!

채택된 답변

Image Analyst
Image Analyst 2021년 1월 7일
John D'Errico's function will give you the minimal bounding rectangle, even if it would be tilted:
regionprops() will only give you bounding boxes that are aligned with the edges of the image.

추가 답변 (1개)

Matt J
Matt J 2021년 1월 7일
regionprops(BW, 'BoundingBox')

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by