The class implements Histogram of Oriented Gradients ([17]) object detector. More...
#include "cudaobjdetect.hpp"
Public Types | |
enum | { DESCR_FORMAT_ROW_BY_ROW, DESCR_FORMAT_COL_BY_COL } |
Public Member Functions | |
virtual void | clear () |
Clears the algorithm state. More... | |
virtual void | compute (InputArray img, OutputArray descriptors, Stream &stream=Stream::Null())=0 |
Returns block descriptors computed for the whole image. More... | |
virtual void | detect (InputArray img, std::vector< Point > &found_locations, std::vector< double > *confidences=NULL)=0 |
Performs object detection without a multi-scale window. More... | |
virtual void | detectMultiScale (InputArray img, std::vector< Rect > &found_locations, std::vector< double > *confidences=NULL)=0 |
Performs object detection with a multi-scale window. More... | |
virtual bool | empty () const |
Returns true if the Algorithm is empty (e.g. More... | |
virtual size_t | getBlockHistogramSize () const =0 |
Returns the block histogram size. More... | |
virtual String | getDefaultName () const |
Returns the algorithm string identifier. More... | |
virtual Mat | getDefaultPeopleDetector () const =0 |
Returns coefficients of the classifier trained for people detection. More... | |
virtual int | getDescriptorFormat () const =0 |
virtual size_t | getDescriptorSize () const =0 |
Returns the number of coefficients required for the classification. More... | |
virtual bool | getGammaCorrection () const =0 |
virtual int | getGroupThreshold () const =0 |
virtual double | getHitThreshold () const =0 |
virtual double | getL2HysThreshold () const =0 |
virtual int | getNumLevels () const =0 |
virtual double | getScaleFactor () const =0 |
virtual double | getWinSigma () const =0 |
virtual Size | getWinStride () const =0 |
virtual void | read (const FileNode &fn) |
Reads algorithm parameters from a file storage. More... | |
virtual void | save (const String &filename) const |
Saves the algorithm to a file. More... | |
virtual void | setDescriptorFormat (int descr_format)=0 |
Descriptor storage format: More... | |
virtual void | setGammaCorrection (bool gamma_correction)=0 |
Flag to specify whether the gamma correction preprocessing is required or not. More... | |
virtual void | setGroupThreshold (int group_threshold)=0 |
Coefficient to regulate the similarity threshold. More... | |
virtual void | setHitThreshold (double hit_threshold)=0 |
Threshold for the distance between features and SVM classifying plane. More... | |
virtual void | setL2HysThreshold (double threshold_L2hys)=0 |
L2-Hys normalization method shrinkage. More... | |
virtual void | setNumLevels (int nlevels)=0 |
Maximum number of detection window increases. More... | |
virtual void | setScaleFactor (double scale0)=0 |
Coefficient of the detection window increase. More... | |
virtual void | setSVMDetector (InputArray detector)=0 |
Sets coefficients for the linear SVM classifier. More... | |
virtual void | setWinSigma (double win_sigma)=0 |
Gaussian smoothing window parameter. More... | |
virtual void | setWinStride (Size win_stride)=0 |
Window stride. It must be a multiple of block stride. More... | |
virtual void | write (FileStorage &fs) const |
Stores algorithm parameters in a file storage. More... | |
Static Public Member Functions | |
static Ptr< HOG > | create (Size win_size=Size(64, 128), Size block_size=Size(16, 16), Size block_stride=Size(8, 8), Size cell_size=Size(8, 8), int nbins=9) |
Creates the HOG descriptor and detector. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | load (const String &filename, const String &objname=String()) |
Loads algorithm from the file. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | loadFromString (const String &strModel, const String &objname=String()) |
Loads algorithm from a String. More... | |
template<typename _Tp > | |
static Ptr< _Tp > | read (const FileNode &fn) |
Reads algorithm from the file node. More... | |
Protected Member Functions | |
void | writeFormat (FileStorage &fs) const |
The class implements Histogram of Oriented Gradients ([17]) object detector.
|
inlinevirtualinherited |
Clears the algorithm state.
Reimplemented in cv::FlannBasedMatcher, cv::DescriptorMatcher, and cv::cuda::DescriptorMatcher.
|
pure virtual |
Returns block descriptors computed for the whole image.
img | Source image. See cuda::HOGDescriptor::detect for type limitations. |
descriptors | 2D array of descriptors. |
stream | CUDA stream. |
|
static |
Creates the HOG descriptor and detector.
win_size | Detection window size. Align to block size and block stride. |
block_size | Block size in pixels. Align to cell size. Only (16,16) is supported for now. |
block_stride | Block stride. It must be a multiple of cell size. |
cell_size | Cell size. Only (8, 8) is supported for now. |
nbins | Number of bins. Only 9 bins per cell are supported for now. |
|
pure virtual |
Performs object detection without a multi-scale window.
img | Source image. CV_8UC1 and CV_8UC4 types are supported for now. |
found_locations | Left-top corner points of detected objects boundaries. |
confidences | Optional output array for confidences. |
|
pure virtual |
Performs object detection with a multi-scale window.
img | Source image. See cuda::HOGDescriptor::detect for type limitations. |
found_locations | Detected objects boundaries. |
confidences | Optional output array for confidences. |
|
inlinevirtualinherited |
Returns true if the Algorithm is empty (e.g.
in the very beginning or after unsuccessful read
Reimplemented in cv::DescriptorMatcher, cv::ml::StatModel, cv::Feature2D, cv::BaseCascadeClassifier, and cv::cuda::DescriptorMatcher.
|
pure virtual |
Returns the block histogram size.
|
virtualinherited |
Returns the algorithm string identifier.
This string is used as top level xml/yml node tag when the object is saved to a file or string.
|
pure virtual |
Returns coefficients of the classifier trained for people detection.
|
pure virtual |
|
pure virtual |
Returns the number of coefficients required for the classification.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
inlinestaticinherited |
Loads algorithm from the file.
filename | Name of the file to read. |
objname | The optional name of the node to read (if empty, the first top-level node will be used) |
This is static template method of Algorithm. It's usage is following (in the case of SVM):
In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn).
References cv::Ptr< T >::empty(), cv::FileNode::empty(), cv::FileStorage::getFirstTopLevelNode(), and cv::FileStorage::READ.
|
inlinestaticinherited |
Loads algorithm from a String.
strModel | The string variable containing the model you want to load. |
objname | The optional name of the node to read (if empty, the first top-level node will be used) |
This is static template method of Algorithm. It's usage is following (in the case of SVM):
References CV_WRAP, cv::Ptr< T >::empty(), cv::FileNode::empty(), cv::FileStorage::getFirstTopLevelNode(), cv::FileStorage::MEMORY, and cv::FileStorage::READ.
|
inlinevirtualinherited |
Reads algorithm parameters from a file storage.
Reimplemented in cv::FlannBasedMatcher, cv::DescriptorMatcher, and cv::Feature2D.
|
inlinestaticinherited |
Reads algorithm from the file node.
This is static template method of Algorithm. It's usage is following (in the case of SVM):
In order to make this method work, the derived class must overwrite Algorithm::read(const FileNode& fn) and also have static create() method without parameters (or with all the optional parameters)
References cv::Ptr< T >::empty().
|
virtualinherited |
Saves the algorithm to a file.
In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
|
pure virtual |
Descriptor storage format:
|
pure virtual |
Flag to specify whether the gamma correction preprocessing is required or not.
|
pure virtual |
Coefficient to regulate the similarity threshold.
When detected, some objects can be covered by many rectangles. 0 means not to perform grouping. See groupRectangles.
|
pure virtual |
Threshold for the distance between features and SVM classifying plane.
Usually it is 0 and should be specfied in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
|
pure virtual |
L2-Hys normalization method shrinkage.
|
pure virtual |
Maximum number of detection window increases.
|
pure virtual |
Coefficient of the detection window increase.
|
pure virtual |
Sets coefficients for the linear SVM classifier.
|
pure virtual |
Gaussian smoothing window parameter.
|
pure virtual |
Window stride. It must be a multiple of block stride.
|
inlinevirtualinherited |
Stores algorithm parameters in a file storage.
Reimplemented in cv::FlannBasedMatcher, cv::DescriptorMatcher, and cv::Feature2D.
|
protectedinherited |