import cv
capture = cv.CaptureFromCAM(-1)
frame = cv.QueryFrame(capture)
cv.SaveImage( "Test.png", frame)
The -1 on the second line works if you only have one webcam otherwise you will have to specify the one you want to capture from...and since they move around...you have to add logic for that as well.
This is the basics of what I need but I have been chasing a problem with the webcam on the RPi for a while. Namely that the first image is exposed correctly and all subsequent images are extremely under exposed. This persists until the RPi is rebooted or the webcam unplugged and plugged back in.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTTbrty-VYtEjQykiKXuWluWHnP31lFFoOGSkyGOztOY_RlgTzs6RTI0wjsqMrw4HOsSqZOgjxeYXNMHNxnF87sdYx_Eif5V6TIPCTCF3wfVdRz5mfrQs4IoyEpAwl89Ur_uQgtW6MWcVY/s200/WebCam.jpg)
Obviously I can get another webcam but I do have a problem that you can see to the right. I seriously doubt that my wife will happily watch me disassemble her webcam for this project!
No comments:
Post a Comment