我试图通过Visual Studio 2015上的OpenCV 3.1.0版打开视频。我的程序只是打开一个视频。它适用于opencv 2.4版和visual studio 2010.我不知道如何解决这个问题:
#include "opencv2/opencv.hpp"
#include<iostream>
using namespace cv;
using namespace std;
int main(int argc, char**argv)
{
VideoCapture cap("C:/Users/NguyenVanDung/Documents/Visual Studio 2015/Projects/ReadingVideo/ReadingVideo/walk.avi"); // open the default camera
if (!cap.isOpened()) {
cout << "can't read video" << endl;
system("pause"); // check if we succeeded
return -1;
}
Mat edges;
namedWindow("edges", 1);
for (;;)
{
Mat frame;
cap >> frame; // get a new frame from camera
imshow("edges", frame);
if (waitKey(30) >= 0) break;
}
// the camera will be deinitialized automatically in VideoCapture destructor
return 0;
}
这是输出: &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Users \ NguyenVanDung \ Documents \ Visual Studio 2015 \ Projects \ ReadingVideo \ x64 \ Debug \ ReadingVideo.exe&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ ntdll.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ kernel32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Program Files(x86)\ AVG \ Av \ avghooka.dll&#39;。无法找到或打开PDB文件。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ KernelBase.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ opencv_world310d.dll&#39;。无法找到或打开PDB文件。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ user32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ gdi32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ ole32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ combase.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msvcrt.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ rpcrt4.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ bcryptprimitives.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ sechost.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ oleaut32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ comdlg32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ SHCore.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ shlwapi.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ shell32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ cfgmgr32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ windows.storage.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ advapi32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ kernel.appcore.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ powrprof.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ profapi.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ FirewallAPI.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ netapi32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msvcp140d.dll&#39;。无法找到或打开PDB文件。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ vcruntime140d.dll&#39;。无法找到或打开PDB文件。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ ucrtbased.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ WinSxS \ amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10586.0_none_396e892957c7fb25 \ comctl32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msvfw32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ avifil32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ avicap32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ concrt140d.dll&#39;。无法找到或打开PDB文件。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ winmm.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msacm32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ davhlpr.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ winmmbase.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ imm32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ fwbase.dll&#39;。符号已加载。
***** VIDEOINPUT LIBRARY - 0.1995 - TFW07 *****
&#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ uxtheme.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ clbcatq.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msrle32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ msrle32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msvidc32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ msvidc32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ tsbyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ tsbyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ iyuv_32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msrle32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ msrle32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msvidc32.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ msvidc32.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ tsbyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):已卸载&#39; C:\ Windows \ System32 \ tsbyuv.dll&#39; &#39; ReadingVideo.exe&#39; (Win32):已加载&#39; C:\ Windows \ System32 \ msyuv.dll&#39;。符号已加载。 &#39; ReadingVideo.exe&#39; (Win32):卸载&#39; C:\ Windows \ System32 \ msyuv.dll&#39; 该程序&#39; [12640] ReadingVideo.exe&#39;退出时使用代码-1(0xffffffff)。