By using the webcam
module, you can interact with a webcam device.
from webcam import WebCam
# open and set /dev/video0
camera = WebCam(0)
camera.open()
# capture a frame of picture and save it
content = camera.capture()
content.save("image.png")
camera.close()
You also have access to some controls like brightness, contrast and so on.
print(camera.controls["brightness"])
camera.controls["contrast"] += 1
example.py
provide a GUI to view pictures captured by webcam.