openCV程序运行时出现错误unhandled exception怎么解决?
程序如下#include"cv.h"#include"highgui.h"#include<iostream>intmain(intargc,char*argv[]){C...
程序如下
#include "cv.h"
#include "highgui.h"
#include <iostream>
int main(int argc, char* argv[])
{
CvCapture* caps = cvCreateCameraCapture( -1 );
IplImage*frame3,*frame2,*frame1;
frame3 = cvQueryFrame( caps );
IplImage* frame = cvCreateImage( cvGetSize(frame3), IPL_DEPTH_8U, 3 );
for(;;)
{
frame3 = cvQueryFrame( caps );
frame2 = cvCloneImage( frame3 );
frame3 = cvQueryFrame( caps );
frame1 = cvCloneImage( frame3 );
cvAbsDiff(frame1,frame2,frame);
cvThreshold(frame,frame,15,255,CV_THRESH_BINARY);
cvNamedWindow("frame1", CV_WINDOW_AUTOSIZE );
cvShowImage("frame1", frame1 );
cvNamedWindow("frame2", CV_WINDOW_AUTOSIZE );
cvShowImage("frame2", frame2 );
cvNamedWindow("frame", CV_WINDOW_AUTOSIZE );
cvShowImage("frame", frame );
//cvReleaseImage( &frame1 );
////cvReleaseImage( &frame2 );
cvWaitKey(10);
/*cvReleaseImage( &frame1 );
cvDestroyWindow("frame1");
cvReleaseImage( &frame2 );
cvDestroyWindow("frame2");
cvReleaseImage( &frame );
cvDestroyWindow("frame");*/
}
return 0;
}
本来可以运行,后来换了一台电脑就不行了,运行时弹出这个窗口,给位大侠给指点一下怎么解决啊。。。?
图片~ 展开
#include "cv.h"
#include "highgui.h"
#include <iostream>
int main(int argc, char* argv[])
{
CvCapture* caps = cvCreateCameraCapture( -1 );
IplImage*frame3,*frame2,*frame1;
frame3 = cvQueryFrame( caps );
IplImage* frame = cvCreateImage( cvGetSize(frame3), IPL_DEPTH_8U, 3 );
for(;;)
{
frame3 = cvQueryFrame( caps );
frame2 = cvCloneImage( frame3 );
frame3 = cvQueryFrame( caps );
frame1 = cvCloneImage( frame3 );
cvAbsDiff(frame1,frame2,frame);
cvThreshold(frame,frame,15,255,CV_THRESH_BINARY);
cvNamedWindow("frame1", CV_WINDOW_AUTOSIZE );
cvShowImage("frame1", frame1 );
cvNamedWindow("frame2", CV_WINDOW_AUTOSIZE );
cvShowImage("frame2", frame2 );
cvNamedWindow("frame", CV_WINDOW_AUTOSIZE );
cvShowImage("frame", frame );
//cvReleaseImage( &frame1 );
////cvReleaseImage( &frame2 );
cvWaitKey(10);
/*cvReleaseImage( &frame1 );
cvDestroyWindow("frame1");
cvReleaseImage( &frame2 );
cvDestroyWindow("frame2");
cvReleaseImage( &frame );
cvDestroyWindow("frame");*/
}
return 0;
}
本来可以运行,后来换了一台电脑就不行了,运行时弹出这个窗口,给位大侠给指点一下怎么解决啊。。。?
图片~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询