Qt Opencv Integration
-
Hi
I am using qt sdk 1.2(qt 4.8 , creator 2.4.1) and i want to use opencv
so I downloaded opencv2.3.1 and unpacked it to c:
I wrote a simple code like hello world :
@
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;int main(void)
{
IplImage *img=cvLoadImage("c:\IMG_0300.jpg");
cvNamedWindow("window");
cvShowImage("window",img);
cvWaitKey();
return 1;
}
@
and for adding libs to my project my pro file is like this:
@
TEMPLATE = app
CONFIG += console
CONFIG -= qtSOURCES += main.cpp
HEADERS += C:\Opencv\build\include\opencv2\core\core.hpp
C:\Opencv\build\include\opencv2\highgui\highgui.hppINCLUDEPATH+=C:\Opencv\build\include\
win32: LIBS += -L$$PWD/../../../Opencv/build/x86/mingw/lib/ -llibopencv_core231
-llibopencv_highgui231
INCLUDEPATH += $$PWD/../../../Opencv/build/include/
DEPENDPATH += $$PWD/../../../Opencv/build/x86/mingw/bin/
@
but every time i run the project I see a console window that ask me to press return to close this window.
and application output says that exited with code 0
whats the problem ? -
now do you know whats the problem ?
I changed the pro file like this and same result nothing changed.
@
TEMPLATE = app
CONFIG += console
CONFIG -= qtSOURCES += main.cpp
INCLUDEPATH += C:\opencv\build\include
INCLUDEPATH += "C:\opencv\modules\core\include"
"C:\opencv\modules\highgui\include"
BASE_PATH = c:/opencv/build/x86/mingw
CONFIG(release,debug|release)
{
win32: LIBS += -L$$BASE_PATH/lib/ -llibopencv_calib3d231
-llibopencv_contrib231
-llibopencv_core231
-llibopencv_features2d231
-llibopencv_flann231
-llibopencv_gpu231
-llibopencv_highgui231
-llibopencv_imgproc231
-llibopencv_legacy231
-llibopencv_ml231
-llibopencv_objdetect231
-llibopencv_video231
}
CONFIG(debug,debug|release)
{
win32: LIBS += -L$$BASE_PATH/lib/ -llibopencv_calib3d231
-llibopencv_contrib231
-llibopencv_core231
-llibopencv_features2d231
-llibopencv_flann231
-llibopencv_gpu231
-llibopencv_highgui231
-llibopencv_imgproc231
-llibopencv_legacy231
-llibopencv_ml231
-llibopencv_objdetect231
-llibopencv_video231
}@
-
hello,
I have met the same problem, have u solved it?
I have tried again and again, but it didn't work
However, I have successed once, when I did something and restarted qt creator, but since I rewrite the .pro, it crashed. Except this, all are the same with you.