Ask Your Question

Counting amount of people in HOG/HAAR detection

asked 2015-03-26 11:39:17 -0500

Phelipe gravatar image


I'm using the hog_haar_person_detect package with turtlebot and kinect for people detection, and i need to identify the number of peoples (number of detections) that the algorithm is detecting.

The main objective is to detect the medium amount of people in front of the robot and save this information in a variable (int). I'm using a classifier instead of the openni_tracker package for 2 reasons: The classifier gets the rgb image from the kinect topic and it isn't related to the max range of the sensor, the other reason is the speed, this package is faster than openni_tracker's.

I can get the people detection information from the part of the code which draws the detection rectangles on the screen, but i can't count it.

My question is: Is it possible to identify the number of people through this code? How can i do that? Is there a better/another choice to consider?

Thanks so much in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-27 13:41:38 -0500

Angus gravatar image

Hi Phelipe!

To count the number of detections from the HOG detector use:

int num_detected_persons = detected_person.size();

To count the number of detections from the HAAR detector use:

int num_detected_faces = detected_faces.size();

An alternative for the kinect which I would recommended trying out is the ground-based RGBD detection in the PCL by Matteo Munaro

edit flag offensive delete link more


Thanks, i figured that out some time after posting the question, but thank you anyway!! I'll check that ground-based out too.

Phelipe gravatar image Phelipe  ( 2015-03-27 18:59:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-03-26 11:39:17 -0500

Seen: 1,044 times

Last updated: Mar 27 '15