Borrar filtros
Borrar filtros

How to return the height of a bounding box

1 visualización (últimos 30 días)
Jack Sparrow
Jack Sparrow el 27 de Feb. de 2013
How can I return the height of a bounding box of an object to the work space from an object detection algorithm like Gaussian Mixture Model in matlab

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 27 de Feb. de 2013
Use regionprops, with the 'BoundingBox' option. The height is the the "width" of the first dimension (rows).
doc regionprops
  2 comentarios
Jack Sparrow
Jack Sparrow el 5 de Mzo. de 2013
Thanks sean, but I dont understand. the bbox return a 4x360 matrix. I can I know the width.
Sean de Wolski
Sean de Wolski el 5 de Mzo. de 2013
That's what you want:
x = imread('coins.png')>100;
bb = regionprops(x,'BoundingBox')
bbMatrix = vertcat(bb(:).BoundingBox)
Now the third column is the height and the fourth is the width:
bbMatrix(:,3);%height

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by