Stray Light Masking

Page Contents

This page provides a description of Imatest’s light source Mask Methods.

Masking (shorthand for “light source masking”) is the process of creating a mask to exclude the direct image of the light source from the analysis. The direct image of the source is the small region in the image that represents the true size of the light source (i.e., if there were no stray light or blooming in the image). The direct image of the light source is not stray light, which is why it should be masked (ignored) in a stray light metric image. 

Mask Methods

The Imatest stray light source analysis has several options or methods available for masking the light source in the image(s). Different mask options have different inputs allowing the user to configure the masking process and accuracy.

Note: If using the Reference Image normalization method, separate mask options are available for the test images and the reference image. 

Image Processing

Description

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

Inputs
Calculation
Calculation Overview
    1. Compute the level threshold for the image or use the entered Level Threshold (Value)
    2. Check that the level threshold for the image is greater than the entered Minimum Source Level. If less, the source is assumed to be outside the FOV and no mask is generated for the image. 
    3. Create an initial mask by finding all of the pixels greater than the level threshold
    4. (Optional) Perform an image-closing morphology with a disk of the user-specified size (Image Close Radius). This helps to fill in small holes within the mask
    5. 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
    6. Filter out any connected components that have an area smaller than the user-provided Mask Area Threshold
      • If zero connected components remain, then the light source is assumed to be out of the FOV
    7. Apply the strategy for selecting from one or more connected-component (Multiple CC Strategy)
Level threshold calculation

If the Level Threshold Type is Percent of Max:

    1. Calculate the maximum value in the image
    2. The threshold is the user-provided percentage (Level Threshold (Percent)) of this value

If the Level Threshold Type is Value:

    1. Use the user-provided threshold (Level Threshold (Value))

If the Level Threshold Type is Otsu’s method

    1. Use Otsu’s method to calculate a threshold from the image
Multiple Connected Component Strategies

If there is only one connected component:

If there are no connected components:

If the user-provided multiple-connected component strategy (Multiple CC Strategy) is “Don’t mask”:

If the user-provided multiple-connected component strategy (Multiple CC Strategy) is “Pick Biggest”:

If the user-provided multiple-connected component strategy (Multiple CC Strategy) is “Pick Smallest”:

Assumptions
Notes
Recommendations
Image Processing + Circle (Radius)
Description

The Image Processing + Circle radius method uses two “steps” to determine the masked region. In the first step, the light source is localized via Image Processing methods. In the second step, a circle of a specified radius is placed at the center of the localized region and is used as the mask for the image. This method can avoid over-masking in the presence of large areas of saturation.

Inputs
Radius Calculation

IEEE Std 2020:2024 provides a method to compute the radius of a mask from properties of the light source and camera

where

: radius of mask in pixels

: pixel pitch of the camera in μm/px

: focal length of the camera in mm

: focal length of the collimator in mm

: diameter of the pinhole in the collimator in mm

Mask Calculation
    1. Apply the “first step” (Image Processing) to the image to determine a mask region
      1. If no mask region is found, the light source is assumed to be out of the FOV
      2. If a mask region is found, the light source is assumed to be in the FOV
    2. Compute the centroid of the mask region
    3. Apply the “second step” by creating a circle of specified radius at the found centroid to use as the final light source mask
Assumptions
Notes
None
Description

Do not mask out the source.

Inputs

N/A

Calculation

N/A

Assumptions

N/A

Notes

Warnings

Generic Notes