#! /bin/bash # Last edited on 2008-02-04 20:31:43 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.fctrs" a file with fragment numbers and nominal centers, # # Writes an image "NAME-f.jpg" with a circle around each fragment, # and the number underneath. # 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 fctrs="${batroot}/${name}.fctrs" if [ ! -r ${fctrs} ]; then echo "no fragcenters file ${fctrs}"; exit 1 fi # map="${batroot}/${name}.grmap" # if [ ! -r ${map} ]; then # echo "no ${map}"; exit 1; # fi out="${batroot}/${name}-n.jpg" fcmds="${batroot}/${name}.fcmds" # echo "[draw-fragcenters]" ${tools}/draw-fragcenters \ -v scale=0.25 \ < ${fctrs} > ${fcmds} if [ ! -e ${fcmds} ]; then echo "file ${fcmds} not created"; exit 1; fi; # echo "[convert]" convert \ -font '-*-courier-medium-r-*-*-10-*-*-*-*-*-iso8859-*' \ -fill yellow -draw "@${fcmds}" \ ${img} ${out} if [ ! -e ${out} ]; then echo "image ${out} doesnt exist"; exit 1; fi; # echo "[display]" # display ${out} # /bin/rm -f ${fcmds}