2019-11-29 19:55:52 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-12-12 12:45:29 +01:00
|
|
|
CMDPATH="/usr/local/bin"
|
|
|
|
|
2020-02-20 10:45:19 +01:00
|
|
|
WS="./tmp" # our workspace
|
|
|
|
|
|
|
|
GRABOPT=" -d /dev/video0 -vu -n 240 -p 0.04 "
|
|
|
|
|
|
|
|
GRAB=${WS}/"quux.fimg"
|
|
|
|
COS01=${WS}/"cos01.fimg"
|
|
|
|
COS010=${WS}/"cos010.fimg"
|
|
|
|
SQRT=${WS}/"sqrt.fimg"
|
|
|
|
POW2="${WS}/pow2.fimg"
|
2019-11-29 19:55:52 +01:00
|
|
|
|
2019-12-12 12:13:21 +01:00
|
|
|
# --------- conversion fimg -> pnm
|
2019-11-29 19:55:52 +01:00
|
|
|
f2p ()
|
|
|
|
{
|
2019-12-12 12:13:21 +01:00
|
|
|
dst=$(basename $1 .fimg).pnm
|
|
|
|
echo == converting $1 to $dst
|
2019-12-12 12:45:29 +01:00
|
|
|
${CMDPATH}/fimg2pnm $1 $dst
|
2019-11-29 19:55:52 +01:00
|
|
|
}
|
|
|
|
|
2019-12-12 12:13:21 +01:00
|
|
|
# --------- capturer une image
|
2020-02-20 10:45:19 +01:00
|
|
|
#
|
|
|
|
${CMDPATH}/grabvidseq ${GRABOPT} -o ${GRAB}
|
2019-12-12 12:13:21 +01:00
|
|
|
echo ERRCODE $?
|
|
|
|
f2p ${GRAB}
|
|
|
|
|
2019-12-12 12:45:29 +01:00
|
|
|
# ----------- traitements
|
2020-02-20 10:45:19 +01:00
|
|
|
#
|
2019-12-12 12:45:29 +01:00
|
|
|
${CMDPATH}/fimgfx pow2 $GRAB $POW2
|
2019-11-29 19:55:52 +01:00
|
|
|
f2p $POW2
|
|
|
|
|
2019-12-12 12:45:29 +01:00
|
|
|
${CMDPATH}/fimgfx sqrt $GRAB $SQRT
|
2019-11-29 19:55:52 +01:00
|
|
|
f2p $SQRT
|
|
|
|
|
2019-12-12 12:45:29 +01:00
|
|
|
${CMDPATH}/fimgfx cos01 $GRAB $COS01
|
2019-11-29 19:55:52 +01:00
|
|
|
f2p $COS01
|
|
|
|
|
2019-12-12 12:45:29 +01:00
|
|
|
${CMDPATH}/fimgfx cos010 $GRAB $COS010
|
2019-12-12 12:13:21 +01:00
|
|
|
f2p $COS010
|
2019-11-29 19:55:52 +01:00
|
|
|
|
2020-02-20 10:45:19 +01:00
|
|
|
# ----------- présentation finale
|
|
|
|
#
|
2019-12-12 12:45:29 +01:00
|
|
|
echo == Making gif89a
|
|
|
|
convert -delay 40 *.pnm foo.gif
|