CvSeq* oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,
int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0));
+ void detectMultiScale(oclMat &image, CV_OUT std::vector<cv::Rect>& faces,
+ double scaleFactor = 1.1, int minNeighbors = 3, int flags = 0,
+ Size minSize = Size(), Size maxSize = Size());
};
class CV_EXPORTS OclCascadeClassifierBuf : public cv::CascadeClassifier
return result_seq;
}
+
+struct getRect
+{
+ Rect operator()(const CvAvgComp &e) const
+ {
+ return e.rect;
+ }
+};
+
+void cv::ocl::OclCascadeClassifier::detectMultiScale(oclMat &gimg, CV_OUT std::vector<cv::Rect>& faces,
+ double scaleFactor, int minNeighbors, int flags,
+ Size minSize, Size maxSize)
+{
+ CvSeq* _objects;
+ MemStorage storage(cvCreateMemStorage(0));
+ _objects = oclHaarDetectObjects(gimg, storage, scaleFactor, minNeighbors, flags, minSize, maxSize);
+ vector<CvAvgComp> vecAvgComp;
+ Seq<CvAvgComp>(_objects).copyTo(vecAvgComp);
+ faces.resize(vecAvgComp.size());
+ std::transform(vecAvgComp.begin(), vecAvgComp.end(), faces.begin(), getRect());
+}
+
struct OclBuffers
{
cl_mem stagebuffer;
cl_mem newnodebuffer;
};
-struct getRect
-{
- Rect operator()(const CvAvgComp &e) const
- {
- return e.rect;
- }
-};
void cv::ocl::OclCascadeClassifierBuf::detectMultiScale(oclMat &gimg, CV_OUT std::vector<cv::Rect>& faces,
double scaleFactor, int minNeighbors, int flags,