Skip to content

Instantly share code, notes, and snippets.

@unot
Created April 5, 2011 02:22
Show Gist options
  • Save unot/902908 to your computer and use it in GitHub Desktop.
Save unot/902908 to your computer and use it in GitHub Desktop.
色差計算
#!/usr/bin/sh
#
#@(#) deltaE.sh 色差を計算
#@(#) Copyleft 2008, 2009 UNO, Takashi
# Usage: deltaE.sh file1 file2
if [ $# -ne 2 ]; then
echo "Usage: `basename $0` file1 file2" 2>&1
exit 1
fi
#for INFILE in $1 $2; do
# tail -n +8 $INFILE | cut -f1-3 >${INFILE}.lab
#done
paste ${1} ${2} | awk '{ print sqrt(($1 - $4)^2 + ($2 - $5)^2 + ($3 - $6)^2) }'
#rm -f ${1}.lab ${2}.lab
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment