Ask Your Question
0

configure opencv with Qt in linux

asked 2013-02-18 10:36:11 -0600

hor gravatar image

hi

i want to configure opencv2.3.1 that i have installed from ubuntu software center and the headers are in usr/include/opencv and the libraries are in usr/lib . i tried many ways and instructions but still i havent desired result.

i have some basically questions

1- we have two opencv folders . opencv and opencv 2 . what is the difference between those and when i write includepath i should write which one?

2-if i want to make a form like Visual studio forms with picturebox and some bottone and etc i must choose which one of the Qt prebuild such as (widget - console - application GUI i mean) ?

so sorry for my very bad english . if the questions are unclear tell me to more explain(although i think my questions are very simple and no need to explain)

thanks a lot

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-02-18 10:44:36 -0600

  1. opencv folder is include folder for old style C API support. It is added for compatibility with OpenCV 1.x. opencv2 is include folder for modern API. Use it.

  2. You need to install Qt Creator with included Qt development files.

edit flag offensive delete link more

Comments

i had installed Qt with QtAssistant-QtCreator-QtSetting-QtLinguist from ubuntu-software-center

and i added this lines to my project .pro file :

INCLUDEPATH += /usr/include/opencv INCLUDEPATH += /usr/include/opencv2

LIBS += -L/usr/lib -lopencv_core -lopencv_highgui and etc

but i doesnt work still

hor gravatar imagehor ( 2013-02-18 12:31:55 -0600 )edit

also i have 4 of each library in that direction . for example : libopencv_imgproc.a libopencv_imgproc.so libopencv_imgproc.so.2.3 libopencv_imgproc.2.3.1

i must write which one in next of LIBS+= ....... ?

hor gravatar imagehor ( 2013-02-18 13:19:32 -0600 )edit

your INCLUDEPATH and LIBS-path actually look fine (altough at my system they are under /usr/local/lib and /usr/local/include). To answer your question: the '-l' before 'opencv_core' (and the others) will result in libopencv_core.so , thus, this library will be used, however libopencv_core.so is just a symbolic link to libopencv_imgproc.so.2.3 which again is only a symbolic link to libopencv_imgproc.2.3.1. This is the way to go and makes it easy to upgrade to a newer opencv-version without updating your projectfile. If you are still stuck with your problem, please update your question with your .pro-file.

Guanta gravatar imageGuanta ( 2013-02-18 16:23:26 -0600 )edit

Question Tools

Stats

Asked: 2013-02-18 10:36:11 -0600

Seen: 4,915 times

Last updated: Feb 18 '13