1.
#include "stdafx.h"
#include <opencv/highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage * img = cvLoadImage("c:/aaa.png");
cvShowImage("window",img);
cvWaitKey(0);
return 0;
}
2.
#include "stdafx.h"
#include <opencv/highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{ CvCapture * cap=cvCreateCameraCapture(0);
IplImage * img=cvQueryFrame(cap);
while(1){
IplImage * img=cvQueryFrame(cap);
cvShowImage("img",img);
int key=cvWaitKey(33);
if (key==27)break;
}
cvReleaseCapture(&cap);
return 0;
}
沒有留言:
張貼留言