|
1 year ago | |
---|---|---|
.vscode | 3 years ago | |
doc | 3 years ago | |
fixtures | 1 year ago | |
include | 1 year ago | |
rapidxml | 1 year ago | |
res | 1 year ago | |
src | 1 year ago | |
.gitignore | 3 years ago | |
CMakeLists.txt | 1 year ago | |
README.md | 3 years ago | |
build.sh | 3 years ago | |
clean.sh | 3 years ago | |
run.sh | 1 year ago |
Motion detect on webcam.
Learn differences from previous and current image then trigger action when diff ratio greater than tolerance.
sudo apt install cmake libboost-all-dev libopencv-dev
./build.sh
./run.sh
Identify cam devices
#!/bin/bash
for f in /dev/video*; do
item="$(basename -- $f)"
name="$(cat /sys/class/video4linux/$item/name)"
echo "$f => $name"
done
./run.sh
Display help
./build/camcv --help
Usage camcv [options]:
--help display options
--d arg device id
--t arg threshold
--w arg width
--v arg verbosity
--i arg capture interval
--s arg save image
--ft arg filter type
--fv arg filter value
--gui arg use GUI
--cap arg capture Path
Sample run options
./build/camcv --d 0 --t 1000 --w 320 --v 1 --i 2 --s 1
In this case we :
Check Cpu load
top -c -p $(pgrep -d',' -f camcv)
You can use ffmpeg to consolidate all capture files into a single movie.
ffmpeg -framerate 10 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p consolidate.mp4