[ptx] Lens correction of a cheap webcam
Marko Mäkelä
marko.makela at hut.fi
Wed Jul 14 10:19:32 BST 2004
On Wed, Jul 14, 2004 at 10:04:45AM +0100, Bruno Postle wrote:
> 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.
Thanks, I'll try this.
> > 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.
I'm afraid I can't fit Perl on the floppy (the idea is to go without hard
disk or CD-ROM), but the algorithm looks simple enough to be implemented in C.
The speed isn't a problem: I'm going to update the image once a minute or so.
I got satisfying results with the David Hodson's "wideangle" GIMP plugin
(http://members.ozemail.com.au/~hodsond/). I'm not aiming for perfect
images; I'm only trying to get rid of clearly noticeable distortion.
Could you tell me how the five parameters your script relate to the
parameters of Mr. Hodson's plugin? I think it would be easier for me
to base my work on his C code.
Marko
More information about the ptX
mailing list