USB Webcam

This notebook shows how to use a USB web camera attached to the Pynq-Z1 board. An image is captured using fswebcam. The image can then be manipulated using the Python Image Library (Pillow).

The webcam used is the Logitech USB HD Webcam C270 and the driver for this webcam has already been installed on the Pynq-Z1 board image.

References

http://pillow.readthedocs.org/en/3.1.x/handbook/tutorial.html
http://manpages.ubuntu.com/manpages/lucid/man1/fswebcam.1.html
http://www.logitech.com/en-us/product/hd-webcam-c270


In [14]:
from PIL import Image as PIL_Image

orig_img_path = '/home/xilinx/jupyter_notebooks/examples/data/webcam.jpg'
!fswebcam  --no-banner --save {orig_img_path} -d /dev/video0 2> /dev/null

img = PIL_Image.open(orig_img_path)
img


Out[14]:

In [15]:
bw_img = img.convert("L")
bw_img


Out[15]:

In [16]:
rot_img = img.rotate(45)
rot_img


Out[16]: