Ask Your Question
0

Using a video (videocapture) with Qt and opencv on windows 7 don`t open.

asked 2013-10-30 08:15:04 -0600

amaiaman gravatar image

updated 2018-12-25 10:03:12 -0600

Hello!

I need to use in an application opencv qt.

I used this programming in the main.cpp.

VideoCapture capture("video2_alcorcon.avi"); for(; {

capture >> src; imshow("imagen", src); waitKey(10); }

In file.pro I include:

INCLUDEPATH += C:\Users\Amaia\Desktop\opencvmin\install\inc lude LIBS += -LC:\Users\Amaia\Desktop\opencvmin\install\li b \ -lopencv_core240 \ -lopencv_highgui240 \ -lopencv_imgproc240 \ -lopencv_features2d240 \ -lopencv_calib3d240

And in header too:

include <opencv cv.h="">

include <opencv2 core="" core.hpp="">

include <opencv2 highgui="" highgui.hpp="">

include <opencv2 imgproc="" imgproc.hpp="">

using namespace cv; //opencv

But I have got an error.error.jpg

Please, help me.

Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-10-30 14:39:27 -0600

stereomatching gravatar image

You headers are weird,please fix the typing errors

According to the jpg, looks like the windows can't find the runtime libraries of openCV(dll),make sure you add the path which include the dll.

My Qt5 .pro, treat it as reference

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += c++11

win32{

INCLUDEPATH += ../../../3rdLibs/openCV/OpenCV-2.4.5/build/include

#for mingw
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_calib3d245
LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_core245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_features2d245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_flann245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_gpu245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_highgui245
LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_imgproc245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_legacy245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_ml245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_nonfree245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_objdetect245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_ocl245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_photo245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_stitching245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_superres245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_ts245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin  -lopencv_video245
#LIBS += -L../../../3rdLibs/openCV/OpenCV-2.4.5/builded/bin -lopencv_videostab245

#for vc series
#LIBS += -L../../3rdLibs/openCV/OpenCV-2.4.5/build/x86/vc11/lib -lopencv_core245 -lopencv_imgproc245
}

If you are using mingw rather than vc++(I prefer mingw since it has better c++11 support), you may need to build the openCV by yourself, the dll come with the openCV packages can't work with the mingw come with Qt5 binary(ABI break?).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-10-30 08:15:04 -0600

Seen: 2,234 times

Last updated: Oct 30 '13