2Dcbuilder 1.0 README
Ethan Gold <etgold@thaumaturgy.net> 5/21/01
http://thaumaturgy.net/~etgold/software/2Dcbuilder/
Overview
2Dcbuilder is a small, self-contained tcl/tk application for building a correspondence list between world coordinates as measured on a 2D co-planer calibration grid and pixels in a sample calibration image. This is intended as a tool for monoscopic X/Y co-planer calibration only, and is not designed to work with more complicated models.
2Dcbuilder was developed under Linux, but works fine under Windoze, and presumably any other Un*x or machine supported by Tcl/Tk. Only version 8.3 has been tested, but I have not used any spiffy features, and it should work under Tk-4.0 or newer. (See http://www.scriptics.com/)
2Dcbuilder is distributed under the terms of the GNU Public License
Output
The output is a correpondence list where each line is the form
x y z px py
where z is always 0. This is the standard input format for the
standard Tsai calibration routines (ccal_fo).
Usage
2Dcbuilder can be run without arguments if the file calib_img.ppm is in the working directory. Otherwise the specification of --image is required. All other arguments are optional. All images types supported by the standard Tk image loader should work, including PPM and GIF, and notably excluding JPEG (why is that?).
Commandline options:
--image: path to the calibration image (default is calib_img.ppm)
--dimx int: number of squares along the X axis
--dimy int: number of squares along the Y axis
--sqx float: length of a square along the X direction in mm
--sqy float: length of a square along the Y direction in mm
--output path: output file for data instead of stdout
--points path: path to a file of previously generated tsai-format correspondences
to enter into the UI automatically. Points in the file will
override any points already set for corners which correspond to
points in the file. You must set the origin before the points from
the file can be created.
--tall: arranges the grid and image vertically
UI
Radiobuttons represent corners, so there should be 1 more radiobutton in each direction than you have squares for each dimension on your calibration grid.
You can set the Origin at any time before generating output, but might want to do it off the bat since the app will color the axes on the radio buttons for you which helps visual orientation a bit. It will also color the points on the image appropriately, which will help visually as well. Simply hit the "set origin" button to set the origin to the currently selected radiobutton. The grid has a basic Cartesian layout, with up and right being the positive directions.
Select a radio button to set up its corresponding point. Clicking anywhere on the image will delete the old point (if one exists) and create a new point. You can delete a point entirely for the current radiobutton by hitting the delete button.
Hit the output button when you're done to generate the final set of points both on in the specified file (or on stdout) and in a window.
Installation
Copy 2Dcbuilder.tcl to somewhere convenient, perhaps
/usr/local/bin/2Dcbuilder
Make sure it's executeable (chmod 755 2Dcbuilder).
Files
README: this file
2Dcbuilder.tcl: the application
calib_img.ppm: sample/default input image (connectix b&w quickcam)
sample.pts: sample output point set
calib_grid.ppm: Sample 8x8 pixel calibration grid. I blow this up
in xv to a convenient size and print it out directly
from xv. The scale I use results in 23mm squares.
Bugs/Issues
2Dcbuilder has no known bugs at this time.
You may find that things get a little out of hand for images significantly larger than half your screen width. It might make sense to stack the image on top of the grid, instead of side-to-side, but visually I find the side-to-side orientation easier to map in my head.
