How to return the height of a bounding box

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

 채택된 답변

Sean de Wolski
Sean de Wolski 2013년 2월 27일

0 개 추천

Use regionprops, with the 'BoundingBox' option. The height is the the "width" of the first dimension (rows).
doc regionprops

댓글 수: 2

Jack Sparrow
Jack Sparrow 2013년 3월 5일
Thanks sean, but I dont understand. the bbox return a 4x360 matrix. I can I know the width.
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by