ocl::OclCascadeClassifier : public CascadeClassifier¶Cascade classifier class used for object detection. Supports HAAR cascade classifier in the form of cross link
class CV_EXPORTS OclCascadeClassifier : public CascadeClassifier
{
public:
OclCascadeClassifier(){};
~OclCascadeClassifier(){};
CvSeq* oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,
int minNeighbors, int flags, CvSize minSize = cvSize(0, 0),
CvSize maxSize = cvSize(0, 0));
};
Note
(Ocl) A face detection example using cascade classifiers can be found at opencv_source_code/samples/ocl/facedetect.cpp
Detects objects of different sizes in the input image.
CvSeq* ocl::OclCascadeClassifier::oclHaarDetectObjects(oclMat& gimg, CvMemStorage* storage, double scaleFactor, int minNeighbors, int flags, CvSize minSize=cvSize(0, 0), CvSize maxSize=cvSize(0, 0))¶| Parameters: |
|
|---|
The function provides a very similar interface with that in CascadeClassifier class, except using oclMat as input image.
ocl::MatchTemplateBuf¶Class providing memory buffers for ocl::matchTemplate() function, plus it allows to adjust some specific parameters.
struct CV_EXPORTS MatchTemplateBuf
{
Size user_block_size;
oclMat imagef, templf;
std::vector<oclMat> images;
std::vector<oclMat> image_sums;
std::vector<oclMat> image_sqsums;
};
You can use field user_block_size to set specific block size for ocl::matchTemplate() function. If you leave its default value Size(0,0) then automatic estimation of block size will be used (which is optimized for speed). By varying user_block_size you can reduce memory requirements at the cost of speed.
Computes a proximity map for a raster template and an image where the template is searched for.
void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method)¶ void ocl::matchTemplate(const oclMat& image, const oclMat& templ, oclMat& result, int method, MatchTemplateBuf& buf)¶| Parameters: |
|
|---|
The following methods are supported for the CV_8U depth images for now:
CV_TM_SQDIFFCV_TM_SQDIFF_NORMEDCV_TM_CCORRCV_TM_CCORR_NORMEDCV_TM_CCOEFFCV_TM_CCOEFF_NORMEDThe following methods are supported for the CV_32F images for now:
CV_TM_SQDIFFCV_TM_CCORRSee also