1. Install QT
$sudo Apt-get Install Qtcreator
2. Configure OpenCV
The OPENCV header and library files need to be associated with QT, so after double-clicking the Qtcreator project to the ***.pro file, add the following code after it:
Includepath + +/usr/local/include \
/usr/local/include/opencv \
/usr/local/include/opencv2
LIBS + =/usr/ local/lib/libopencv_highgui.so \
/usr/local/lib/libopencv_core.so \
/usr/local/lib/libopencv_ Imgproc.so
That is, the corresponding entire ***.pro file at this time is as follows:
#-------------------------------------------------
#
Project created by Qtcreator 2012-07-09t22:01:34
#
#-------------------------------------------------
qt = core
qt- = GUI
TARGET = Test1
Config + = Console CONFIG-= app_bundle
TEMPLATE = App
SOURCES + = main.cpp
Includepath + +/usr/local/include \
/usr/local/include/opencv \
/usr/local/include/opencv2
LIBS + =/ usr/local/lib/libopencv_highgui.so \
/usr/local/lib/libopencv_core.so \
/USR/LOCAL/LIB/LIBOPENCV _imgproc.so
3. QT + OpenCV to achieve camera acquisition and photo function
Click to open the link