2020-10-06 22:01:48 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-09 10:26:07 +11:00
|
|
|
src=/dev/shm/foo.fimg
|
|
|
|
out=out.fimg
|
2021-02-01 02:04:42 +11:00
|
|
|
device=/dev/video2
|
2020-10-09 10:26:07 +11:00
|
|
|
|
2021-02-01 02:04:42 +11:00
|
|
|
maxi=59
|
2020-10-28 23:00:12 +11:00
|
|
|
W="320"
|
|
|
|
H="240"
|
2021-02-01 02:04:42 +11:00
|
|
|
grabopt=" -s ${W}x${H}w -vv -d $device -p 0 -n 30
|
|
|
|
0 -c none "
|
2020-10-07 20:32:23 +11:00
|
|
|
|
2020-10-09 10:36:04 +11:00
|
|
|
mkdir /tmp/V
|
2021-02-01 02:04:42 +11:00
|
|
|
rm /tmp/V/*
|
2020-10-06 22:01:48 +11:00
|
|
|
|
2020-10-09 10:26:07 +11:00
|
|
|
G=$(printf "%dx%d+0+0" $W $H)
|
|
|
|
|
2020-10-06 22:01:48 +11:00
|
|
|
for foo in $(seq 0 $maxi)
|
|
|
|
do
|
|
|
|
|
2020-10-10 10:26:42 +11:00
|
|
|
echo ; echo
|
2020-10-08 00:26:34 +11:00
|
|
|
|
2020-10-07 01:30:42 +11:00
|
|
|
grabvidseq -$grabopt -o $src
|
|
|
|
|
2020-10-06 22:01:48 +11:00
|
|
|
fval=$(echo "$foo / $maxi" | bc -l)
|
2021-02-01 02:04:42 +11:00
|
|
|
echo $foo ' => ' $fval
|
|
|
|
|
|
|
|
./t -vv -k $fval -o $out classif $src
|
2020-10-06 22:01:48 +11:00
|
|
|
|
2020-10-27 02:45:36 +11:00
|
|
|
# fimgstats $out
|
2020-10-06 22:01:48 +11:00
|
|
|
|
2020-10-09 10:36:04 +11:00
|
|
|
dst=$(printf "/tmp/V/%03d.png" $foo)
|
2020-10-20 09:28:33 +11:00
|
|
|
echo $dst
|
|
|
|
montage $src $out -tile 1x2 -geometry $G $dst
|
2020-10-06 22:01:48 +11:00
|
|
|
|
2021-02-01 02:04:42 +11:00
|
|
|
sleep 2
|
|
|
|
|
2020-10-06 22:01:48 +11:00
|
|
|
done
|
|
|
|
|
2020-10-20 09:28:33 +11:00
|
|
|
convert -delay 10 /tmp/V/*.png foo.gif
|
2021-02-01 02:04:42 +11:00
|
|
|
|
|
|
|
rm /tmp/V/*
|
|
|
|
|