BrightnessEqualize

BrightnessEqualize[image]

adjusts the brightness across image, correcting uneven illumination.

BrightnessEqualize[image,flatfield]

uses the correction model given by flatfield, which models the variation in brightness across image.

BrightnessEqualize[image,flatfield,darkfield]

uses the dark environment model given by darkfield.

Details and Options

  • Local brightness adjustment is also known as flat fielding, and is used for removing image artifacts caused by nonuniform lighting or variations in sensor sensitivities.
  • BrightnessEqualize works with arbitrary 2D and 3D images, adjusting the lightness channel in the LABColor space.
  • A flatfield image is an image of a homogeneous signal like a plain well-lit white background. A darkfield is the same image obtained without lighting. The flat fielding of an image with an object in the same setting is given by (image-flatfield)xMean[flatfield-darkfield]/(flatfield-darkfield).
  • Possible settings for either flatfield or darkfield include:
  • vala constant value val
    corrimagea correction image (rescaled to the image dimensions)
    {scope,model}fit the data into a given model
  • The default flatfield consists of a 2nd order polynomial fit. The default darkfield is assumed to be 0.
  • Using {scope,model}, the flatfield or darkfield is estimated by fitting a function.
  • The scope parameter specifies whether to fit the entire image data or the image projections along each axis. Possible settings include:
  • "Global"fit the entire image to the model
    "Marginal"separately fit model to the projections along each axis
  • The model can be one of the following:
  • nan n-degree polynomial
    f,params,varsan arbitrary model f with parameters params and variables vars
  • The following options are available:
  • MaskingAutomaticthe regions to use for model estimation
    PerformanceGoalAutomaticaspects of performance to try to optimize
  • Using Masking->Automatic, over- and underexposed pixels are not used for the adjustment.
  • With partially transparent images, the alpha channel is multiplied with the mask.

Examples

open allclose all

Basic Examples  (1)

Equalize brightness of a plain texture:

Scope  (2)

Remove uneven illumination in a microscopy image by estimating brightness distribution:

Fitting a multivariate polynomial of 2nd order on the entire image domain:

Fitting univariate polynomials of 2nd order to the image marginals in each direction:

Remove a vignette effect by fitting the lightness channel to a given model:

Assuming a rotationally symmetric, radial-dependent vignette:

Assuming a Gaussian vignette:

Options  (1)

Masking  (1)

By default, an automatic mask is used:

Equalize brightness based on the image background:

Applications  (8)

Achieve a constant luminosity of the Moon surface:

Equalize brightness of a microscopy image:

Identify the background:

Equalize brightness distribution assuming a homogeneous background:

Equalize color distribution by handling each channel separately:

Remove uneven illumination from a scanned document:

Create a mask to omit text in the subsequent equilibration:

Equalize brightness distribution fitting a sixth-order polynomial:

This improves the text recognition result:

Equalize the brightness distribution without a mask applying a horizontal fit:

This also improves the text recognition result:

Perform a subtractive correction on an astronomical image by estimating the dark field:

Reduce the vignette effect of a photograph:

Compute a mask for the background that is expected to have even illumination:

Equalize image brightness:

Remove CCD artifacts from an image taken by a low-quality camera with many pixel defects.

Flat-field image of the camera:

Microscopy image of a tear drop:

Flat-field correction:

Correct uneven illumination in an MR scan:

Use only muscle tissue for brightness estimation:

Correct uneven brightness in a 3D magnetic resonance volume:

Note the reduced brightness toward the perimeter of the volume:

Select the muscle tissue to estimate the brightness distribution:

Estimate the brightness distribution by a polynomial in cylindrical coordinates of even orders up to 4:

Compare the initial volume and the result with equalized brightness:

Introduced in 2017
 (11.1)