Vision and Mobile Robotics Laboratory | Software
|
|
Home | Members | Projects | Publications | Software | Videos | Internal |
StackMaker is an interactive display program that creates spin-image stacks for surfaces to be registered with SpinRecognize. StackMaker serves two purposes. Its first purpose is to create spin-image stacks for surfaces aligned with SpinRecognize. Its second purpose is to provide a display tool for analyzing and understanding the spin-image generation process.
After StackMaker has generated or read in a stack of spin-images for a model, a display tool pops up. The display tool has two viewers. On the right is the Mesh Viewer which shows the model surface mesh; the model mesh can be moved around and viewed from different positions. The current oriented point is shown in red. On the left is the Image Viewer which displays the spin-image corresponding to the current oriented point; the image can be translated and zoomed. Clicking with the left mouse button on the model in the mesh viewer changes the current oriented oriented points and its spin-image.
StackMaker.c contains all of the functionality for creating and displaying spin-image stacks generated using StackMaker. It handles mouse and keyboard events and spin-image animation.
By typing 'StackMaker -' the following options (format description default) are printed:
Usage: StackMaker (See StackMaker.html for complete usage)
%S set model faceset filename [required]
-genStack %F %d %d %F set spin-image generation parameters
[bin size=1,width=15,height=15,angle threshold=180]
-readStack %S stack read filename [off]
-writeStack %S stack write filename [off]
-texScale %d set texture map scale [10]
-orig %F %F %F sensor origin [0 0 0]
-ptSize %F set projection point size
-noDisplay do not display spin image viewer [off]
-spinMethod %d method of spin image generation
-abBounds %F %F %F %F bounds on alpha,beta
-gridSize %F grid size
-hashed hashed
%S set model faceset filename [required]
The mesh for which the spin-images are being created.
-genStack %F %d %d %F set spin-image generation parameters
[bin size=1,width=15,height=15,angle threshold=180]
This option specifies the model spin-image generation parameters. Bin size is set as a multiple of the model resolution. Width is the width of the spin-image in pixels (alpha direction). Height is the height of the spin-image in pixels (beta direction). Spin-images generated will have height/2 pixels above beta = 0 and height/2 pixels below beta = 0. Angle threshold is the threshold on the angle (in degrees) between the oriented point basis and the surface normals of points being accumulated in the spin-image. Detailed analysis of these parameters is given in Chapters 2 and 9 of the Ph.D. dissertation Spin-Images: A Representation for 3-D Surface Matching.
-readStack %S name of file for writing model stack [off]
This option indicates that the model stack should be read from the file given.
-writeStack %S name of file for reading model stack [off]
This option indicates that the generated model stack should be written out to the file given.
-texScale %d set texture map scale [10]
Sets the width of each bin in the spin-image in texture map pixels. A texture scale of 10 gives good appearance for the spin-images in the image viewer. If the animation is too slow, decrease the texture scale parameter.
-orig %F %F %F sensor origin [off]
This option specifies the sensor origin (x,y,z) for the scene data. If provided, the surface normals generated for the surface mesh will be forced to point toward the sensor origin. Since adjacent surface normals must be consistently oriented, some of the surface normals near the mesh borders may point away from the sensor origin. If this option is not provided, then the sensor origin is assumed to be the centroid of the surface mesh vertices.
-ptSize %F set projection point size
Changes the projected point size. Increase for larger points and decrease for smalle points. This option is really only useful when making videos.
-noDisplay do not display spin image viewer [off]
Use this flag to turn off the graphics display of the result when running in batch mode.
-spinMethod %d method of spin image generation
Spin image generation method: 0=vertices only, 1=interpolate in spin-image space, 2=interpolate in 3D space. Using methods 1 or 2 allows matching and recognition between meshes of differing resolution, since they create spin-images based on the entier surface of the mesh rather than just the vertices . Method 1 projects each mesh face into spin-image space (the alpha-beta coordinate system) and then raster scans the projected shape to find the contribution of the face to the spin-image. Method 2 discretizes each face with a regular grid (the resolution of which is set by the -gridSize parameter), and projects each point into spin-image space just as is done with the vertices. These ideas are described in Toward a General 3-D Matching Engine: Multiple Models, Complex Scenes, and Efficient Data Filtering.
-abBounds %F %F %F %F bounds on alpha,beta
Sets the size of the spin-image's region of influence. The order of parameters is alpha min, alpha max, beta min, beta max. Alpha is the dimension in the radial direction (along the surface tangent), and beta is the dimension along the surface normal axis. For example, to create a spin image with radius 200 and height 100, use -abBounds 0 200 -50 50. Typically, spin-image radius and height are chosen to be equal.
-gridSize %F grid size
This option sets the size of the grid over which interpolated points are sampled. See the spinMethod option for details.
-hashed hashed
Stores vertices of the meshes in a hash table for speeding up spin-image generation. Only the vertices in the neighborhood of the query point can possibly fall within the spin-image's region of influence, so it is not necessary to iterate over all vertices.
To create a stack for a model using the default settings
StackMaker model.wrl
To create and save a stack for a model using user defined settings with a smaller texture scale (for faster rendering during animation) and a larger projection point size
StackMaker model.wrl -genStack 2.0 10 20 60.0 -writeStack model.stack -texScale 5 -ptSize 10
To create and write a stack without the display
StackMaker model.wrl -genStack 1.0 15 10 90.0 -writeStack model.stack -noDisplay
StackMaker accepts commands from the mouse and keyboard.
Clicking with the left mouse button on the model in the Mesh Viewer changes the current oriented point. When the current oriented point changes, the spin-image shown in the Image Viewer automatically is updated.
Typing a in the Mesh Viewer will turn on the spin-image animation which is used to visualize spin-image generation. Typing 'a' again will turn the animation off.
Typing o in the MeshViewer will highlight the oriented points that contribute to the current spin-image by showing them as blue line segments oriented along the surface normal. Typin an 'o' again will turn off the oriented points.
Typing p in the Mesh Viewer will display the spin-map projection of the oriented points contributing to the current spin-image as red points. The points will show up superimposed on the image viewer and on the animation plane is animation is activated.
Typing w in the Mesh Viewer will write out the current spin-image to a tiff-image stored in the current directory in the form "spinimage.{vertex-number}.tiff" Output spin-images can be displayed with xv and read by other programs.