Sunday, November 09, 2008

Update: The checkerboard scanning code is here.

I've been working on computer-vision-y stuff rather than visual-effects/art-y stuff lately, and I thought I'd share the fruits of my labour with the geekier contingent of the 3 or so people who read this blog.

I use OpenCV a lot in my work, and it is a wonderful toolset indeed, except I've always been irritated by the limitations of its calibration target scanner. Bafflingly, it requires the entire target to be visible in the image, which makes it difficult to get good image coverage for lens distortion estimation. My hunch is that a good camera calibration requires data from all parts of the image, which is difficult to do when if you even slightly clip one corner of the target, the scan fails.

Another limitation is that the target (a black and white checkerboard) has no fiducial markings to indicate the origin of its coordinate system, which is problematic in some applications (it caused major ass pain when I was developing a vision-guided robotics application).

So I wrote a target scanner which overcomes those limitations. It will scan as much or as little of the target that is in view, and supports targets of up to 32x64 squares, which should be plenty.

I'm preparing a source release, which will be ready shortly. It will include a python script which uses pycairo to generate pdf files of the target.

The scanner knows where it is in the target coordinate system by the special codes in the centers of the squares. It's a simple little 2d code of my own devising which encodes the x,y position of the square plus a 3-bit checksum.

It's pretty quick, too: it takes about a 20th of a second to scan a 640x480 image, on my under-powered laptop.


Post a Comment

<< Home