#! /bin/bash
# Last edited on 2023-09-19 09:10:11 by stolfi

# Computes the relative size of the disk face of each image {img} (including "refa" and "refb") 
# by averaring the distances between pairs of reference points in the file "{idir}/{img}.ipts".
# Writes the result to standard output, one line per image,
# in the format "{img} {avgdist}"

idir="$1"; shift

for side in a b; do 
  for img in `cd ${idir} && ls *${side}.ipts | sed -e 's:[.]ipts::g' ` ; do 
    printf "%-12s " "${img}" 
    compute_image_size.gawk < ${idir}/${img}.ipts
  done
done

