40
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RaspberryPiでWebカメラ

Last updated at Posted at 2014-10-22

今更ながら、RaspberryPiをいじっています。
Webカメラを動作させてみました。

参考にさせてもらったサイト:pi で遊んでみる (Webカメラ)

Webカメラは、店頭で500円程度の一番安いやつ。
USB接続して、コマンドで確認。

$ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 0411:01a2 BUFFALO INC. (formerly MelCo., Inc.) WLI-UC-GNM Wireless LAN Adapter [Ralink RT8070]
Bus 001 Device 006: ID 1e4e:0103

一番下の"0103"がウェブカメラ…?

画像キャプチャのためのソフトウェアをインストールし、動作させてみる。

$ sudo apt-get install fswebcam
$ fswebcam ./tmp.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to './tmp.jpg'.

tmp.jpg

暗い。初期設定では露出時間が短いみたいですね。
(ウェブカメラの選択失敗したと思いました)
露出時間のオプションをつけて、撮影。

$ fswebcam -F 100 ./tmp.jpg
--- Opening /dev/video0...
Trying source module v4l2...
/dev/video0 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 352x288.
--- Capturing 100 frames...
Captured 100 frames in 6.56 seconds. (15 fps)
--- Processing captured image...
Writing JPEG image to './tmp.jpg'.

tmp1.jpg

うまくピントは合っていないですが、バッチリ撮れました。

40
39
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
40
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?