Correct vignetting

This tool can be used to reduce vignetting within an image. Vignetting refers to the reducuction of image brightness away from the image centre (i.e. the principal point). Vignetting is a radiometric distortion resulting from lens characteristics. The algorithm the brightness value in the output image (BVout) as:

BVout = BVin / [cosn(arctan(d / f))]

Where d is the photo-distance from the principal point in millimetres, f is the focal length of the camera, in millimeters, and n is a user-specified parameter. Pixel distances are converted to photo-distances (in millimetres) using the specified image width, i.e. distance between left and right edges (mm). For many cameras, 4.0 is an appropriate value of the n parameter. A second pass of the image is used to rescale the output image so that it possesses the same minimum and maximum values as the input image.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
inputImageFile = wd + "input.dep"
inputPPFile = wd + "inputPP.shp"
outputFile = wd + "output.dep"
focalLength = "304.8" # in mm
imageWidth = "228.6" # in mm
n = "4.0"
args = [inputImageFile, inputPPFile, outputFile, focalLength, imageWidth, n]
pluginHost.runPlugin("CorrectVignetting", args, False)

This is a Groovy script also using this tool:

def wd = pluginHost.getWorkingDirectory()
def inputImageFile = wd + "input.dep"
def inputPPFile = wd + "inputPP.shp"
def outputFile = wd + "output.dep"
def focalLength = "304.8" // in mm
def imageWidth = "228.6" // in mm
def n = "4.0"
args = [inputImageFile, inputPPFile, outputFile, focalLength, imageWidth, n]
pluginHost.runPlugin("CorrectVignetting", args, false)

Credits: