#! /bin/bash # Last edited on 2008-02-04 20:32:02 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.balls" a file with the centers of bases of light calib. balls, # # Writes an image "NAME-b.jpg" showing the location of each # light calibration ball 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 balls="${batroot}/${name}.balls" if [ ! -r ${balls} ]; then echo "no lightballs file ${balls}"; exit 1 fi # map="${batroot}/${name}.grmap" # if [ ! -r ${map} ]; then # echo "no ${map}"; exit 1; # fi out="${batroot}/${name}-b.jpg" bcmds="${batroot}/${name}.bcmds" # echo "[draw-lightballs]" ${tools}/draw-lightballs \ -v scale=0.25 \ < ${balls} > ${bcmds} if [ ! -e ${bcmds} ]; then echo "file ${bcmds} not created"; exit 1; fi; # echo "[convert]" convert \ -font '-*-courier-medium-r-*-*-10-*-*-*-*-*-iso8859-*' \ -fill red -draw "@${bcmds}" \ ${img} ${out} if [ ! -e ${out} ]; then echo "image ${out} doesnt exist"; exit 1; fi; # echo "[display]" # display ${out} /bin/rm -f ${bcmds}