OpenCV —— Calling Cameras

来源:互联网 发布:公司名义开淘宝店 编辑:程序博客网 时间:2024/06/07 23:17

Before you call two or more camera You have got to ensure the cameras to use different HUB!

//Here hide some headers and common callingsint main(){    VideoCapture cap(0);    while(1)    {        Mat frame;        cap >> frame;        imshow("camera",frame);        if(waitKey(0) == 27)break;    }    return 0;}

If you want to use more usb-cameras to show image,you just need to replace cap(0) with cap(1)(take two cameras for example).And you also need to call one more Mat variary to receive the data-stream.

0 0
原创粉丝点击