[ptx] Lens correction of a cheap webcam

Bruno Postle bruno at postle.net
Wed Jul 14 10:04:45 BST 2004


On Wed 14-Jul-2004 at 00:11 +0300, Marko Mäkelä wrote:
> 
> A construction company is looking for a cheap web cam installation that
> would be set up on construction sites they are working on, as a reference
> on their web page.

> I would appreciate some help with the treatment of lens distortion.  I tried
> to follow the tutorial at
> http://hugin.sourceforge.net/tutorials/architectural/en.shtml, setting four
> pairs of vertical control points and one pair of horizontal control points.

> (It wouldn't let me to set multiple pairs of horizontal control points.)

Sounds like a bug.

The easiest way to calculate lens distortion parameters for a fixed
lens is to take two or three mostly-overlapping images, select lots
of control points and optimise the a, b & c parameters.

(This should be a tutorial)

> Is there any simple C implementation of the radial shift algorithm described
> at http://www.path.unimelb.edu.au/~dersch/barrel/barrel.html, working on
> images with 8 bits per colour component?

Here is a short perl implementation:

    http://bugbear.blackfish.org.uk/~bruno/imager-test/

This might even be sufficient if you only intend to refresh the
image every 5 or 10 seconds.

-- 
Bruno


More information about the ptX mailing list