Ask Your Question
0

Initialize OpenCL runtime... Error

asked 2018-01-29 07:01:56 -0600

rushix gravatar image

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;
}
edit retag flag offensive close merge delete

Comments

1

[ INFO:0] Initialize OpenCL runtime.. -- this is not an error. (it's just an annoying info msg)

berak gravatar imageberak ( 2018-01-29 07:07:39 -0600 )edit

@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.

rushix gravatar imagerushix ( 2018-01-29 09:51:49 -0600 )edit
1

there is no procedure.

there is nothing to do.

just ignore it.

berak gravatar imageberak ( 2018-01-29 10:08:20 -0600 )edit

@berak, I am a bit concerned because i am printing the size if faces but it neither prints 1 nor printing 0....!!

rushix gravatar imagerushix ( 2018-01-30 11:10:02 -0600 )edit
1

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 gravatar imageberak ( 2018-01-30 11:16:35 -0600 )edit

@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.

rushix gravatar imagerushix ( 2018-02-02 06:07:24 -0600 )edit

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 gravatar imagekerat ( 2018-04-05 02:20:36 -0600 )edit

@kerat, that message is NOT an error.

berak gravatar imageberak ( 2018-04-05 02:25:38 -0600 )edit

My program doesn't work every time it appears, so I don't care what it's called.

kerat gravatar imagekerat ( 2018-04-05 09:29:29 -0600 )edit

Anyone knows how to disable this output? @rushix

agar gravatar imageagar ( 2018-10-21 13:07:33 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-02-02 05:59:48 -0600

rushix gravatar image

@berak, Got it working, i was providing wrong detectMultiScale arguments... Thanks dear. I am trying to accept your answer ..., but i am new and don't know how to accept it. well i will find it and accept it.

edit flag offensive delete link more

Comments

far better this way ;)

berak gravatar imageberak ( 2018-02-02 06:06:37 -0600 )edit

@rushix What are the correct arguments? How did you make it disappear?

atulapra gravatar imageatulapra ( 2018-12-08 03:34:42 -0600 )edit

Did you ever resolve this? I need to suppress this output as well as my std::out needs to be clear

bi613en gravatar imagebi613en ( 2018-12-20 05:49:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-01-29 07:01:56 -0600

Seen: 5,534 times

Last updated: Jan 29 '18