NI Vision provides two techniques to generate flat field images.

  • User-controlled—Capture images with a bright background using an actual imaging setup.
  • Estimation—Estimate the flat field image using the Estimate Flat Field Model algorithm.

User-controlled Technique

Use this technique:

  • to achieve an accurate representation of back ground intensity,
  • to remove sensor noise, such as dust,
  • if the imaging setup is easily accessible in an industrial environment, and recapturing the images are necessary due to lighting changes.

In this technique, use your imaging set up to capture flat field images with a bright background after removing the object under inspection. Typically, multiple images are captured (more than 10), and then averaged to create the flat field image. Capture the dark field images by covering the camera lens.

This process should be be repeated whenever the imaging setup (lens, light, and position) changes. It is important to capture multiple frames to nullify the texture of the background. Use the IMAQ Compute Median Image VI and the IMAQ Compute Average Image VI to obtain the median or average of multiple images. Pass the flat field and dark field images to the IMAQ Flat Field Correction VI to create a corrected image.

Estimation Technique

The following images illustrate the flat field estimation process. Image A is an image to estimate the flat field image. Image B illustrates the sampling points. Image C illustrates the fitted 2D polynomial model. Image D is the estimated flat field image using the surface fit.

The flat field image can be estimated more accurately by enabling the Estimate Background? boolean in the VI. This parameter detects the background region in the image and performs a surface fit using only background pixels. The following figure illustrates the detected background region by masking the foreground objects.

The Estimate Background? option provides the following options to detect the background region:
  • Polynomial—Uses a polynomial algorithm with a specified Polynomial Degree to estimate the background.
  • Background Correction—Performs background correction to eliminate non-uniform lighting effects and then performs thresholding using the interclass variance thresholding algorithm.
  • NiBlack—Computes thresholds for each pixel based on its local statistics using the NiBlack local thresholding algorithm.