0
请帮忙。即使是在简单的程序中也有内存和异常的错误。调试中的代码块+ mingw - SIGSEGV,调用堆栈 - user32.dll。运行时崩溃与0xc0000005错误。 VC也因未处理的异常而崩溃。OpenCV SIGSEGVС++ minGW
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv/cv.h"
#include "opencv/highgui.h"
#include <iostream>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
using namespace cv;
using namespace std;
int main(int argc, char* argv[])
{
CvCapture* capture = cvCreateCameraCapture(CV_CAP_ANY); //cvCaptureFromCAM(0);
assert(capture);
IplImage* frame=0;
cvNamedWindow("capture", CV_WINDOW_AUTOSIZE);
int counter=0;
char filename[512];
while(true){
frame = cvQueryFrame(capture);
cvShowImage("capture", frame);
char c = cvWaitKey(33);
if (c == 27) {
break;
}
}
cvReleaseCapture(&capture);
cvDestroyWindow("capture");
return 0;
}
代码中的哪一行导致崩溃? – karlphillip
创建窗口并创建相机捕获。在程序结束时按下按钮(esc)后,VC会发生错误。 – user1847064