# Last edited on 2008-03-21 09:07:56 by stolfi Processing test images for photometric stereo 2007-06-29 IC-UNICAMP Two sets of images were taken by Jorge Stolfi and Rafael Saracchini on 2007-06-29. The scene consists of three mouse balls and two cardboard shapes. Mouse ball g-ms-a was originally black. It was lightly painted with white correcting fluid, so that it got a smooth surface but blotchy albedo varying from near black to near white. Mouse ball g-ms-b, originally gray, was painted with white correcting fluid so that it became fully white. The paint was fairly thick, so the surface became noticeably bumpy. Mouse ball g-ms-b, gray, was used without modification. It has a slightly uneven color and an dark "equator", which in the scene was tilted some 45 degrees from horizontal. The mouse balls wer placed on shiny back plastic pedestals. The scene also included a three-sided pyramid and a cone, made with thick paper. The shapes were visibly imperfect. Some coloed letters were painted on the cone with felt-tip pen. The pyramid had some text and diagrams printed on it, in red and black. The objects were placed over a gridded graph paper, off-white with light gray lines, spaced 3 mm apart. Pictures taken with Sony Cyershot DSC-W50 camera, "fine" resolution. Camera was mounted on the photo-stand, activated manually (without timer). Flash was turned off. Illumination provided by a 500 W halogen lamp, hand-held at different positions. Lamp-to-scene distance about 1 m. The pictures were originally named DSC00615.JPG through DSC00655.JPG by the camera (downloaded through Rafael's gizmo), then renamed with lowercase ("dsc00{NNN}.jpg") for compatibility with previous runs. They were placed in two directories bpyco-a 23 photos (615 -- 637). Camera placed about 60 cm from objects. bpyco-b 18 photos (638 -- 655). Camera placed about 35 cm from objects. Generating the reduced pictures: cd ${STOLFIHOME}/projects/photostereo/test-images foreach s ( photo/bpyco-a photo/bpyco-b ) foreach f ( `cd $s && ls dsc00???.jpg` ) echo $s/$f convert $s/$f -resize '50%' $s/${f:r}-r.png end end Extracting the image information: foreach s ( photo/bpyco-a photo/bpyco-b ) foreach f ( `cd $s && ls dsc00???.jpg` ) set ifile = "$s/${f:r}.info" set efile = "$s/${f:r}.exif" echo $s/$f ' -> ' $ifile $efile identify -verbose $s/$f > $ifile end end Moved original images to depot/2007-06-29-uec Renamed derived images "dsc00{NNN}-r.png", "dsc00{NNN}.info" to "f-{MM}.png", "f-{MM}.info": mv -vi photo/bpyco-a/{dsc00615-r,f-00}.png mv -vi photo/bpyco-a/{dsc00616-r,f-01}.png ... mv -vi photo/bpyco-a/{dsc00637-r,f-22}.png mv -vi photo/bpyco-b/{dsc00638-r,f-00}.png mv -vi photo/bpyco-b/{dsc00639-r,f-01}.png ... mv -vi photo/bpyco-b/{dsc00655-r,f-17}.png ALIGNING THE IMAGES We mist extract four sub-images 32x32 near the corners to find the best possible alignment. # sz = Size of extracted images # mr = Distance from border set mr = 32 set sz = 32 @ hx = ( 816 - ${mr} ) - ${sz} @ hy = ( 612 - ${mr} ) - ${sz} echo ${hx} ${hy} foreach dir ( photo/bpyco-a photo/bpyco-b ) foreach f ( `cd $dir && ls f-??.png` ) foreach dx ( $mr $hx ) foreach dy ( $mr $hy ) set ifile = ${dir}/${f} set ofile = `printf "%s/%s-%04d-%04d.png" ${dir} ${f:r} $dx $dy` echo "${ifile} -> ${ofile}" convert ${ifile} -crop "${sz}x${sz}+${dx}+${dy}!" -colorspace GRAY -normalize ${ofile} end end display -title '%f' -resize '400%' ${dir}/${f:r}-*.png end end display -title '%f' -resize '400%' photo/bpyco-a/f-??-0032-0032.png &