Skip to content

Commit

Permalink
Updated pedestrian detector
Browse files Browse the repository at this point in the history
  • Loading branch information
ozcanovunc committed Mar 5, 2016
1 parent 1e345ad commit 8336a47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions modules/pedestrian-detector/pedestrian_detector.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "pedestrian_detector.h"

// TODO: make this static
HOGDescriptor hog_;

PedestrianDetector::PedestrianDetector()
{
static vector<float> detector = HOGDescriptor::getDefaultPeopleDetector();
Expand All @@ -21,4 +18,4 @@ vector<Rect> PedestrianDetector::GetBoundingRectangles(Mat image)
vector<Rect> bounding_rects;
hog_.detectMultiScale(image, bounding_rects, 0, Size(8, 8), Size(32, 32), 1.05, 2);
return bounding_rects;
}
}
8 changes: 5 additions & 3 deletions modules/pedestrian-detector/pedestrian_detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ class PedestrianDetector
public:
PedestrianDetector();
// Returns true if any pedestrian has been detected
static bool ContainsPedestrian(Mat image);
bool ContainsPedestrian(Mat image);
// Returns the bounding rectangles for detected pedestrians
static vector<Rect> GetBoundingRectangles(Mat image);
};
vector<Rect> GetBoundingRectangles(Mat image);

private:
HOGDescriptor hog_;
};

0 comments on commit 8336a47

Please sign in to comment.