Can't access webcam with OpenCV

后端 未结 8 1165
死守一世寂寞
死守一世寂寞 2020-11-29 10:11

I\'m using OpenCV 2.2 with visual studio 2010 on a win 7 64 bit pc.

I\'m able to display pictures and play AVI files through OpenCV as given in the book \"Learning O

8条回答
  •  甜味超标
    2020-11-29 10:22

    Once you create the cv::VideoCapture you should give an integer not a string (since string implies the input is a file).

    To open the default camera, open the stream with

    cv::VideoCapture capture(0); 
    

    and it will work fine.

提交回复
热议问题