color correction & vignetting [Re: [ptx] Hugin wishlist, RFC]

JD Smith jdsmith at as.arizona.edu
Wed Feb 4 18:42:41 GMT 2004


On Wed, 2004-02-04 at 01:30, Pablo d'Angelo wrote:
> On Wed, 04 Feb 2004, Pablo d'Angelo wrote:
> 
> > Before we start with exposure compensation we have to tackle another lens
> > defect, namely vignetting. I found that my camera produces gray level
> > differences of ~ 40, if zoomed out.
> > 
> > The pano tools plugins have a simple p = b*r^2 * p  (where p=pixel value)
> 
> Ehm, sorry, pano tools uses additive instead of multiplicative correction
>  a*R^2+b  (b=brighness), a=coefficent. See also:
> http://www.email-lists.org/pipermail/ptx/2003-October/000721.html
> 
> I'm not sure if we should go with a formula (simple for the user), or if we
> should use a flatfield, like it's done in astronomy. Comments welcome.
> 
> I think the flatfield is harder to create. on the other hand, maybe its
> feasible to fit the parameters for the correcting, radial function if images
> with high overlap and without scene changes are used.

As an astronomer who creates flat-fields all the time, I can tell you
that it isn't conceptually difficult, although obtaining a true flat
illumination source can be challenging (we typically use a "white spot"
illuminated by a special lamp in the dome of the telescope, the bright
twilight sky in the evening or morning, or, at wavelengths where the sky
is bright enough already, combine large numbers of "science" images by
rejecting objects to produce a "sky flat" -- sometimes a combination of
all of these).  

For those of you unfamiliar, vignetting refers to light fall-off,
usually near the edge of a field, due to an input aperture which changes
as a function of field angle.  Some fraction of the light bundle is
"clipped".  This is due to obstructions in the light path which are out
of focus (if they were in focus, you'd see sharp "shadows" instead), and
is most commonly seen at fast f/#'s and wide-angles.  The obstructions
can include lens hoods, but most often it is just the finite length of
the lens barrel obscuring the input aperture when the entrance angle
increases.  Stopping down 1 or 2 f-stops usually reduces or eliminates
vignetting (since the smaller input aperture isn't obscured by the lens
barrel), even at large field angles. 

The correct way to correct flat field variations from vignetting (or
dust on the lens, etc.) is to divide the image by a "flat-field" image
with a mean (or median) of 1.0.  In this case, you might have values of
.9 in the corners.  Unfortunately, there will be a different flat field
for all aperture/zoom settings.  It's possible to parametrize a
vignetting-only flat field with a simple radial fitting function and
obtain decent results; however, many lenses do not produce symmetric
vignetting patterns, so you'd have to accommodate (and measure)
off-center radial patterns.  Additive methods will work, but only
because you're implicitly measuring the difference between image and
image/flat and adding that -- the division method doesn't rely on any
measurement of the image to be corrected, so it works for all types of
illumination, etc.  

Creating a high-quality flat field is usually best achieved with a
diffuse (non-spotlight) lighting source on a neutral white screen
(poster paper, etc.).  Take many (10 or more) images at each f/#
setting, and average them together.  You might also adjust the lighting
somewhat between images to average over any illumination gradients. 
White balance setting on your camera may also affect the measured flat.

Once correctly flat fielded, variations in intensity and color are due
to differences to true lighting (a cloud covered the sun), exposure
times (left camera on auto-exposure), and possibly spatial variations on
the detector itself (green increasing from left to right, etc).  A paper
that Pablo pointed out seems to have the best approach to blending I've
encountered, and is worth considering for implementation:

http://leibniz.cs.huji.ac.il/tr/acc/2003/HUJI-CSE-LTR-2003-82_blending.pdf

JD



More information about the ptX mailing list