大家好
我在用opencv時抓影像 再把影像顯示出來
結果出現了下面的錯誤
他會直接跳一個視窗出來
Debug Error!
Program:
......XXX.exe
R6010
-abort() has been called
(Press Retry to debug the application)
為什麼會這樣呢@@?
我上google看也看不個所以然
補個code
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
#include <windows.h>
#include<time.h>
using namespace cv;
using namespace std;
int main()
{
//CvCapture *capture0;
//CvCapture *capture1;
VideoCapture cap1(2);
VideoCapture cap2(1);
VideoCapture cap3(0);
//IplImage *frame0;
//IplImage *frame1;
Mat frame0;
Mat frame1;
Mat frame2;
//capture0 = cvCaptureFromCAM(0);
//capture1 = cvCaptureFromCAM(1);
//cvNamedWindow("Webcam0", 1);
//cvNamedWindow("Webcam1", 1);
while (true)
{
//frame0 = cvQueryFrame(capture0);
//frame1 = cvQueryFrame(capture1);
cap1 >> frame0;
cap2 >> frame1;
cap3 >> frame2;
imshow("Webcam0", frame0);
imshow("Webcam1", frame1);
imshow("Webcam2", frame2);
if (waitKey(10) == ' ')
{
break;
}
}
cout << frame0.size() << endl;
cout << frame1.size() << endl;
// cout << frame2.size() << endl;
//cvReleaseCapture(&capture0);
//cvDestroyWindow("Webcam0");
}