Distance between bounding corners
19 次查看(过去 30 天)
显示 更早的评论
Hello, i am struggling with task of finding the distance between corners of bounding boxes of objects.
My image with bounding box around the objetcs looks like this:
The oriented bounding box is taken from the algorythm in this link :
My task is to find the green and blue distances on the image.
Anyone has idea how to perform it ?
Thanks in advance :)
0 个评论
回答(1 个)
Adam Danz
2019-12-17
编辑:Adam Danz
2019-12-17
You could probably achieve the same results using regionprops from the Image Processing Toolbox (see BoundingBox property). In either case, you need to get the coordinates of the rectangle from the function output. Then you can use the pythagorean distance formula [video][literature] or Matlab's, pdist2() to compute the distance between the corners of each bounding box. It's probably easiest just to compute the distance between all 4 corners of box N and box N+1 and then the two closest corners are the ones you're interested in.
If you get stuck, show us how far you got and we can help out with the next steps.
7 个评论
Image Analyst
2019-12-21
Which bounding box do you mean? Like:
- one from regionprops(), or
- the tilted one you got somehow, or
- the corners of the entire image?
You might also be interested in simply Using John D'Errico's bounding rectangle app: A suite of minimal bounding objects. It's a "Suite of tools to compute minimal bounding circles, rectangles, triangles, spheres, incircles, etc."
Adam Danz
2019-12-22
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Segmentation and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!