Installation and configuration of QT-OPENCV
Want to use OPENCV in QT to achieve the function of continuous image into video, so put on the idea of OPENCV installation OPENCV process is full of twists and turns, but eventually installed successfully, now record the installation process, in case the system re-installed after dumbfounded. Thanks for sharing the following predecessors: https://zahidhasan.wordpress.com/2014/08/19/qt-5-3-1-64-bit-mingw-windows/http://www.tagwith.com/ question_113329_opencv-3-0-videoio-errorhttp://blog.csdn.net/qiurisuixiang/article/details/8665278 This machine has QT installed 5.4.0 installed in: e:\qt\qt-5.4.0-rel-mingw491qt:http://download.qt-project.org/official_releases/If you like 64bit Qt, then QT is: Http://sourceforge.net/projects/qtx64/?source=typ_redirect download from OpenCV OpenCV 3.0.0-beta extract to: E:\OpenCV\source\ OPENCV-3.0.0-BETAOPENCV Official website: http://opencv.org/from CMake download cmake-3.2.0-rc2 install to: e:\cmake\cmake-3.2.0-rc2cmake:http:// www.cmake.org/cmake/resources/software.html install CMake, note that the installation path can not have Chinese and space, during the installation process, tick join all environment variables () after the completion of the above steps, the configuration environment variables are mainly E : \qt\qt-5.4.0-rel-mingw491\tools\mingw491_32\bin added to system environment variables
1. Generate MakefilesOpen CMake, configure the source path and the target path of the generated object: Click Configure, select MinGW makefiles in the pop-up box, and tick specify native compilers: Then configure the C and C + + compiler paths: c:e:/qt/ Qt-5.4.0-rel-mingw491/tools/mingw491_32/bin/gcc.exec++: e:/qt/qt-5.4.0-rel-mingw491/tools/mingw491_32/bin/g++. EXE click Finish. Here CMake will automatically start the configuration. The process will go wrong because the compilation is OpenCV3.0, so you cannot tick With_ipp: then tick With_opengl and WITH_QT continue to click Configure, the success will be as shown below: Click Generate, Generate makefiles success.
2. Compiling OpenCVFind Opencvcompileroptions.cmake under E:\OpenCV\source\opencv-3.0.0-beta\sources\cmake and open it and find
add_extra_compiler_option(-Werror=non-virtual-dtor)
Comment It out and turn it into:
#add_extra_compiler_option(-Werror=non-virtual-dtor)
(This step is to avoid the problems I encountered during the compilation process) return to: E:\OpenCV\source\opencv-3.0.0-beta under this path, press and hold the SHIFT key on the keyboard, and then right-click to open the CMD window: Enter in the command line Mingw32-make This process is relatively long, about 30 minutes, depending on the computer. After the compilation is complete, as shown. Then enter the Mingw32-make install for installation: approximately two minutes after installation is complete.
3. Configuring the Environment-1. Find the path: E:\OpenCV\install\opencv-3.0.0-beta\install copy the Include folder to a custom path: E:\OpenCV\necessary_file-2.CMake Destination Path Copy the following bin folder to: E:\OpenCV\necessary_file-3.CMake target path to the Lib folder under Copy to: E:\OpenCV\necessary_file last file: E:\OpenCV\necessary_f The Ile should look like this: Then add the path E:\OpenCV\necessary_file\bin to the system environment variable. The OPENCV development environment under this QT creator has been configured, and the rest is whether the test is configured successfully. Create a new empty project Opencv_test.pro inside add:
E:/opencv/necessary_file/include
LIBS + = L LIBS + = L E:/OPENCV/NECESSARY_FILE/LIB/LIBOPENCV_*.A
Add in Main.cpp:
#include "Cv.h"
#include "cxcore.h"
#include "highgui.h"
int main (int argc, char *argv[])
{
Declaring Iplimage Pointers
Iplimage *pimg;
Loading pictures
PIMG = Cvloadimage ("e:/qt/image/bg/1d60857569.jpg", 1);
Create window
Cvnamedwindow ("Image", 1);
Display image
Cvshowimage ("Image", PIMG);
Wait for the button
Cvwaitkey (0);
Destroying Windows
Cvdestroywindow ("Image");
Release image
Cvreleaseimage (&PIMG);
return 0;
}
The effect of the implementation is: Configuration success!
QT-OPENCV Installation and configuration (win7-bit + OpenCV3.0 + minGW32)