Cascade classifier class used for object detection. Supports HAAR and LBP cascades. :
More...
#include <opencv2/cudaobjdetect.hpp>
Cascade classifier class used for object detection. Supports HAAR and LBP cascades. :
- Note
- A cascade classifier example can be found at xobjdetect_module/samples/gpu/cascadeclassifier.cpp
- A Nvidea API specific cascade classifier example can be found at opencv_source_code/samples/gpu/cascadeclassifier_nvidia_api.cpp
◆ convert()
virtual void cv::cuda::CascadeClassifier::convert |
( |
OutputArray |
gpu_objects, |
|
|
std::vector< Rect > & |
objects |
|
) |
| |
|
pure virtual |
Converts objects array from internal representation to standard vector.
- Parameters
-
gpu_objects | Objects array in internal representation. |
objects | Resulting array. |
◆ create() [1/2]
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
◆ create() [2/2]
Loads the classifier from a file. Cascade type is detected automatically by constructor parameter.
- Parameters
-
filename | Name of the file from which the classifier is loaded. Only the old haar classifier (trained by the haar training application) and NVIDIA's nvbin are supported for HAAR and only new type of OpenCV XML cascade supported for LBP. The working haar models can be found at opencv_folder/data/haarcascades_cuda/ |
◆ detectMultiScale()
Detects objects of different sizes in the input image.
- Parameters
-
image | Matrix of type CV_8U containing an image where objects should be detected. |
objects | Buffer to store detected objects (rectangles). |
stream | CUDA stream. |
To get final array of detected objects use CascadeClassifier::convert method.
cascade_gpu->
convert(objbuf, faces);
for(int i = 0; i < detections_num; ++i)
n-dimensional dense array class
Definition mat.hpp:950
Template class for 2D rectangles.
Definition types.hpp:447
virtual void detectMultiScale(InputArray image, OutputArray objects, Stream &stream=Stream::Null())=0
Detects objects of different sizes in the input image.
static Ptr< cuda::CascadeClassifier > create(const String &filename)
Loads the classifier from a file. Cascade type is detected automatically by constructor parameter.
virtual void convert(OutputArray gpu_objects, std::vector< Rect > &objects)=0
Converts objects array from internal representation to standard vector.
Base storage class for GPU memory with reference counting.
Definition cuda.hpp:106
std::shared_ptr< _Tp > Ptr
Definition cvstd_wrapper.hpp:23
void imshow(const String &winname, InputArray mat)
Displays an image in the specified window.
CV_EXPORTS_W Mat imread(const String &filename, int flags=IMREAD_COLOR_BGR)
Loads an image from a file.
void rectangle(InputOutputArray img, Point pt1, Point pt2, const Scalar &color, int thickness=1, int lineType=LINE_8, int shift=0)
Draws a simple, thick, or filled up-right rectangle.
- See also
- CascadeClassifier::detectMultiScale
◆ getClassifierSize()
virtual Size cv::cuda::CascadeClassifier::getClassifierSize |
( |
| ) |
const |
|
pure virtual |
◆ getFindLargestObject()
virtual bool cv::cuda::CascadeClassifier::getFindLargestObject |
( |
| ) |
|
|
pure virtual |
◆ getMaxNumObjects()
virtual int cv::cuda::CascadeClassifier::getMaxNumObjects |
( |
| ) |
const |
|
pure virtual |
◆ getMaxObjectSize()
virtual Size cv::cuda::CascadeClassifier::getMaxObjectSize |
( |
| ) |
const |
|
pure virtual |
◆ getMinNeighbors()
virtual int cv::cuda::CascadeClassifier::getMinNeighbors |
( |
| ) |
const |
|
pure virtual |
◆ getMinObjectSize()
virtual Size cv::cuda::CascadeClassifier::getMinObjectSize |
( |
| ) |
const |
|
pure virtual |
◆ getScaleFactor()
virtual double cv::cuda::CascadeClassifier::getScaleFactor |
( |
| ) |
const |
|
pure virtual |
◆ setFindLargestObject()
virtual void cv::cuda::CascadeClassifier::setFindLargestObject |
( |
bool |
findLargestObject | ) |
|
|
pure virtual |
◆ setMaxNumObjects()
virtual void cv::cuda::CascadeClassifier::setMaxNumObjects |
( |
int |
maxNumObjects | ) |
|
|
pure virtual |
◆ setMaxObjectSize()
virtual void cv::cuda::CascadeClassifier::setMaxObjectSize |
( |
Size |
maxObjectSize | ) |
|
|
pure virtual |
Maximum possible object size. Objects larger than that are ignored. Used for second signature and supported only for LBP cascades.
◆ setMinNeighbors()
virtual void cv::cuda::CascadeClassifier::setMinNeighbors |
( |
int |
minNeighbors | ) |
|
|
pure virtual |
Parameter specifying how many neighbors each candidate rectangle should have to retain it.
◆ setMinObjectSize()
virtual void cv::cuda::CascadeClassifier::setMinObjectSize |
( |
Size |
minSize | ) |
|
|
pure virtual |
Minimum possible object size. Objects smaller than that are ignored.
◆ setScaleFactor()
virtual void cv::cuda::CascadeClassifier::setScaleFactor |
( |
double |
scaleFactor | ) |
|
|
pure virtual |
Parameter specifying how much the image size is reduced at each image scale.
The documentation for this class was generated from the following file: