Opencv in Qt
I have been to call the opencv function from Qt(Qml),but it doesn't working well...It always showing error(Undefined reference to cvLoadImage,cvNamedWindow,etc.)....But when i run that opencv code in console application means ,it is running well..But when i using it with Qt,it is displaying this error..Could anyone please sought out the problem..
thanks in advance..
No idea about this?????????
Please allow at least 24 to 72 hours before bumping your own thread. Not all people on this forum live the same timezone as you or even might have an answer.
If you are having undefined reference it means that you are not linking the library to your application when compiling.
Sorry for the delay sir. I've used pro file as
LIBS += -L/usr/local/lib
This is what i'm trying. From Qml, i'm calling a function.
QString mainwindow::get_opencv(QString &get_word)
IplImage *img2 = cvLoadImage("images_.png");
CvPoint pt1 = cvPoint(130,90);
int thickness = 2;
CvScalar blue = CV_RGB(0,0,250);
double hscale = 1.0;
double vscale = 1.0;
double shear = 0;
//int thickness2 = 1;
int line_type = 4;
CvFont font1 ;//= fontQt("Times");
It is telling undefined reference to cvLoadImage,CvPoint,etc..
please help me sir..
I would say you are not linking to opencv_highgui
have you set all your includepaths properly and added all necessary variables to your system environment variables ?
a quick guide to use qtcreator with opencv is here:
I'm sure you can search the net for more guides.
In your case you might be missing:
as well, or equivalent.
As in the tutorial you might also add:
INCLUDEPATH += C:\OpenCVx.x\include
LIBS += -LC:\OpenCVx.x\lib
To your .pro.
While placeholders x y and z represent versionsing.
How to set this up is also explained in OpenCV 2 Computer Vision Application Programming Cookbook by Robert Laganière.
hi SGaist and Refuzee,
You both are right.I'm working in linux. I have missed that -lopencv_highgui \ in profile
Thank you a lot... Still it is not over,i need to check that application.Tomorrow i will check it and i will tell the working process
Since you're on linux you can take advantage of pkg-config