#! /bin/sh
#
# SparseLab Pandore toolbox
#
# GREYC IMAGE
# 6 Boulevard Marechal Juin
# F-14050 Caen Cedex
#
# Please to email any bugs, comments, and/or additions to this file see:
# http://www.greyc.ensicaen.fr/EquipeImage/Pandore
#
#(C) Jalal Fadili - 2007-05-31
#
# Forward and inverse wave atom transform examples.
# Display numerical reconstruction error.

input=../../data/fingerprint.pan

echo ------------------------------------
echo Fast orthogonal wave atom transform
echo ------------------------------------

echo 'Forward transform tp = [1 1] (output structure)'
time ../../bin/fatom2 p 1 1 ${input} c.pan
echo 'Inverse transform tp = [1 1]'
time ../../bin/iatom2 p 1 1 c.pan rec.pan
# Display numerical reconstruction error.
psub ${input} rec.pan |penergyvalue -
err=`pstatus`
echo MSE of reconstruction is $err

echo 'Forward transform tp = [-1 1] (output structure)'
time ../../bin/fatom2 p -1 1 ${input} c.pan
echo 'Inverse transform tp = [-1 1]'
time ../../bin/iatom2 p -1 1 c.pan rec.pan
# Display numerical reconstruction error.
psub ${input} rec.pan |penergyvalue -
err=`pstatus`
echo MSE of reconstruction is $err

echo 'Forward transform tp = [1 -1] (output image)'
time ../../bin/fatom2sym p 1 -1 ${input} c.pan
echo 'Inverse transform tp = [1 -1]'
time ../../bin/iatom2sym p 1 -1 c.pan rec.pan
# Display numerical reconstruction error.
psub ${input} rec.pan |penergyvalue -
err=`pstatus`
echo MSE of reconstruction is $err

echo 'Forward transform tp = [-1 -1] (output image)'
time ../../bin/fatom2sym p -1 -1 ${input} c.pan
echo 'Inverse transform tp = [-1 -1]'
time ../../bin/iatom2sym p -1 -1 c.pan rec.pan
# Display numerical reconstruction error.
psub ${input} rec.pan |penergyvalue -
err=`pstatus`
echo MSE of reconstruction is $err


echo -------------------------------------------------------
echo Fast wave atom tight frame transform with redundancy 2
echo -------------------------------------------------------

echo 'Forward transform (output image)'
time ../../bin/fatomfm2sym p ${input} c.pan
echo 'Inverse transform'
time ../../bin/iatomfm2sym p c.pan rec.pan
# Display numerical reconstruction error.
psub ${input} rec.pan |penergyvalue -
err=`pstatus`
echo MSE of reconstruction is $err


rm {c,rec}.pan

