2013年2月27日 星期三

陳品如_98160726,HW02


今天學到了用openCV開啟一張圖與抓取視訊。



#include "stdafx.h"
#include <opencv/highgui.h>

int _tmain(int argc, _TCHAR* argv[])
{
IplImage * img=cvLoadImage("c:/12345.jpg");
cvShowImage("windw",img);
cvWaitKey(0);
printf("hello");
system ("pause");
return 0;
}






#include "stdafx.h"
#include <opencv/highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
CvCapture * cap = cvCreateCameraCapture(0);
IplImage * img = cvQueryFrame(cap);
while(1){
img = cvQueryFrame(cap);
cvShowImage("img",img);
int key = cvWaitKey(33);
if(key==27) break;
}
cvReleaseCapture(&cap);
return 0;
}



沒有留言:

張貼留言