FloatImg/scripts/contrast-test.sh

47 lines
814 B
Bash
Raw Normal View History

2019-11-29 19:55:52 +01:00
#!/bin/bash
2019-12-12 12:45:29 +01:00
CMDPATH="/usr/local/bin"
2021-05-20 08:36:55 +02:00
WS="${HOME}/TMP" # our workspace
2021-05-20 08:36:55 +02:00
GRABOPT=" -d /dev/video0 -v -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 ()
{
2021-05-20 08:36:55 +02:00
dst=EC_$(basename $1 .fimg).pnm
2019-12-12 12:13:21 +01:00
echo == converting $1 to $dst
2021-05-20 08:36:55 +02:00
${CMDPATH}/fimg2pnm $1 ${WS}/$dst
2019-11-29 19:55:52 +01:00
}
2019-12-12 12:13:21 +01:00
# --------- capturer une image
#
${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
#
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
# ----------- présentation finale
#
2019-12-12 12:45:29 +01:00
echo == Making gif89a
2021-05-20 08:36:55 +02:00
convert -delay 40 ${WS}/EC_*.pnm foo.gif