cl_int err;
cl_uint numPlatforms;
err = clGetPlatformIDs(0, NULL, &numPlatforms);
if (CL_SUCCESS == err)
printf("\nDetected OpenCL platforms: %d", numPlatforms);
else
printf("\nError calling clGetPlatformIDs. Error code: %d", err);
string str ="haarcascade_frontalface_alt2.xml";
ocl::OclCascadeClassifier fd;
fd.load(str);
ocl::oclMat frame, frameGray;
Mat frameCpu;
CvVideoCapture vcap = openVideo("0");
vcap.set(CV_CAP_PROP_FRAME_WIDTH,320);
vcap.set(CV_CAP_PROP_FRAME_HEIGHT,240);
static const cv::Size maxSize;
for(;;){
// // processing loop
vector<Rect> faces;
vcap >> frameCpu;
frame = frameCpu;
ocl::cvtColor(frame, frameGray, CV_BGR2GRAY);
//ocl::equalizeHist(frameGray, frameGray);
//Mat mm(frameGray);
//cvWaitKey(100);
fd.detectMultiScale(frameGray,faces,1.05,3,0|CV_HAAR_FIND_BIGGEST_OBJECT ,minSize,maxSize);
for(int i=0; i< faces.size() ; i++)
{
if(faces.size())
//circle(img, Point(palm[i].x+ palm[i].width/2,palm[i].y+palm[i].height/2),palm[i].width,Scalar(255,0,0), 2,8 );
cv::rectangle(frameCpu, faces[i],Scalar(255,0,0), 2,8 );
}
imshow("fsfs",frameCpu);
cvWaitKey(1);