Qt Installation
PC-Side download and installation can be HTTPS://MIRRORS.USTC.EDU.CN/QTPROJECT/OFFICIAL_RELEASES/QT
Raspberry Pi: qt Dev kit and OPENCV installation
sudo apt-get install Qt4-dev-tools
sudo apt-get install Libopencv-dev
Developed on the PC after the test to the Raspberry Pi, modify the Pro link library and header file directory
TEMPLATE = AppCONFIG + = consoleconfig-= App_bundleconfig = qtsources + Main.cppincludepath +/usr/include Includepath + =/usr/include/opencv# Debuglibs + =-l/usr/lib -lopencv_calib3d -lopencv_contrib -lopencv_core - lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_ Legacy -lopencv_ml -lopencv_objdetect -lopencv_videoinclude (DEPLOYMENT.PRI) qtcadddeployment ()
Test program
#include <iostream> #include <opencv2/opencv.hpp>using namespace std;using namespace cv;int main (int argc, Char **argv) { Mat im = Imread (argv[1]); Mat Gray; Cvtcolor (IM, Gray, cv_rgb2gray); Imwrite ("Gray.jpg", gray); return 0;}
Qmake Rpi.pro
Make
More gray.jpg this image.
Success
Using Qmake to develop OPENCV programs on Raspberry Pi