#! /bin/csh -f # Last edited on 2001-11-01 21:03:29 by stolfi # Creates "eps" figures showing the good fit of acquired # outlines. Saves them in glazed-1/tpami-figures cd /l/sdb/staff/stolfi/hcgl/tests-for-export/glazed-1 echo \ 0000/0001/t \ 0000/0002/t \ 0000/0005/t \ 0001/0002/t \ 0002/0003/t \ 0003/0004/t \ 0000/0004/t \ > /dev/null foreach fft ( \ 0004/0005/t \ ) set ff = ${fft:h}; set tag = ${fft:t} set fraga = ${ff:h}; set fragb = ${ff:t} set run = 2 set opts = ( -grid 10.00 -labelSize 0 -displace 0 ) # set opts = ( ${opts} -noColors ) # 000 001 002 004 008 016 032 064 if ( ${tag} == "r" ) then set bands = ( 002 ) else if ( ${tag} == "t" ) then set bands = ( 000 ) set opts = ( ${opts} -noThicker ) # set opts = ( ${opts} -noPointers ) else echo 'bad tag "'"${tag}"'"'; exit 1 endif foreach band ( ${bands} ) # Isolate the candidate from the run results: if ( ${band} == 000 ) then set fullcanfile = results/by-hand/f${band}-${tag}.can else set fullcanfile = results/run-${run}/f${band}-${tag}.can endif set snglcanfile = /tmp/$$-${fullcanfile:t} cat ${fullcanfile} \ | gawk -v fa=${fraga} -v fb=${fragb} \ ' /^(begin|end|lambda|candidates) / { print; next; } \ (($1 == fa+0) && ($6 == fb+0)) { print; next; } \ (($6 == fa+0) && ($1 == fb+0)) { print; next; } \ ' \ > ${snglcanfile}.1 set ncands = `cat ${snglcanfile}.1 | egrep '^[0-9]' | wc -l` echo "found ${ncands} candidates" cat ${snglcanfile}.1 \ | gawk -v nc=${ncands} \ ' /^candidates /{ $3 = nc; } //{print; } ' \ > ${snglcanfile} if ( $ncands == 0 ) exit 1 # Plot the candidate as an EPS file: set epsname = tpami-figures/${fraga}-${fragb}-f${band}-${tag} set flcdir = data/multiscale; set thisopts = ( ) # Compute plot subsampling factor: if ( $band >= 032 ) then set thisopts = ( ${thisopts} -drawEvery 1 -sampleDots ) else if ( $band == 000 ) then set thisopts = ( ${thisopts} -drawEvery 10 ) else @ dc = 32 / ${band} if ( ${dc} == 0 ) set dc = 1 set thisopts = ( ${thisopts} -drawEvery ${dc} ) endif # Ditto for the matching: if ( "${tag}" == "r" ) then if ( $band != 000 ) then @ dm = 64 / ${band} if ( ${dm} == 0 ) set dm = 1 else set dm = 1 endif set thisopts = ( ${thisopts} -drawMatchEvery ${dm} ) endif scripts/run-PZDrawCands-eps \ -show ${opts} ${thisopts} \ -plotSize 140 140 -nominalCandWidth 200 \ ${snglcanfile} \ ${flcdir} ${band} \ ${epsname} # Cleanup garbage: /bin/rm -f ${snglcanfile}.1 ${snglcanfile} end end