Skip to content

Instantly share code, notes, and snippets.

@tatic0
Created July 28, 2015 16:12
Show Gist options
  • Save tatic0/dc52254d6f9a04b556f0 to your computer and use it in GitHub Desktop.
Save tatic0/dc52254d6f9a04b556f0 to your computer and use it in GitHub Desktop.
generates false color images from grayscale images from Flir Dev Kit (Lepton) infrared sensor
#!/bin/bash
# put all grayscale images on ~/gs
# and create ~/fc for new false color images from this script
# needs imagemagick installed
function gradientgen {
#convert xc:white xc:yellow xc:red xc:green xc:cyan xc:blue xc:violet xc:black +append -filter Cubic -rotate 90 -resize 20x80\! gradient_IR_4-rainbow.jpg
convert xc:white xc:yellow xc:orange xc:red xc:brown xc:cyan xc:blue xc:violet xc:black +append -filter Cubic -rotate 90 -resize 20x80\! gradient_IR.jpg
}
function fcgen () {
convert -verbose $1 \( gradient_IR.jpg -flip \) -clut -resize 500% fc_$1
}
if [ -a gradient_IR.jpg ]
then echo "gradient file exists"
else
gradientgen
fi
for i in ../gs/*.png
do cp -v "$i" gs_`basename $i`
done
for i in *.png
do fcgen "$i"
done
rm -vf gs_*.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment