#! /bin/bash # Last edited on 2008-02-04 20:31:50 by stolfi usage="${0##*/} NAME" # Reads # # "NAME-s.jpg" the small (1/4 size) version of an image, # "NAME.grmap" the (H,V) <-> (X,Y) projective matrices, # "NAME.grays" a file with the centers of gray patches, # # Writes an image "NAME-y.jpg" showing the location of each # gray patch, and its label. # if [ $# -ne 1 ]; then echo "usage: ${usage}"; exit 1; fi name="$1"; shift; batroot="${STOLFIHOME}/projects/fragments/IAB-2002/raw-sorted" tools="${STOLFIHOME}/projects/fragments/IAB-2002/tools" ( cd ${batroot}/. ) img="${batroot}/${name}-s.jpg" if [ ! -r ${img} ]; then echo "no image ${img}"; exit 1 fi grays="${batroot}/${name}.grays" if [ ! -r ${grays} ]; then echo "no graycenters file ${grays}"; exit 1 fi # map="${batroot}/${name}.grmap" # if [ ! -r ${map} ]; then # echo "no ${map}"; exit 1; # fi out="${batroot}/${name}-y.jpg" ycmds="${batroot}/${name}.ycmds" # echo "[draw-graycenters]" ${tools}/draw-graycenters \ -v scale=0.25 \ < ${grays} > ${ycmds} if [ ! -e ${ycmds} ]; then echo "file ${ycmds} not created"; exit 1; fi; # echo "[convert]" convert \ -font '-*-courier-medium-r-*-*-10-*-*-*-*-*-iso8859-*' \ -fill red -draw "@${ycmds}" \ ${img} ${out} if [ ! -e ${out} ]; then echo "image ${out} doesnt exist"; exit 1; fi; # echo "[display]" # display ${out} # /bin/rm -f ${ycmds}