Last summer, I used QT to make a simple stitching applet based on SIFT+RANSAC. The opencv version used at that time was 2.4.10.
A year has passed. . . . I used it again when I finished the design. The version of opencv on the computer has reached 3.3.0.
It took a whole day of continuous battle to configure opencv on QT. . . .
First, refer to the following tutorial to compile a dynamic library suitable for qt with mingw:
https://blog.csdn.net/qq_17550379/article/details/78277313
The cmake process of opencv3.3 is really a lot of minefields! ! When it was finally generated, because opencv_hdf seemed to conflict with Anaconda on the computer, the library was not compiled.
After compiling, fill in the .pro file in qt
INCLUDEPATH += E:/OpenCV3.3_Qt/install/include \ E:/OpenCV3.3_Qt/install/include/opencv \ E:/OpenCV3.3_Qt/install/include/opencv2 LIBS += -LE:/OpenCV3.3_Qt/install/x86/mingw/lib \ -llibopencv_aruco330 \ -llibopencv_bgsegm330 \ -llibopencv_bioinspired330 \ -llibopencv_calib3d330 \ -llibopencv_ccalib330 \ -llibopencv_core330 \ -llibopencv_datasets330 \ -llibopencv_dnn330 \ -llibopencv_dpm330 \ -llibopencv_face330 \ -llibopencv_features2d330 \ -llibopencv_flann330 \ -llibopencv_highgui330 \ -llibopencv_img_hash330 \ -llibopencv_imgcodecs330 \ -llibopencv_imgproc330 \ -llibopencv_line_descriptor330 \ -llibopencv_ml330 \ -llibopencv_objdetect330 \ -llibopencv_optflow330 \ -llibopencv_phase_unwrapping330 \ -llibopencv_photo330 \ -llibopencv_reg330 \ -llibopencv_rgbd330 \ -llibopencv_saliency330 \ -llibopencv_shape330 \ -llibopencv_stereo330 \ -llibopencv_stitching330 \ -llibopencv_structured_light330 \ -llibopencv_superres330\ -llibopencv_surface_matching330 \ -llibopencv_text330 \ -llibopencv_tracking330 \ -llibopencv_video330 \ -llibopencv_videoio330 \ -llibopencv_videostab330 \ -llibopencv_xfeatures2d330 \ -llibopencv_ximgproc330 \ -llibopencv_xobjdetect330 \ -llibopencv_xphoto330
At this time, it seems that the compilation can pass, but the program always exits abnormally T_T
After checking a lot of information one after another, this blog post gave me inspiration:
https://blog.csdn.net/qq_21078557/article/details/78962135
In QT, you can set the build environment yourself! ! !
So found
The last one saved in this PATH is the path of opencv2.4.10! !
Change to the bin path together with the lib folder after mingw compiles today, it's so spicy! !
I hope the interface will be successful in the future! ! ! !