Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 19th February 2010, 23:40   #1  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
"Defish", barrel and pincushion distortion correction filter

Updated 2010/02/21 - version 1.1

Download: defish

It's taken me several years since my first post on this subject, but I've finally written a usable fisheye distortion correction plugin:



It uses spline16 interpolation.

Code:
defish (v1.1) for Avisynth 2.5
(c) David Horman, 2010

This filter can be used to correct (or induce) barrel and pincushion
distortion.

USAGE
-----

The filter takes the following parameters (in addition to the input clip):

[unnamed]:
	Input clip. Must be RGB32 and have even width/height.

fov:
	useful range: -180.0 - 180.0
	default: 0
	The horizontal field of view, in degrees. Positive values will
	correct barrel distortion (induce pincushioning). Negative values
	should correct pincushion distortion (induce barreling), but note
	that this may currently be implemented incorrectly.

scale:
        range: 0.0 - infinity
	default: 1.0
	An adjustment parameter which scales the image after correction.

aspect:
	range: 0.0 - infinity
	default: 1.0
	The pixel aspect ratio of the input clip.

direction:
	values: "x", "y"
	This parameter restricts the correction to either horizontal or
	vertical only.

scaling:
	values: "fitx", "fity", "fitxy"
	This parameter automatically scales the image to fill the image
	horizontally, vertically, or both. The "scale" parameter above is
	still effective.

	The default behaviour when using fov is to scale the image such
	that the central area stays at the original scale.

	This parameter is not effective when using the polynomial values
	below.
a,b,c:
        sensible range: 0.0 - 1.0
        Parameters for correcting distortion polynomially. These are only
        effective when fov=0 (which is the default value).

        a+b+c must be less than or equal to 1.0 when pin=true.

pin:
	boolean
	Set this to true to correct pincushion distortion, and false to
	correct	barrel distortion - this may seem the wrong way around but
	it was chosen to match the behaviour of the similar parameter of
	V.C. Mohan's DeBarrel filter.
David

Last edited by wonkey_monkey; 16th March 2015 at 22:55.
wonkey_monkey is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.