[FFmpeg-devel] Vignette filter limitations...

Evert Vorster evorster at gmail.com
Sun Aug 27 17:08:54 EEST 2017


Hi there, Paul.

The nona program can be called from the command line, with an .pto file to
tell it what corrections to do, as well as input images. It then does the
vignetting corrections first, and then re-maps the images on to a canvas.

The idea of the re-mapped images is that you can then blend them together
with either the "enblend" tool, also included in Hugin, or multiblend, or
photoshop, or whatever. The software was created to create panoramas from
stills. For this to work, vignetting also has to be corrected for.

Of course, I just want to blend pairs of images together for my
application, but vignetting is no less of a problem.
When I use the nona program to remap the images, I get a remap every two
seconds. This is not too bad where one is blending a panorama, as there are
only ever a handful of images to be remapped and blended.

When I use ffmpeg's remap filter, I get about 5 frames a second. When I
apply the best fit of ffmpeg's vignetting filter that I can manage, that
drops to 3 frames per second. Unfortunately, ffmpeg's vignetting correction
is rather limited, and I can still see the vignetting on my output images.

When I make the vignetting stronger, it only washes out the entire image,
and I still have vignetting to contend with. If I could specify a formula
for the vignetting filter in ffmpeg, then I would be able to perfectly
describe the vignetting charateristics of my lenses, or any circular lens.

This is the formula that hugin (and nona) uses:
a * r^2 + b * r^4 + c * r ^6, along with x and y for center shift.

You would set a, b, c, x and y, and r would be the distance away from x, y.
If ffmpeg can implement the same formula, that would mean that I could
re-use the values calculated by Hugin.

Kind regards,
Evert


On 27 August 2017 at 14:09, Paul B Mahol <onemda at gmail.com> wrote:

> On 8/27/17, Evert Vorster <evorster at gmail.com> wrote:
> > Hi there.
> >
> > The program's name is nona, and it is distributed in source code form
> with
> > Hugin.
> > http://hugin.sourceforge.net/docs/manual/Nona.html
> >
> > The source code and descritpions is available here:
> > http://hugin.sourceforge.net/docs/html/index.html
> >
> > I hope it helps?
>
> How is one supposed to use it to change vignetting?
>
> >
> > On 27 August 2017 at 13:35, Paul B Mahol <onemda at gmail.com> wrote:
> >
> >> On 8/27/17, Evert Vorster <evorster at gmail.com> wrote:
> >> > Hi there.
> >>
> >> Hi,
> >>
> >> >
> >> > I have asked this question on the ffmpeg-users list, but it's been
> oddly
> >> > quiet on this front.
> >> >
> >> > I am trying to create a ffmpeg command line that re-maps and stitches
> >> > together footage from the Samsung Gear 360 camera. The basic methodoly
> >> can
> >> > be applied to any 360 view camera. The reason I am doing this is that
> >> > the
> >> > software that is available to do this is closed source and extremely
> >> > expensive. For a hobbiest, this is a bad situation.
> >> >
> >> > First thing I do, is to load a specially crafted series of frames in
> >> Hugin,
> >> > and perfectly map the lenses.
> >> > Then I make the remap files that the ffmpeg remap filter uses with
> nona
> >> -c.
> >> > I hand craft a alpha map to do the blending between the lenses, and
> the
> >> > results are really good.
> >> >
> >> > Unfortunately I have a real problem with vignetting.
> >> > The vignette filter in ffmpeg seems to have some room for improvement.
> >> > In Ffmpeg there is only one variable, and the x,y center. This allows
> >> > for
> >> > only one type of vignetting correction with the "backward" option set.
> >> >
> >> > In Hugin (and the panotools) the lens is described with 3 variables,
> and
> >> an
> >> > x,y center. This enables the vignetting strength to be described as a
> >> > custom curve.
> >> >
> >> > If you are curious about the project, this is the github page, with
> >> > examples.
> >> > https://github.com/evertvorster/dualfisheye2equirectangular_
> ffmpeg_remap
> >> > There are example .pto files, that when loaded in Hugin show the lens
> >> > chataristics of the Samsung Gear 360 lenses, and some sample footage
> to
> >> > test on.
> >> >
> >> > How difficult would it be to port the panotools' vignetting correcting
> >> > filter into ffmpeg?
> >>
> >> How it is actually named?
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >
> >
> >
> > --
> > Evert Vorster
> > Isometrix Acquistion Superchief
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>



-- 
Evert Vorster
Isometrix Acquistion Superchief


More information about the ffmpeg-devel mailing list