概要
raspberry pi 3 でstretchやってみた。
USBカメラやってみた。
写真
環境
Raspberry Pi 3 model B v1.2 element14
2017-09-07-raspbian-stretch
usb camera ELECOM UCAM-DLKT130TRD
接続確認
lsusb
Bus 001 Device 007: ID 03ee:6402 Mitsumi
Bus 001 Device 006: ID 0409:0019 NEC Corp. 109 Japanese Keyboard with Bus-Powered Hub
Bus 001 Device 005: ID 0409:55aa NEC Corp. Hub
Bus 001 Device 004: ID 056e:700f Elecom Co., Ltd
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
カード、デバイスの確認
ls /etc/video*
/etc/video0
opencvインストール
sudo aptitude install python-opencv
サンプルコード
import cv2
c = cv2.VideoCapture(0)
r, img = c.read()
cv2.imwrite('test.jpg', img)
c.release()
以上。