您的位置:首页 > 运维架构 > Linux

Linux下OpenCV设置摄像头帧率FPS

2017-07-03 16:09 931 查看
通常情况下调用
cap.set(cv2.cv.CV_CAP_PROP_FPS ,10)
是不会起作用的,可以尝试使用如下方法:

CV_CAP_PROP_FPS is a NOT a fake. See cap_libv4l.cpp(源码) in OpenCV github repo. The key is to make sure, you use libv4l over v4l while configuring OpenCV. For that, before running cmake, install libv4l-dev

sudo apt-get install libv4l-dev


Now while configuring OpenCV with cmake, enable option,
WITH_LIBV4L
. If all goes good, in configuration status, you will see some thing similar to below

V4L/V4L2: Using libv4l1 (ver ) / libv4l2 (ver )


And then while building your OpenCV code, you will have to link with libv4l1/libv4l2/libv4lconvert.

Arbitary FPS values at the resolutions you choose, needn’t be supported by your webcam. You may check supported resolutions/fps with a graphical tools like cheese or commands like lsusb (2)

参考文献:

How to set camera FPS in OpenCV? CV_CAP_PROP_FPS is a fake
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  opencv