Configuration process of Qt + OpenCV in Ubuntu

Source: Internet
Author: User

Configuration process of Qt + OpenCV in Ubuntu
1: opencv download source codeSelect AllCopyPut in notes

Download the source code of the linux version at the following URL: http://opencv.org/downloads.htmlqtenvironment, which is self-assembled (see section 7th of this blog post)
2: decompress and compile the source code Select All Copy Put in notes
Cd opencv-2.1.0mkdir release & cd releasecmake-D CMAKE_BUILD_TYPE = RELEASE-D CMAKE_INSTALL_PREFIX =/usr/local-DWITH_FFMPEG = OFF .. make sudo make install the library file in the/usr/localopencv installation directory is under the/usr/local/lib directory.
3: Common compilation error Solutions Select All Copy Put in notes
1: error 'ptrdiff _ t' does not name a type opencv solution: In/include/opencv/cxcore. add the following row in the hpp file: using std: vector; using std: string; + using std: ptrdiff_t; // This is the added row in 56 rows 2: error: 'unlink' was not declared in this scope solution: in src/highgui/loadsave. add the following line in cpp # include <unistd. h> 3: error: 'codec _ id_h264' was not declared in this scope solution: Method 1: sudo apt-get install libopencv-dev and re-compile ffmpeg using the following methods :. /configure -- enable-shared -- disable-staticmakesudo make install method 2: disable ffmpeg when using cmake without using FFMPEG.-DWITH_FFMPEG = OFF4: undefined reference to 'cvcreatecameracapture _ V4L (int) 'vim opencv-2.1.0/src/highgui/cvcap_v4l.cpp 217 # ifdef HAVE_CAMV4L 218 # include <linux/videodev. h> 219 # endifvim opencv-2.1.0/src/highgui/cvcap. cpp changes 164 # if defined (HAVE_CAMV4L) | defined (HAVE_CAMV4L2) to 164 # if defined (HAVE_CAMV4L) 5: The other errors are unlike and no declare is found, only the unistd must be added to the corresponding source file. the h header file can be resolved and finally compiled through: Linking CXX shared library .. /.. /lib/cv. so [100%] Built target cvpy
4: add the path of the self-generated Dynamic Link Library to the path that can be found by the system. Select All Copy Put in notes
sudo -secho "/usr/local/lib" > /etc/ld.so.conf.d/opencv.confsudo ldconfig
5. Before compiling the Qt + opencv project, add the following content to the. pro file: Select All Copy Put in notes
// Add the header file path to compile with INCLUDEPATH + = ../opencv-2.1.0/include/opencv2 // Add the library to be used, the link uses unix :! Macx: LIBS + =-lcvunix :! Macx: LIBS + =-lcvauxunix :! Macx: LIBS + =-lcxcoreunix :! Macx: LIBS + =-lhighguiunix :! Macx: LIBS + =-lml
6: The previous shadow removal program Graph

7. install and configure the Qt Environment Select All Copy Put in notes
1: Download the official qt-creator file qt-creator-opensource-linux-x86_64-3.2.0.run2: install qt4 or qt5sudo apt-get install qt4-defaultsudo apt-get install qt5-defaultsudo apt-get install qtcreator3 from the source: use qt-creator to create a new qt project in kits --> Qt Versions, add/usr/bin/qmake-qt4.

OpenCV official tutorial Chinese version (For Python) PDF

Install the required OpenCV2.4.1 package in Ubuntu Linux

Install OpenCV2.4.2 on Ubuntu 12.04

OpenCV in CentOS cannot read Video Files

Summary of installing OpenCV 2.4.5 in Ubuntu 12.04

Install OpenCv2.1 in Ubuntu 10.04

Face Recognition System Based on QT and OpenCV

Install OpenCV 2.4.9 in Ubuntu 14.04 and 13.10

OpenCV details: click here
OpenCV: click here

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.