[ptx] Vignetting correction in nona
JD Smith
jdsmith at as.arizona.edu
Mon Jan 2 18:49:56 GMT 2006
On Mon, 2006-01-02 at 17:59 +0000, Bruno Postle wrote:
> On Mon 02-Jan-2006 at 10:33 +0100, pablo.dangelo at informatik.uni-ulm.de wrote:
> >
> > I'm currently implementing a vignetting correction during remapping.
>
> > The correction offset/factor can be specified by a polynomial
> > which depends on the normalized distance r (0..1) between point
> > (x,y) and the image center.
>
> Have you considered a cosine rule? I know it isn't as flexible or
> fast as a polynomial and only accounts for one type of vignetting,
> but since the angle of view of the photo is known it wouldn't
> require any calibration or manual tweaking.
This is a common misconception. The cosine-falloff law applies to the
image space angle of view, not object space (which is the angle space
Hugin/PanoTools works in). Another way of thinking about it: the
detector only cares about the true physical angle of incidence of the
light on its surface, not how such an angle maps to the angle of view in
the photo. This makes it somewhat impractical to apply arbitrarily
(you'd have to know a lot more about your lenses). It's also a very
approximate law, and in fact the best practical correction seems to be 1
factor of object space cosine, 3 factors of image space cosine (see
http://www.vanwalree.com/optics/vignetting.html). A fisheye provides the
best example of this. Using cos(theta_object) for a fisheye will
predict 0 flux at some positions. Of course, the fisheye maps a very
non-uniform portion of the sphere onto each pixel (unlike a rectilinear
lens), so there is a real light-falloff there which is not vignetting at
all. A flat-field of course can't tell the difference between these
two, so flat-fielding a fisheye, and then converting it to rectilinear
using a program which was counting on and counters the built-in area-
distortion fall-off, will lead to images which get too bright at the
edges. This might be something to keep in mind when implementing it in
Hugin for fisheyes. I'm not sure what Panotools does (if anything)
about fisheye falloff.
I believe optical vignetting of the lens hood/barrel is by far the
dominant type of vignetting for digital imaging. Whereas "natural
vignetting" which produces an (idealized) cos^4 law, optical vignetting
has a much different behavior. I think a polynomial approach is the
most flexible.
This discussion reminded me that vignetting will commonly be a strong
function of the f-number. Smaller apertures will vignette less (or not
at all). So in the "collection of coefficients" paradigm for lens
distortion and correction, the collection would change not just with
lens, camera, and focal length, but with aperture as well.
> Enblend does such a good job with vignetting already, perhaps this
> is all that is needed to get a good result in most use cases.
It depends on the level of vignetting, but yes, I agree even a crude
correction is probably better than no correction for lens combos that
suffer vignetting. Whatever warts remain, Enblend will probably hide
fairly well.
JD
More information about the ptx
mailing list