First, create a project with Qtcreator
1. New Project
2. Select project Type
3, modify the project name and project storage address
4. Next, select Next until the project builds successfully
second, after the successful project creation, began to write OpenCV small program
1, in the Pro configuration file to add OpenCV Library directory
Includepath + +/usr/local/include \
/usr/local/include/opencv \
/usr/local/include/opencv2
2, in the Pro configuration file to add OpenCV dynamic library links
LIBS + +/usr/local/lib/libopencv_calib3d.so \
/usr/local/lib/libopencv_core.so \
/usr/local/lib/libopencv_ features2d.so \
/usr/local/lib/libopencv_flann.so \
/usr/local/lib/libopencv_highgui.so \
/usr/local/ lib/libopencv_imgcodecs.so \
/usr/local/lib/libopencv_imgproc.so \
/usr/local/lib/libopencv_ml.so \
/ usr/local/lib/libopencv_objdetect.so \
/usr/local/lib/libopencv_photo.so \
/usr/local/lib/libopencv_ shape.so \
/usr/local/lib/libopencv_stitching.so \
/usr/local/lib/libopencv_superres.so \
/usr/ local/lib/libopencv_videoio.so \
/usr/local/lib/libopencv_video.so \
/usr/local/lib/libopencv_ Videostab.so
QT OPENCV Configuration Complete
3, in Main.cpp to write the first OpenCV applet, display a picture
#include <cstdlib>
#include <iostream>
#include <opencv2/opencv.hpp>
#include < opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace CV;
int main (int argc, char* argv[])
{
cv::mat img;//define a MAT variable
img = Cv::imread ("/home/1.jpg");//Read Picture
CV :: Imshow ("Window", IMG); Display Picture
cv::waitkey (0);
return 0;
}
Display picture, OPENCV configuration successful
Three, the configuration of Qt Caffe
1, in the Pro profile to join the Caffe Library directory
Includepath + = Caffe's home directory/include \
Caffe's home directory/build/src
#caffe的库目录每个人根据自己目录填写, such as/home/caffe
2, in the Pro profile to join Caffe Dynamic link library
LIBS = L Caffe's home directory/build/lib \
LIBS + = Lcaffe
Note: LIBCAFFE.SO.1.0.0-RC3 According to the version of Caffe, to enter the Lib directory to see its name, changed to the same as it.
3, pro under Cuda, CUDNN configuration (note that only the installation of Cuda or CUDNN to configure this step)
Includepath +/usr/local/cuda/include \
LIBS =-l/usr/local/cuda/lib64
LIBS + =-lcudart-lcublas-lcurand
4, pro file Caffe related dependencies to join
LIBS + +-lglog-lgflags-lprotobuf-lboost_system-lboost_thread-llmdb-lleveldb-lstdc++-lcblas-latlas
5, after the above configuration, Qtcreator under the Caffe configuration completed.