心得 ,
一開始用blogger很不習慣,一直問旁邊的同學,不過我覺得Webcam滿好玩的,看到自己的蠢樣出現在螢幕上感覺很好笑,旁邊的神手把程式裡的參數隨便改一下,畫面變成可以隨意拖拉放大,雖然才第一堂課不過感覺還真有趣。
#include
#include
#include
#include
int main()
{
CvCapture *capture;
IplImage *frame;
capture=cvCreateCameraCapture( 0 );
cvNamedWindow("Webcam",1);
cvNamedWindow("Webcam1",1);
cvNamedWindow("Webcam2",1);
cvNamedWindow("Webcam3",1);
while(1)
{
frame = cvQueryFrame(capture);
cvShowImage("Webcam", frame);
cvFlip(frame,frame,0);
cvShowImage("Webcam1", frame);
cvFlip(frame,frame,1);
cvShowImage("Webcam2", frame);
cvFlip(frame,frame,0);
cvShowImage("Webcam3", frame);
cvWaitKey(5);
}
cvReleaseCapture(&capture);
cvDestroyWindow("Webcam");
}
沒有留言:
張貼留言