diff options
author | Daniel Oberhoff <daniel@danieloberhoff.de> | 2014-08-12 00:52:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-12 03:33:30 +0200 |
commit | 9f617a14a00805ffd54dee4fce34e3e4099d21f3 (patch) | |
tree | fe98565725eb4b7c6b10cf7cd3d5556b9775de67 /doc/filters.texi | |
parent | 52b81ff4635c077b2bc8b8d3637d933b6629d803 (diff) | |
download | ffmpeg-9f617a14a00805ffd54dee4fce34e3e4099d21f3.tar.gz |
avfilter: ported lenscorrection filter from frei0r
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'doc/filters.texi')
-rw-r--r-- | doc/filters.texi | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/filters.texi b/doc/filters.texi index e0759fccfd..54b4451da1 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -5546,6 +5546,51 @@ kerndeint=map=1 @end example @end itemize +@section lenscorrection + +Correct radial lens distortion + +This filter can be used to correct for radial distortion as can result from the use +of wide angle lenses, and thereby re-rectify the image. To find the right parameters +one can use tools available for example as part of opencv or simply trial-and-error. +To use opencv use the calibration sample (under samples/cpp) from the opencv sources +and extract the k1 and k2 coefficients from the resulting matrix. + +Note that effectively the same filter is available in the open-source tools Krita and +Digikam from the KDE project. + +In contrast to the @ref{vignette} filter, which can also be used to compensate lens errors, +this filter corrects the distortion of the image, whereas @ref{vignette} corrects the +brightness distribution, so you may want to use both filters together in certain +cases, though you will have to take care of ordering, i.e. whether vignetting should +be applied before or after lens correction. + +@subsection Options + +The filter accepts the following options: + +@table @option +@item cx +Relative x-coordinate of the focal point of the image, and thereby the center of the +distrortion. This value has a range [0,1] and is expressed as fractions of the image +width. +@item cy +Relative y-coordinate of the focal point of the image, and thereby the center of the +distrortion. This value has a range [0,1] and is expressed as fractions of the image +height. +@item k1 +Coefficient of the quadratic correction term. 0.5 means no correction. +@item k2 +Coefficient of the double quadratic correction term. 0.5 means no correction. +@end table + +The formula that generates the correction is: + +@var{r_src} = @var{r_tgt} * (1 + @var{k1} * (@var{r_tgt} / @var{r_0})^2 + @var{k2} * (@var{r_tgt} / @var{r_0})^4) + +where @var{r_0} is halve of the image diagonal and @var{r_src} and @var{r_tgt} are the +distances from the focal point in the source and target images, respectively. + @anchor{lut3d} @section lut3d @@ -8758,6 +8803,7 @@ For example, to vertically flip a video with @command{ffmpeg}: ffmpeg -i in.avi -vf "vflip" out.avi @end example +@anchor{vignette} @section vignette Make or reverse a natural vignetting effect. |