顯現攝影機影像:

#include <cv.h>
#include <highgui.h>
#include <stdio.h>


int main()
{
    CvCapture *capture;
    IplImage *ShowImage;

    capture=cvCreateCameraCapture(0);
    cvNamedWindow("Webcam",0);

    while(true)
    {
        ShowImage= cvQueryFrame(capture);
        cvShowImage("Webcam",frame);
        if(cvWaitKey(20)>0)     break;(寫在opencv的視窗才需要此函式)
    }

    cvReleaseCapture(&capture);
    cvDestroyWindow("Webcam");
}

文章標籤
全站熱搜
創作者介紹
創作者 阿洲 的頭像
阿洲

阿洲程式天地

阿洲 發表在 痞客邦 留言(0) 人氣(51)