Being a python beginner I think I'm missing something regarding the picamera use and opencv's cv2 or am I just being a nump(t)y ?
Isn't cv2 aimed at usb camera usage and not the picamera so calls to cv2.VideoCapture(0) give: TypeError Required argument 'device' (pos 1) not found.
Thanks
Adam
Originally we did use the
picamera
module to get the video feed.The trouble is that we did not seem to be able to get enough speed out of it at higher frame rates.
We changed to using the standard OpenCV interface for accessing cameras to get around this problem.
The
cv2.VideoCapture
class works with any attached camera which supports Video4Linux (V4L).By default the Pi Camera does not have Video4Linux support, but a driver has been written already for it.
Our script (
Formula.py
) loads this driver using the command:sudo modprobe bcm2835-v4l2
before trying to talk to the camera.The simulator also uses this interface to open a network stream for processing images.
Ah great, thanks for clearing that up.
Adam
Add new comment