usb-camera

How to decrease frame rate of USB webcam 2.0 using openCV python

别来无恙 提交于 2021-01-27 13:20:51
问题 I am working on ubuntu 16.04 and using a USB 2.0 webcam. I want to decrease the frame rate somehow since the project I'm working on requires face detection which really lags the video hence want to decrease the frame rate. I've tried implementing the following code import cv2 cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FPS, 15) fps = int(cap.get(5)) print("fps:", fps) while(cap.isOpened()): ret,frame = cap.read() if not ret: break cv2.imshow('frame', frame) k = cv2.waitKey(1) if k == 27: