Distance between bounding corners

11 visualizzazioni (ultimi 30 giorni)
r_com3
r_com3 il 17 Dic 2019
Commentato: Adam Danz il 22 Dic 2019
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:
im.jpg
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 :)
im2.jpg

Risposte (1)

Adam Danz
Adam Danz il 17 Dic 2019
Modificato: Adam Danz il 17 Dic 2019
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 Commenti
Image Analyst
Image Analyst il 21 Dic 2019
Which bounding box do you mean? Like:
  1. one from regionprops(), or
  2. the tilted one you got somehow, or
  3. 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."
screenshot.jpg
Adam Danz
Adam Danz il 22 Dic 2019
@r_com3, In which thread are you continuing this conversaion? This one or the other one?

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by