How to obtain centroids from cascade object detector?
Show older comments
I am having trouble determining a way to get centroids from objects detected by a trained object detector- the only output seems to be bounding boxes. Is there another way I could get the centroid coordinates for the detected HOG features?
code:
detector = vision.CascadeObjectDetector('Detector3.xml');
detector.MergeThreshold = 3;
img = imread('Test_image.jpg');
[bbox] = step(detector,img)
Accepted Answer
More Answers (1)
Dima Lisin
on 12 Jun 2015
0 votes
Hi William,
The best you can do, is to get the centroid of the box. The bounding box format is [x, y, widht, height]. So the centroid is [x+width/2, y+height/2]. or for multiple bboxes: [bbox(:,1)+bbox(:,3)/2, bbox(:,2)+bbox(:,4)/2].
Categories
Find more on Object Detection in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!