Background | Testing | Calculation | Imatest Instructions | Inputs |
Overview
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.
Mask Methods
1) 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
- Apply the first pass method to the image to get a mask
- If no mask is found, the light source is assumed to be out of the FOV
- If a mask is found, the light source is assumed to be in the FOV
- Compute the centroid of the mask
- 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.
2) Image Processing
Description
This method uses image-processing-based methods to mask out the light source. Note that, currently, the Image Processing mask method is not available as an option on its own, but rather it is used as a step in the Two-Pass Circle (Radius) mask method (i.e., the Image Processing method is used as the “first pass” of the “Two-Pass Circle” method).
Inputs
- The type of level threshold:
- Percentage of the maximum value in the image is used as the threshold
- A value is used as the threshold
- The level threshold input
- The minimum source level (the minimum value that can be considered to be a direct image of the light source)
- The image-closing radius
- The strategy for dealing with multiple connected components
- The minimum pixel count threshold
Calculation
Overview
- Compute the level threshold
- Create an initial mask by finding all of the pixels greater than the threshold
- (Optional) Perform an image closing morphology with a disk of the user-specified size. This helps to fill in small holes within the mask
- 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
- 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
- Apply the strategy for selecting from one or more connected-component
Level threshold calculation
If the level threshold type is the percent of max:
- Calculate the maximum value
- The threshold is the user-provided percentage of this value
If the level threshold type is value:
- 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
Warnings
- When the image of the light source is partially out of the FOV, the assumptions used to generate a mask may be violated.
- This may lead to improperly defined masks.
- It is recommended that all light source masks are checked.
- When the image of the light source is entirely out of the FOV, the assumptions used to generate a mask may be violated.
- This may lead to improperly defined masks.
- It is recommended that all light source masks are checked.
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.