Including OpenCV library files to Qt in ubuntu
-
wrote on 5 Sept 2011, 02:59 last edited by
Hi i want to do a image processing project in qt
for that i need to add the opencv library files to qt
but i cant understand anything from the online documnets how to do it
anyone pls help me in doing this -
wrote on 5 Sept 2011, 06:19 last edited by
qmakes "LIBS":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#libs variable can be used to add additional libraries.
@
LIBS += -L<path_to_libraries>
LIBS += -l<library>
@ -
wrote on 5 Sept 2011, 06:49 last edited by
- Open your project in Qt Creator.
- In the panel "Projects" click on the file ...pro.
- add there:
@
LIBS += -lyour_lib1
LIBS += -lyour_lib2
LIBS += -lyour_lib3
...
@
or
@
LIBS += -Lpath1
LIBS += -Lpath2
...
@
Lukas explained the format: capital L - all libraries from the path; low L (l) - one library; -
wrote on 5 Sept 2011, 07:21 last edited by
[quote author="Fomand" date="1315205373"]capital L - all libraries from the path
[/quote]I think this statement is not completely right.
Capital 'L' defines a library path. Lower case 'l' defines individual libraries.
However, defining the path of libs with 'L' provides certainly the location to search for libs, which might be added using 'l'. The documentation does not state that all libs under that path will be used. -
wrote on 5 Sept 2011, 11:05 last edited by
i installed opencv using opencv.tar.gz
so can you please help me in finding the library path
iam new to ubuntu so pls help
dont know where these libraries are... -
wrote on 5 Sept 2011, 11:11 last edited by
<path to libraries>?
how can i find the path -
wrote on 5 Sept 2011, 11:44 last edited by
find /home/ -name "Qt*"
will find all files in /home/ recursively - files with the name starting from Qt.
apt-show-versions
will show the installed versions of packages.
-
wrote on 5 Sept 2011, 11:55 last edited by
@Formand iam sorry
where actually the OpenCV library files are present
dont know much about ubuntu -
wrote on 5 Sept 2011, 11:57 last edited by
LIBS += -L<path_to_libraries>
LIBS += -l<library>
cant understand the <path to libraries>
how can i find the path of opencv library -
if you've installed OpenCV properly, it would probably reside somewhere in /usr/lib, /lib, /usr/local/lib. But I won't guarantee, I've never used it. Might as well be in /home/<username>/opencv/lib or similar.
But, if everything is installed properly, you would just have to
@
#include <cv.h>
@ -
wrote on 5 Sept 2011, 13:16 last edited by
Read this about OpenCV file names "here":http://packages.debian.org/source/sid/opencv .
And I am on Debian currently - not on Ubuntu. -
wrote on 5 Sept 2011, 13:40 last edited by
i think u dont understand the question
to use the opencv lirary in Qt for example
#include<highgui.hpp> the path of the particular header file has to be specified in the Qt
how to tell qt where to look for the header file
inbuilt header files can be directly but that of opencv cant -
wrote on 6 Sept 2011, 04:06 last edited by
pls help me..........
-
wrote on 6 Sept 2011, 04:10 last edited by
Please be patient when waiting for answers. While we understand that you need help, we're all doing this on our free time and will help you as we can. Begging does not speed things up.
You need to add your path to your OpenCV header files in the "INCLUDEPATH":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#includepath variable in your .pro file.
-
wrote on 6 Sept 2011, 05:06 last edited by
If you have downloaded the source tarball from the OpenCV website you will have to build the library first. There is an extensive "InstallGuide":http://opencv.willowgarage.com/wiki/InstallGuide right where you downloaded OpenCV.
If you have installed OpenCV using your distributions package manager (preferred) the library is already built and installed at the proper location. Use @dpkg --listfiles name-of-opencv-package@ to verify that the libraries have been installed to /usr/lib.
-
wrote on 9 Sept 2011, 07:46 last edited by
!http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg!
cant understand what the error is[EDIT: fixed image link, Volker]
-
[quote author="a4able" date="1315554387"]!http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg()!
cant understand what the error is[/quote]This does not look Qt-related in any way, you are not using any Qt libs in your project. Does imgshow() require cv::Mat, or maybe a pointer? Or maybe methods do not expect char *[] strings?
1/17