-
Notifications
You must be signed in to change notification settings - Fork 22
cam_camcap.py
The script camcap.py is designed to be called by cron at regular intervals to take a photo using a webcam.
Specify the settings file created by the gui camera config tools.
set=/home//Pigrow/config/camera_settings.txt set=camera_settings.txt
If none are supplied it will default to the above.
Set caps folder
caps=/home//Pigrow/caps/
images will be stored here with the name cap_.jpg
The amount of times it tries to take a picture before giving up
attempts=3
The location of the error log to record problems.
errlog=/home/<PATH>/Pigrow/logs/err_log.txt
The settings file is created in the gui camera tab, it's a simple key=value list.
FSWebcam is able to set all the webcam specific commands which are unique to each model, the basic controls are fairly standard but do sometimes differ also each device has it's own selection of settings depending on it's capabilities - focus controls and etc.
When the webcam is connected to the raspberry pi the gui will be able to poll the webcam for a list of settings and use these to create the controls, how these controls work and the values used is likely to depend on your camera.
When taking a photo with FSWebcam camcap.py creates a command string adding these in the format
--set "contrast=20" --set "autofocus=False"
there are also some settings in the file which are used to control the behaviour of FSWebcam
resolution= image resolution
cam_num= which webcam to use
fs_delay= how long to wait for the image to settle down before taking a picture
fs_fskip= how many frames to skip before taking a picture
fs_banner=False remove the banner showing the time the image was taken
some webcams take a while to settle down after initialization, if your images aren't coming out right you can experiment with longer delay and frame skip options.