
opencv有没有捕捉摄像头的方法,可以替代以前使用的directShow
1个回答
展开全部
看下这个代码
int cameraId=0; //0 for the webcam and maybe 1 for other USB cam you plugged in. try 0,1,2 if you
//have multiple ones.
VideoCapture capture;
capture.open(cameraId);
if( capture.isOpened() )
{
Mat view0;
capture >> view0;
}
int cameraId=0; //0 for the webcam and maybe 1 for other USB cam you plugged in. try 0,1,2 if you
//have multiple ones.
VideoCapture capture;
capture.open(cameraId);
if( capture.isOpened() )
{
Mat view0;
capture >> view0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询