Open Detection
1.0
|
A linear classifier for HOG features. More...
#include <ODHOGDetector.h>
Public Member Functions | |
OD_DEFINE_ENUM_WITH_STRING_CONVERSIONS (SVMType,(OD_CUSTOM)(OD_DEFAULT_PEOPLE)(OD_DAIMLER_PEOPLE)(OD_FILE)) ODHOGDetector(std | |
void | init () |
void | load (std::string filename) |
void | setSVMFromFile (std::string fileName) |
void | setSVMDetector (std::vector< float > svmdetector) |
ODDetections2D * | detectOmni (ODSceneImage *scene) |
Function for performing detection on an entire scene. More... | |
ODDetections * | detect (ODSceneImage *scene) |
Function for performing detection on a segmented scene. More... | |
int | detect (ODScene *scene, std::vector< ODDetection * > &detections) |
void | setTrainedDataLocation (std::string trained_data_location_) |
The base directory for trained data. More... | |
SVMType const & | getSvmtype () const |
void | setSvmtype (SVMType const &svmtype_) |
cv::Size const & | getWinSize () const |
void | setWinSize (cv::Size const &winSize) |
cv::Size const & | getBlockSize () const |
void | setBlockSize (cv::Size const &blockSize) |
cv::Size const & | getBlockStride () const |
void | setBlockStride (cv::Size const &blockStride) |
cv::Size const & | getCellSize () const |
void | setCellSize (cv::Size const &cellSize) |
float | getHitThreshold () const |
void | setHitThreshold (float hitThreshold) |
void | printParameters () |
![]() | |
ODDetector2D (std::string const &trained_data_location_) | |
ODDetections * | detect (ODScene *scene) |
![]() | |
ODDetector (std::string const &training_data_location_) | |
virtual ODDetections * | detectOmni (ODScene *scene) |
![]() | |
ODDetectorCommon (std::string const &trained_data_location_="") | |
std::string | getTrainingInputLocation () const |
Gets/Sets the directory containing the data for training. More... | |
void | setTrainingInputLocation (std::string training_input_location_) |
Gets/Sets the directory containing the data for training. More... | |
std::string | getTrainedDataLocation () const |
Gets/Sets the base directory for trained data. More... | |
std::string | getSpecificTrainingDataLocation () |
Gets the specific directory for a Trainer or a Detector inside trained_data_location_. More... | |
std::string | getSpecificTrainingData () |
std::string const & | getTrainedDataID () const |
void | setTrainedDataID (std::string const &trainedDataID) |
Protected Attributes | |
cv::Size | winSize |
cv::Size | blockSize |
cv::Size | blockStride |
cv::Size | cellSize |
float | hitThreshold |
cv::HOGDescriptor | hog_ |
SVMType | svmtype_ |
![]() | |
std::string | training_input_location_ |
std::string | trained_data_location_ |
std::string | TRAINED_DATA_ID_ |
std::string | TRAINED_LOCATION_DENTIFIER_ |
Additional Inherited Members | |
![]() | |
bool | metainfo_ |
A linear classifier for HOG features.
This class takes an image as an input, finds its HOG features using the parameters containing in the trained data, runs the linear classifier (present in the trained data) on the computed HOG features and finally produces the classification output. Covers both multiscale detection (detectOmni()) and detection on a fixed scene (detect() - the scene is resized to the HOG window size).
Use ODHOGTrainer for the training of new objects. By default this class provides two people detector: OD_DEFAULT_PEOPLE, the people detector from OpenCV and OD_DAIMLER_PEOPLE, the second detector available from OpenCV. One can set any linear classifier, the linear weight vector through setSVMDetector() function but it is highly not recommended as the HOG parameters and the weight vector can be out of sync. One must set appropriate HOG parameters after using setSVMDetector() function with which the weight vector was trained.
Definition at line 60 of file ODHOGDetector.h.
|
virtual |
Function for performing detection on a segmented scene.
The purpose of this function is to perform detection on a segmented scene or an 'object candidate'. i.e. the entire scene is considered as an 'object' or an detection. It is possible for a scene to trigger multiple detections.
[in] | scene | An instance of 2D scene |
Implements od::ODDetector2D.
|
inline |
Definition at line 95 of file ODHOGDetector.h.
|
virtual |
Function for performing detection on an entire scene.
The purpose of this function is to detect an object in an entire scene. Thus, other than the type of detection we also have information about the location of the detection w.r.t. the scene.
[in] | scene | An instance of 2D scene |
Implements od::ODDetector2D.
|
inline |
Definition at line 125 of file ODHOGDetector.h.
References blockSize.
|
inline |
Definition at line 135 of file ODHOGDetector.h.
References blockStride.
|
inline |
Definition at line 145 of file ODHOGDetector.h.
References cellSize.
|
inline |
Definition at line 155 of file ODHOGDetector.h.
References hitThreshold.
|
inline |
Definition at line 105 of file ODHOGDetector.h.
References svmtype_.
|
inline |
Definition at line 115 of file ODHOGDetector.h.
References winSize.
|
virtual |
Implements od::ODDetectorCommon.
void od::g2d::ODHOGDetector::load | ( | std::string | filename | ) |
|
inline |
Definition at line 64 of file ODHOGDetector.h.
References od::ODDetector::metainfo_, svmtype_, od::ODDetectorCommon::TRAINED_DATA_ID_, and od::ODDetectorCommon::TRAINED_LOCATION_DENTIFIER_.
void od::g2d::ODHOGDetector::printParameters | ( | ) |
|
inline |
Definition at line 130 of file ODHOGDetector.h.
References blockSize.
|
inline |
Definition at line 140 of file ODHOGDetector.h.
References blockStride.
|
inline |
Definition at line 150 of file ODHOGDetector.h.
References cellSize.
|
inline |
Definition at line 160 of file ODHOGDetector.h.
References hitThreshold.
|
inline |
Definition at line 87 of file ODHOGDetector.h.
References hog_.
void od::g2d::ODHOGDetector::setSVMFromFile | ( | std::string | fileName | ) |
|
inline |
Definition at line 110 of file ODHOGDetector.h.
References svmtype_.
|
inlinevirtual |
The base directory for trained data.
This should be same for all Trainers and Detectors and can be considered as the 'database' of trained data. Trainers uses one of its subdirectories based on its type to store algo specific trained data. The corresponding Detector would use the same directory to fetch the trained data for online detection.
Reimplemented from od::ODDetectorCommon.
Definition at line 99 of file ODHOGDetector.h.
References svmtype_, and od::ODDetectorCommon::trained_data_location_.
|
inline |
Definition at line 120 of file ODHOGDetector.h.
References winSize.
|
protected |
Definition at line 170 of file ODHOGDetector.h.
Referenced by getBlockSize(), and setBlockSize().
|
protected |
Definition at line 171 of file ODHOGDetector.h.
Referenced by getBlockStride(), and setBlockStride().
|
protected |
Definition at line 172 of file ODHOGDetector.h.
Referenced by getCellSize(), and setCellSize().
|
protected |
Definition at line 174 of file ODHOGDetector.h.
Referenced by getHitThreshold(), and setHitThreshold().
|
protected |
Definition at line 176 of file ODHOGDetector.h.
Referenced by setSVMDetector().
|
protected |
Definition at line 177 of file ODHOGDetector.h.
Referenced by getSvmtype(), OD_DEFINE_ENUM_WITH_STRING_CONVERSIONS(), setSvmtype(), and setTrainedDataLocation().
|
protected |
Definition at line 169 of file ODHOGDetector.h.
Referenced by getWinSize(), and setWinSize().