PDA

View Full Version : How to integrate opencv2.2 and Qt 4.7 in OSX 10.6.6.



WDT
12th March 2011, 19:46
Hi

I'm not exactly new to Qt4 but t's been a while since I used it. I'm trying to integrate the opencv library with Qt4 creator on the mac and running into problems. most of which I've been blindly trying to resolve and have to some degree.
I downloaded the opencv2.2 tar.gz library and untar'ed it to my /opt/local/include path and then tried to run this (http://qt-apps.org/content/show.php/Qt+Opencv+webcam+viewer?content=89995) tutorial. At first there were lots of errors which were down to the difference in the folder hierachy of the library being changed.

This is how the .pro file now looks like:
TEMPLATE = app
TARGET =
DEPENDPATH += .

INCLUDEPATH += /opt/local/include/OpenCV-2.2.0/include \
/opt/local/include/OpenCV-2.2.0/include/opencv2 \
/opt/local/include/OpenCV-2.2.0/modules/core/include \
/opt/local/include/OpenCV-2.2.0/modules/imgproc/include \
/opt/local/include/OpenCV-2.2.0/modules/video/include \
/opt/local/include/OpenCV-2.2.0/modules/features2d/include \
/opt/local/include/OpenCV-2.2.0/modules/flann/include \
/opt/local/include/OpenCV-2.2.0/modules/objdetect/include \
/opt/local/include/OpenCV-2.2.0/modules/calib3d/include \
/opt/local/include/OpenCV-2.2.0/modules/legacy/include \
/opt/local/include/OpenCV-2.2.0/modules/highgui/include \


SOURCES += main.cpp QOpenCVWidget.cpp MyCameraWindow.cpp
HEADERS += QOpenCVWidget.cpp MyCameraWindow.h

The include paths are the only changes I've made to it to help resolve the missing modules while I was trying to compile the tutorial.
At the moment I only get one error:
:: error: [moc_MyCameraWindow.cpp] Error 1 and I don't know what's causing it. Any help would be greatly appreciated.

Edit:
I recompiled openCV with CMake and get the following errors:
(i) symbol(s) not found
(ii) collect2: ld returned 1 exit status