Distance between bounding corners

11 visualizaciones (últimos 30 días)
r_com3
r_com3 el 17 de Dic. de 2019
Comentada: Adam Danz el 22 de Dic. de 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

Respuestas (1)

Adam Danz
Adam Danz el 17 de Dic. de 2019
Editada: Adam Danz el 17 de Dic. de 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 comentarios
Image Analyst
Image Analyst el 21 de Dic. de 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 el 22 de Dic. de 2019
@r_com3, In which thread are you continuing this conversaion? This one or the other one?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by