Initialize OpenCL runtime... Error
Hi there, I am a new member to the forum. I have setup OpenCV with homebrew on mac os x yosemite. My all programs are running except image detection. But this simple program is giving me error runtime.
Explanation :
I am detecting faces with Opencv with c++ . Running like :-
Apples-MacBook:detect_object rushi$ g++ objectDetection.cpp -o out pkg-config --cflags --libs opencv
Apples-MacBook:detect_object rushi$ ./out
[ INFO:0] Initialize OpenCL runtime...
Below is my source code -
#include <opencv2/core/core.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <stdio.h>
#include <iostream>
using namespace cv;
using namespace std;
int main(void)
{
Mat image;
image = imread( "./actress.jpeg", 1 );
if( !image.data )
{
printf( " No image data \n " );
return -1;
}
String face_cascade_file = "./haarcascade_frontalface_alt.xml";
CascadeClassifier FaceCascadeClassifier;
// Load the cascade
if (!FaceCascadeClassifier.load(face_cascade_file))
{
printf("--(!)Error loading cascde classifier...\n");
return (-1);
}
vector<Rect> faces;
FaceCascadeClassifier.detectMultiScale(image, faces, 1.1, 3, CV_HAAR_FIND_BIGGEST_OBJECT, Size(30, 30), Size(200,200));
cout<<"faces" <<faces.size();
waitKey(0);
return 0;
}
[ INFO:0] Initialize OpenCL runtime..
-- this is not an error. (it's just an annoying info msg)@berak, then how to initialize opencl? Can you let me know the procedure? Should i initialize it via code ? Which code? Or via shell? Then which command? Thank you @berak for your guidance.
there is no procedure.
there is nothing to do.
just ignore it.
@berak, I am a bit concerned because i am printing the size if faces but it neither prints 1 nor printing 0....!!
again, unrelated to the message.
" but it neither prints 1 nor printing 0" -- most likely, your program bails out early, because either the image or the cascade was not loaded. please go check again.
@berak, How do i accept your answer so that you can get points... I tried upvoting... your answer but it requires that i should have atlas 5 points.
Hello, would you mind clarifying how you solved this? I am getting the same error, and I suspect it comes from detectmultiscale, but I can't find which argument is wrong.
@kerat, that message is NOT an error.
My program doesn't work every time it appears, so I don't care what it's called.
Anyone knows how to disable this output? @rushix