Skip to content

Model building walkthrough

cpb8010 edited this page Jul 25, 2013 · 4 revisions

Notes on the ASM Building Process

This covers the small changes made to VOSM's model building, particularly multichannel ASM profiles.

test_smbuilding

This sample main program can be used with no modification to produce complete models given a set of images and annotations. The correct usage of the program is given at the command line, but for completeness the arguments will be repeated here. Usage: test_smbuilding -o save_directory -a annotation_directory -i image_directory -s shapeinfo_path -d database -c channels -t type -l levels -p percentage

  • -o
    • output directory (default './'). Creates multiple files and folders that compose the model at this directory, must be created before running or else the program crashes.
  • -a
    • annotation directory (required). This can be the same directory as the images, but the file extensions should be consistent and the file names should match the images. Mismatches may cause the building program to crash, or it may just produce an incorrect model if not aligned. Supported extensions are .pts .asf .obj .wrl
  • -i
    • image directory (required). Supported image extensions are .jpg .bmp .ppm .pgm .png .gif .tif. These are read by OpenCV's imread, limitations of this function are system dependant. Read more here for details.
  • -s
    • path of the file shapeinfo (required). Special VOSM config file explained here
  • -d
    • training database (required, IMM, AGING, BIOID, XM2VTS, FRANCK, EMOUNT, JIAPEI, BOSPHORUS ) JIAPEI format is the simpliest, documented here
  • -c
    • channels (1, 2, or 3, default 3) Specifcying two creates a two channel model from a 3 channel image.
  • -t
    • statistical model type (SM, TM, AM, IA, FM, SMLTC, SMNDPROFILE. default SMNDPROFILE ). These match to similar fitting techniques in the fitting program. Models built with one type won't be able to fit using another technique. SMNDPROFILE is the only supported multichannel fitting technique.
  • -l
    • level of pyramid (default 4). This scales the original image to 1/4 of it's size when doing initial shape placement, and then slowly scales back up as the fit improves. For images of low resolution or high-accuracy initial shape placement, fewer pyramid levels are needed. Not all pyramid levels may be used by the fitting program if the model parameter is manually overwritten.
  • -p
    • percentage of shape, texture and appearance PCA (default 0.95). Higher percentages yield more accurate reconstructions, but may contain more noise.

Multichannel differences

The ASM building process originally supported a 3rd profile line, this was re-purposed to hold a second dimension instead. The order of the profiles is dependant on the number of channels and number of profile directions. Up to three channels and two profile directions should work, with sequential channels stored before directions. So an example storage would be 1st channel normal, 1st channel tangent, 2nd channel normal, 2nd channel tangent.