test.sh
author viric@mandarina
Mon, 01 Dec 2008 20:25:09 +0000
changeset 248 e07157da85c9
parent 3 192fd737c4fc
permissions -rwxr-xr-x
Corregits alguns errors, després d'una nova revisió. Completa.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     1
#!/bin/sh
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     2
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     3
if [ $# -ne 2 ]; then
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     4
	echo "usage: $0 <quality> <basefilename>"
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     5
	exit 1
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     6
fi
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     7
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     8
BASE=$2
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
     9
QUALITY=$1
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    10
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    11
set -o xtrace on
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    12
# Program for getting the error of grads-c
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    13
make $BASE.pgm
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    14
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    15
if [ ! -f $BASE.pgm ]; then
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    16
	echo "Wrong basefilename..."
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    17
	exit 1
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    18
fi
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    19
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    20
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    21
cjpeg -quality $QUALITY $BASE.pgm >$BASE-jpg.jpg
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    22
#jpegtopnm $BASE-jpg.jpg | ppmtopgm >$BASE-jpg.pgm
3
192fd737c4fc It was nonsense using "-onepass" on djpeg. Removed.
viric@llimona
parents: 1
diff changeset
    23
djpeg -pnm $BASE-jpg.jpg | ppmtopgm >$BASE-jpg.pgm
1
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    24
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    25
tools/pgm2errormat $BASE.pgm $BASE-jpg.pgm >error.mat
73432b1eac4a Initial commit. The error matrix between two PGMs can be calculed.
viric@llimona
parents:
diff changeset
    26
tools/mat2pgm <error.mat >error.pgm