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