[問題] 關於OpenCV的VideoCapture
開發平台(Platform): (Ex: VC++, Gcc, Linux, ...)
VC++ 2010
額外使用到的庫(Library Used) (Ex: OpenGL, ...)
OpenCV 2.2
問題(Question):
影片檔還沒讀完就產生"Unhandled exception"
餵入的資料(Input):
320*320 30fps wmv 7秒
預期的正確結果(Expected Output):
f會跑到最後一個frame
錯誤結果(Wrong Output):
Unhandled exception at 0x558bed66 (opencv_highgui220d.dll) in
test.exe: 0xC0000005: Access violation reading location 0x00000018.
程式碼(Code): (請善用置底文標色功能)
int main(int argc, char** argv)
{
int f = 0;
VideoCapture cap = VideoCapture("test03.wmv");
if(!cap.isOpened()) // check if we succeeded
return -1;
Mat gray;
namedWindow("gray",CV_WINDOW_AUTOSIZE);
for(;;)
{
Mat frame;
cap >> frame; // get a new frame from file
cvtColor(frame, gray, CV_BGR2GRAY);
imshow("gray", gray);
f++;
printf("%d\n",f);
}
return 0;
}
補充說明(Supplement):
cvtColor就算不用還是有相同問題
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.120.13.168
推
01/03 16:05, , 1F
01/03 16:05, 1F
→
01/03 16:08, , 2F
01/03 16:08, 2F
推
01/03 17:23, , 3F
01/03 17:23, 3F
→
01/03 17:23, , 4F
01/03 17:23, 4F
推
01/03 20:24, , 5F
01/03 20:24, 5F
→
01/03 23:30, , 6F
01/03 23:30, 6F
→
01/03 23:30, , 7F
01/03 23:30, 7F
→
01/03 23:59, , 8F
01/03 23:59, 8F
→
01/04 12:13, , 9F
01/04 12:13, 9F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
11
38