Bei Verwendung in einem Befehl Installieren Sie fswebcam.
sudo apt install fswebcam
fswebcam photo.jpg
Bei Verwendung mit Python Installieren Sie opencv.
/etc/apt/sources.list
deb http://ftp.jaist.ac.jp/raspbian jessie main contrib non-free
deb http://ftp.yz.yamagata-u.ac.jp/pub/linux/raspbian/raspbian/ jessie main cont
rib non-free
sudo apt install libopencv-dev
sudo apt install python-opencv
usb_camera.py
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# usb_camera.py
#
# Jun/06/2017
# --------------------------------------------------------------------
import sys
import cv2
#
sys.stderr.write("***Start***\n")
#
cc = cv2.VideoCapture(0)
#
rr, img = cc.read()
cv2.imwrite('photo.jpg', img)
#
sys.stderr.write("***Ende***\n")
# --------------------------------------------------------------------
Recommended Posts