Motion(動体検知)を試す。

1.環境

 CPU : Intel(R) Core(TM)2 CPU 6320  @ 1.86GHz

 メモリ:4GB

 OS:Fedora release 14 (Laughlin)

   USBカメラ:UCAM-DLA200H

 

2.インストール

■リポジトリ追加

# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

 

■motionのインストール

# yum install motion

 

■サービスを起動

# /etc/rc.d/init.d/motion start

 

■動作確認

ブラウザで、ローカルから接続する。

http://localhost:8081

 

■設定変更

 以下の箇所を変更。

# Maximum number of frames to be captured per second.
# Valid range: 2-100. Default: 100 (almost no limit).
# framerate 2
framerate 30

 

# Threshold for number of changed pixels in an image that
# triggers motion detection (default: 1500)
threshold 100

 

# Output 'normal' pictures when motion is detected (default: on)
# Valid values: on, off, first, best, center
# When set to 'first', only the first picture of an event is saved.
# Picture with most motion of an event is saved when set to 'best'.
# Picture with motion nearest center of picture is saved when set to 'center'.
# Can be used as preview shot for the corresponding movie.
# output_normal on
output_normal off

 

# Draw the number of changed pixed on the images (default: off)
# Will normally be set to off except when you setup and adjust the motion settings
# Text is placed in upper right corner
# text_changes off
text_changes on

 

# Restrict webcam connections to localhost only (default: on)
#webcam_localhost on
webcam_localhost off

 

■サービスの再起動

# /etc/rc.d/init.d/motion restart

動作例
動作例

3.メモ

・USBカメラをLinuxで使う場合は、UVC対応のものを選ぶ。

 

・カーネルモジュールの確認

 以下のドライバがロードされていることを確認する。

 # lsmod

 ----------------------------------------------------------

 uvcvideo               56105  1
 videodev               69118  2 uvcvideo
 v4l2_compat_ioctl32     7665  1 videodev

 ----------------------------------------------------------

 

・ログの確認

 /var/log/message

 ----------------------------------------------------------

Aug 12 19:13:17 localhost kernel: [  173.366670] uvcvideo: Found UVC 1.00 device Venus USB2.0 Camera (056e:700a)
Aug 12 19:13:17 localhost kernel: [  173.368550] input: Venus USB2.0 Camera as /devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4:1.0/input/input3

 ----------------------------------------------------------

 

・USBデバイスの確認

 # lsusb
 Bus 002 Device 002: ID 0bda:0151 Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

・UVCの仕様

 http://www.usb.org/developers/devclass_docs

 

・Motion

 http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

写真素材のピクスタ