wonkey_monkey
27th June 2007, 17:39
A little while back (in this thread (http://forum.doom9.org/showthread.php?t=126916)) I asked if there was a plugin to correct the circular distortion caused by fisheye and other non-rectilinear lenses, such as you find in camcorders.
There wasn't then, but there is now - it's my first plugin and it's definitely beta (and this post is currently all the documentation there is), but if anyone thinks they can make use of it, please give it a try and let me know of any bugs. Source code is included, but is not well commented.
Here's what it does:
http://www.channeltv.co.uk/defish.jpg
It takes a few parameters:
fov - the horizontal field of view of the image in degrees (must be greater than 0).
aspect - the pixel aspect ratio of the image (1 if you have square pixels, 0.6875 for anamorphic PAL, etc -defaults to 1)
scale - 0 by default, which automatically scales the image to show as much of the image as possible without showing the edges. scale=1 will keep the centre of the image at the original scale. You'll get an error if you try a value that is smaller than the automatic value (this restriction may be removed later, but for now if you want some crazy effects, try adding borders and increasing fov).
resample - 1 (default): nearest neighbour, 2: bilinear interpolation (a better interpolator will be added later)
I've missed out on some parameter checks, so don't be surprised if you play around and get a blank clip :cool:
Download (http://www.channeltv.co.uk/defish.zip)
Oh yes, I almost forgot - input must be RGB32 (I haven't decided if I'll bother with other colour spaces later) and have an even width and height.
David
There wasn't then, but there is now - it's my first plugin and it's definitely beta (and this post is currently all the documentation there is), but if anyone thinks they can make use of it, please give it a try and let me know of any bugs. Source code is included, but is not well commented.
Here's what it does:
http://www.channeltv.co.uk/defish.jpg
It takes a few parameters:
fov - the horizontal field of view of the image in degrees (must be greater than 0).
aspect - the pixel aspect ratio of the image (1 if you have square pixels, 0.6875 for anamorphic PAL, etc -defaults to 1)
scale - 0 by default, which automatically scales the image to show as much of the image as possible without showing the edges. scale=1 will keep the centre of the image at the original scale. You'll get an error if you try a value that is smaller than the automatic value (this restriction may be removed later, but for now if you want some crazy effects, try adding borders and increasing fov).
resample - 1 (default): nearest neighbour, 2: bilinear interpolation (a better interpolator will be added later)
I've missed out on some parameter checks, so don't be surprised if you play around and get a blank clip :cool:
Download (http://www.channeltv.co.uk/defish.zip)
Oh yes, I almost forgot - input must be RGB32 (I haven't decided if I'll bother with other colour spaces later) and have an even width and height.
David