RoboMaster_SWPU iron man team work Vision Group notes (a)

QT5.9.4 and OpenCV3.0.0 configuration

  Dajiang recently launched their second generation micro-computer Miaosuan manifold2, drones and sentry size because of the design considerations and other reasons, preferred Miaosuan 2 as the on-board computer with a view Miaosuan technical Manual discover the ubuntu version configured for 16.04LTS, opencv version is 3.0.0, it is a unified set of visual software development environment for ubuntu16.04, QT5.9.4, oepncv3.0.0, to facilitate post code directly in Miaosuan 2 can start running.
Here Insert Picture Description
(A) QT installation and OpenCV source compiler

  OpenCV in the official website to download the source code OpenCV3.0.0 after downloading a zip file, and then download the file QT5.9.4 run, enter ./qt-opensource-linux-x64-5.9.4.run inside the terminal can directly run the installation QT5.9.4, it is not very convenient.
  The next step is to configure OpenCV3.0.0, the first OpenCV compressed package extract to home folder, and then add dependent libraries OpenCV need, refer to this blog post: on my desktop reference this blog can be used directly opencv library, but in my notebook but it's not, please read on.
  https://www.cnblogs.com/fx-blog/p/8213704.html .

  Bowen above tutorial in order to perform according to OpenCV source code can be compiled in ubuntu inside, then saw OpenCV compile the results of the in / usr / local / lib. If during compilation, encountered some file is not found, then solve their own Baidu (during compiled, ippicv_linux_20141027.tgz need to be online to download, but the speed is very slow, we are ready to advance this archive, and then copied to / home / young /opencv-3.0.0/3rdparty/ippicv/downloads/linux-8b449a536a2157bcad08a2b9f266828b, this is my own path, their own readers modification).

  Since the National Day holiday, I took a notebook to do projects, and found a lot of engineering to create compiled opencv problem.
  1, directly to the desktop engineering copied to the laptop, click to build the project, findings show that "can not be built", after Baidu search problem and found to click on the "Project" on the left QT interface, modify the project build directory under this option It can be.
  2, GCC / G ++ compiler default is c ++ 98 std's, can not support new features and multi-threaded mutex mutex, apparently to make QT supports C ++ 11 and found to be in the pro file, enter the Baidu QMAKE_CXXFLAGS + = -std = c ++ 11 can, found only found entered config - = c ++ 11 not.
  3, run the project, suggesting no opencv library, but when I compiled opencv source code, have seen the relevant documents so the despair in usr / local / lib, the reason is because I did not compile step is finished reference this blog.
  https://blog.csdn.net/public669/article/details/99044895 .

(B) Based on QT build OpenCV project

  In the Welcome screen, select New Project, select Non-Qt project C ++ template, and then all the way click Next until you created the project. QT does not support the project name is Chinese.
  QT will not enter the Chinese bug, solution: reference this blog
  https://blog.csdn.net/hanshihao1336295654/article/details/82885777 .

  Enter OpenCV in the pro file of the project library links, so you can write code in OpenCV in QT.

INCLUDEPATH += /usr/local/include \
               /usr/local/include/opencv \
               /usr/local/include/opencv2

LIBS += /usr/local/lib/libopencv_imgproc.so \
        /usr/local/lib/libopencv_highgui.so \
        /usr/local/lib/libopencv_core.so \
        /usr/local/lib/libopencv_imgcodecs.so \
        /usr/local/lib/libopencv_video.so \
        /usr/local/lib/libopencv_videoio.so \
        /usr/local/lib/libopencv_calib3d.so \
        /usr/local/lib/libopencv_imgproc.so.3.0 \
        /usr/local/lib/libopencv_ml.so \
        /usr/lib/x86_64-linux-gnu/libpthread.so

Note:
  1, the picture displayed on the project to build the project files in the folder, or you'll be an absolute path to load the picture in the program.
  2, how to call multiple projects in a project, the choice of which is the current project, when you click the "Run" button, which will execute the project in Debug lower left corner.

Published 20 original articles · won praise 48 · views 30000 +

Guess you like

Origin blog.csdn.net/yc5300891/article/details/101530323