How to return the height of a bounding box
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Sean de Wolski
2013-2-27
Use regionprops, with the 'BoundingBox' option. The height is the the "width" of the first dimension (rows).
doc regionprops
2 个评论
Sean de Wolski
2013-3-5
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 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!