Last edited on 2009-01-30 03:07:13 by stolfi Processing the IAB-2002 fragment pictures 01 - Renaming, sorting, and indexing the raw images RENAMING AND SORTING THE RAW IMAGES The raw images were manually grouped into batches and given systematic names based on their attributes (fragment set, viewpoint, lighting conditions, and fragment pose). This information was saved in the file "coords/image-batches.bash". Through the script "tools/classify-images", the raw images were copied and given names of the form "{G}/{K}/{B}/{I}.jpg" where {G} = the "publishing group" for the image (see below). {K} = the kind of batch (see below). {B} = image batch number (sequential from "000" within each kind) {I} = systematic name (of varying length) for image within batch. The publishing groups are meant to segregate images which should be placed in separate CD-ROMS and/or WWW sites. Currently the groups are "PUB" = images for the general public; basically whole objects. "TEC" = latest images of fragments, with fairly complete and optimized stages, suitable for technical processing. "PRE" = older images of fragments, with some procedural problems such as incomplete stages, bad lighting, bad views, etc.. "ETC" = miscellaneous images of little technical value: out of focus, people and rooms, fragment piles, etc.. The systematic name {I} depends on the kind of batch ({K}). It is typically created from the following attribute tags: {S} = fragment side ("f" or "v"). {E} = camera position ("0" = at left, "1" = at right). {L} = light position ("a" = from southeast, "b" = northwest, "c" = west). {R} = rotation of object around its vertical axis (0-9). {P} = arbitrary view/pose/lighting of object (00-99). {X} = id number for "extraneous" image (00-99). Here are the batch kinds {K} used so far, and the corresponding image name patterns: "stds/{B}/{S}{E}{L}.jpg" Standard batch of 12 pictures (2 eyes x 2 sides x 3 lights), almost vertical view, with or without calibration targets. Intended for both geometric and photometric stereo. "mirr/{B}/r{R}.jpg" Batches taken with mirror stand, oblique view, with various rotations {R} of object around vert axis. Intended for mirror-image geometric stereo. "mult/{B}/p{P}.jpg" Batches of multiple views of a single object, under non-systematic variations of object pose, lights, and camera. Possibly adequate for 3D reconstruction, with advanced techniques. "void/{B}/{L}.jpg" Test images with empty stand, under lighting {L}. "objs/{B}/p{P}.jpg" Batch of images of a whole object, in various poses, lightings, and camera positions. Intended mostly for public display rather than 3D reconstruction. "misc/{B}/{I}.jpg" Miscellaneous images, not part of any batch. Occasionally a batch includes extra images (e.g. an out-of-focus version that was shot again later). Those images get the same name as the corresponding "correct" shot, plus a suffix "-x0", "-x1", etc. If one or more attributes of an extra image are unknown or not valid (e.g. non-standard lighting), their tags are replaced "z"s in the file name. The browse and icon versions were renamed too: if "{A}.jpg" is a copy/link of "DSC{N}.JPG", then "{A}-s.jpg" is a copy/link of "DSC{N}-s.JPG" "{A}-e.jpg" is a copy/link of "DSC{N}-e.JPG" "{A}-i.jpg" is a copy/link of "DSC{N}-i.JPG". INDEX OF CLASSIFIED IMAGES The following commands create a table showing the correspondence between RAW and reclassified images: cat coords/image-batches.bash \ | gawk \ ' /^ *([#]|$)/{ next; } \ /^makebatch/{ ndir = $2; odir = $3; next; } \ /^[ ]*DSC[0-9]*[.](JPG|TIF)/ { \ ofile = $1; nfile = $2; group = $3; cmt = $4; \ gsub(/[.](JPG|TIF)$/, "", ofile); \ gsub(/[.](jpg|tif)*$/, "", nfile); \ printf "RAW/%s/%s %s/%s/%s # %s\n", \ odir,ofile, group,ndir,nfile, cmt; \ next; \ } \ /eob/{ ndir = "???"; odir = "???"; next; } \ // { \ printf "**bad line \"%s\"\n", $0 > "/dev/stderr"; \ } \ ' \ | sort \ > raw-to-sorted.tbl Checking whether all images are where they are supposed to be: cat raw-to-sorted.tbl \ | gawk '//{ printf "%s.JPG\n", $1; }' \ > .raw-images ls -l `cat .raw-images` > .raw-ls cat raw-to-sorted.tbl \ | gawk '//{ printf "%s.jpg\n", $2; }' \ > .sorted-images ls -l `cat .sorted-images` > .sorted-ls ls -lL `cat .sorted-images` > .sorted-lsL