LoginSignup
4
6

More than 5 years have passed since last update.

python3 で、Raspberry Pi 用カメラモジュールを使う

Last updated at Posted at 2017-06-05

ユーザーを、video グループに加える

sudo gpasswd -a user video

コマンドで撮影

raspistill -o a01.jpg

python3 のライブラリーをインストール

sudo apt install python3-picamera

python3 のソース

capture.py
#! /usr/bin/python3
# -*- coding: utf-8 -*-
#
#   capture.py
#
#                       Jun/06/2017
# --------------------------------------------------------------------
import sys
import picamera
# --------------------------------------------------------------------
sys.stderr.write("*** 開始 ***\n")
#
width = 800
height = 600
cam = picamera.PiCamera()
cam.resolution = (width, height)
cam.capture("photo.jpg") 
#
sys.stderr.write("*** 終了 ***\n")
# --------------------------------------------------------------------
4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6