Stray Light (Flare)

Stray Light Masking

Background Testing Calculation Testing With Imatest Inputs Outputs

 


Current Documentation
View previous documentation
View legacy documentation
All documentation versions

Masking (shorthand for “light source masking”) is the process of creating a mask to exclude the image of the light source from the analysis. The actual image of the light source is desired and therefore is not stray light. 

Methods

Two-Pass Circle (Radius)

Description

The two-pass circle radius method uses two passes to localize the light source. The first pass is any of the masking methods. This first pass is used to find where the light source is. A circle of the prescribed radius is then applied at this location.

Inputs

  • The selection of which method to use for the first pass 
  • Any required options for the first pass
  • The radius in pixels to make the light source

Calculation

  1. Apply the first pass method to the image to get a mask
    1. If no mask is found, the light source is assumed to be out of the FOV
    2. If a mask is found, the light source is assumed to be in the FOV
  2. Compute the centroid of the mask
  3. Create a mask within a specified radius of the light source

Assumptions

  • There is only a single light source in the image
  • This method assumes relatively low distortion
    • The light source size is constant over the images
    • The image of the light source is always a circle

Notes

  • This method does not perform well if the light source is partially in and partially out of the FOV
  • The centroid is assumed to be relatively stable in the presence of noise or saturation
  • Note the centroid may be a non-integer (sub-pixel) value. Therefore the number of masked pixels is not constant.

 

Image Processing

Description

This method uses image-processing-based methods to mask out the light source.

Inputs

  • The type of level threshold:
    • % of the maximum value
    • A value
  • The level threshold input
  • The image-closing radius
  • The strategy for dealing with multiple connected components
  • The minimum pixel count threshold

Calculation

Overview

  1. Compute the level threshold
  2. Create an initial mask by finding all of the pixels greater than the threshold
  3. (Optional) Perform an image closing morphology with a disk of the user-specified size. This helps to fill in small holes within the mask
  4. Compute the number of connected components in the mask
    • If zero connected components are found, then the light source is assumed to be out of the FOV
  5. Filter out any connected components that have an area smaller than the user-provided threshold
    • If zero connected components remain, then the light source is assumed to be out of the FOV
  6. Apply the strategy for selecting from one or more connected-component 

Level threshold calculation

If the level threshold type is the percent of max:

  1. Calculate the maximum value
  2. The threshold is the user-provided percentage of this value

If the level threshold type is value:

  1. Use the provided threshold

Multiple Connected Component Strategies

If there is only one connected component:

  • This is assumed to be the light source.
  • A mask of just this connected component is returned

If there are no connected components:

  • The light source is assumed to be outside the field of view.
  • A mask with no light source(s) is returned

If the user-provided multiple-connected component strategy is “Don’t mask”:

  • A mask with no light source(s) is returned

If the user-provided multiple-connected component strategy is “Pick Biggest”:

  • The largest of the remaining connected components is assumed to be the light source
  • A mask of the largest connected component is returned

Assumptions

  • There is only a single light source in the image

Notes

  • This method does not perform well if the light light source level is above saturation
    • This method will select a larger region then should be masked in this case (leading to a better-than-deserved stray light measurement)
  • Value threshold types:
    • % of max does not work well if the light source is out of the FOV
    • Value does not work well if there is a significant falloff within the image

 

Generic Notes

  • In Imatest 22.2, the two-pass circle (radius) with an image processing first pass is the only option available. Other options will be available in future versions of Imatest.
  • Mask creation channel
    • If a single-channel test image is used, then it will be used for computing the mask.
    • If a multi-channel (e.g., RGB) test image is used, then the mask will be computed on the mean of all provided channels.
  • Mask application channel
    • For each capture position, the same mask is applied to each of the analysis channels.