移动物体监控系统-sprint3移动监控主系统设计与开发
一、移动监控的原理
通过获取摄像头图像,比较前后每一帧的图像数据,从而实现移动物体监控。所有移动监控原理都是这样,只是图像帧的对比的算法不一样。
二、移动物体监控系统的实现
选择开源的移动监控软件motion,移植到开发板上
step1:解压源码,进入到目录里面运行 ./configure --prefix=${PWD}/_install / --host=arm-linux
[notes]:编译时error:Mysql support can`t build without Mysql libraries
在 ./configure --prefix=${PWD}/_install / --host=arm-linux --without -mysql
再次编译出现新的error:postgreSQL support can`t build without postgreSQL libraries
在./configure --prefix=${PWD}/_install / --host=arm-linux --without -mysql --without -pgsql
step2:make \make install,将生成库和头文件安装到指定的./install目录下,在/_install/bin/目录下生成的可执行文件motion
step3:将可执行文件拷贝到根文件系统/rootfs/sbin/目录下,将配置文件motion_dist_conf(/_install/etc/)复制到根文件目录/rootfs/中
step4:移植配置motion的参数 打开根文件系统中的motion_dist_conf,修改内容如下
a.更改驱动设备文件 /dev/vedio0
b.改变图下个存储格式为 MJPEG
c.图像大小 640*480
d.framerate 15 每秒最大捕获帧树
e.threshold 1500 当检测到像素变化超过该值时触发motion
f.locate on 使用方框框出移动的物体
g.target_dir /mnt/sd 设置图片保存目录
step5:运行motion motion -c/motion-dist.conf即可捕获到物体
step6:关联报警功能:在motion_dist_conf配置文件中,配置项on_motion_detected后面加上"madplay alarm.mp3",发现移动物体即触发调用程序madplay alarm.mp3,实现报警功能。
step7:视频捕捉(ffmpeg开源库),使其支持ffmpeg抓取视频的功能
a.解压配置./configure --prefix=./_install / --arch=arm --cross -prefix=arm-linux- --enable-shared (不支持--host)
b.make \make install,将生成库和头文件安装到指定的./install目录下,在/_install/lib/目录下生成的库文件
c.将库文件拷贝到根文件系统/rootfs/lib/目录下
d.重新配置motion (make distclean清除配置), ./configure --prefix=${PWD}/_install / --host=arm-linux --with-ffmpeg=/当前目录/ --without -mysql --without -pgsql
e.重新编译运行motion -c/motion-dist.conf,即可、
流程:移植motion->配置motion_dist_conf选项-->关联报警功能-->移植视频捕捉包ffmpeg

浙公网安备 33010602011771号