Pattern Removal Auto#

The Pattern Removal Auto camera feature suppresses the formation of a checker pattern on monochrome images.

Using the Feature#

Why Use Pattern Removal Auto#

Images output by some cameras may display artifacts resembling a superimposed checker pattern. This is due to the specific sensor design. Any 2 x 2 pixels in the sensor array respond identically to light only if its incidence is perpendicular to the sensor's surface. If the light arrives at an oblique angle, they will respond slightly differently. This causes the checker pattern in the image.

You can suppress the checker pattern by ensuring that appropriate correction coefficients are applied to the original pixel values. Correction coefficients are automatically applied at each image acquisition.

Pattern Removal Auto allows you to ensure that the values of the correction coefficients are appropriate for each image acquisition. The values are only effective under the specific imaging conditions that were present when Pattern Removal Auto was used.

Characteristics#

The Pattern Removal Auto auto function differs in some respects from other auto functions:

  • You don't have to specify an auto function ROI.
  • You don't have to specify a target value. Instead, the auto function generates correction coefficient values that will remove the checker pattern as far as possible.
  • Only the Once operating mode is available.

Enabling and Using Pattern Removal Auto#

To use the Pattern Removal Auto auto function:

  1. Set the image ROI to its maximum size.
  2. If possible, establish homogeneous illumination.
  3. Disable all camera features that could interfere with the generation of correction values, e.g., Gain Auto, Exposure Auto, or Sequencer.
  4. Adjust the camera settings (e.g., Exposure Time, Black Level, and Digital Shift) as desired. For best results, the gray values should be homogenous across the image.
  5. Set the PatternRemovalAuto parameter to Once.
  6. Acquire three images. Make sure that the target scene doesn't change between acquisitions.
    The camera generates and applies optimum correction values for the current imaging conditions. This occurs instantaneously and has no effect on the camera's frame rate. After the third acquisition, the PatternRemovalAuto parameter is automatically set to Off.
  7. If necessary, restore the original size of the image ROI.

The generated correction values apply until one of the following events occurs:

  • PatternRemovalAuto is set to Once.
  • The camera is disconnected from power. (to avoid losing the correction values, save the correction values.)
  • A user set with different correction values is loaded.

Repeating the Pattern Removal Auto Process#

When one of the relevant imaging conditions changes, you should repeat the Pattern Removal Auto process. This ensures that the checker pattern is still removed reliably under the changed conditions and that pixel values are not changed unnecessarily.

Among the relevant imaging conditions are the following:

  • Optical system: Change of lens, aperture, or focus.
  • Illumination: Change of illumination type, arrangement of light sources, or brightness.
  • Feature settings: The checker pattern can be influenced by the settings of several camera features, in particular Exposure Time, Binning, image ROI, Black Level, and Digital Shift.

Saving the Correction Values#

Correction values generated by the Pattern Removal Auto auto function are lost if the camera is disconnected from power.

However, you can save the correction values in a user set. You can load this user set whenever you want to use the correction values again.

When loading correction values, make sure that the imaging conditions are identical to those when the correction values were generated.

Sample Code#

// Set the operating mode of the Pattern Removal Auto auto function to Once
camera.PatternRemovalAuto.SetValue(PatternRemovalAuto_Once);
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
camera.UserSetSelector.SetValue(UserSetSelector_UserSet1);
camera.UserSetSave.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Set the operating mode of the Pattern Removal Auto auto function to Once
CEnumerationPtr(nodemap.GetNode("PatternRemovalAuto"))->FromString("Once");
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
CEnumerationPtr(nodemap.GetNode("UserSetSelector"))->FromString("UserSet1");
CCommandPtr(nodemap.GetNode("UserSetSave"))->Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Set the operating mode of the Pattern Removal Auto auto function to Once
CEnumParameter(nodemap, "PatternRemovalAuto").SetValue("Once");
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
CEnumParameter(nodemap, "UserSetSelector").SetValue("UserSet1");
CCommandParameter(nodemap, "UserSetSave").Execute();
// Set the operating mode of the Pattern Removal Auto auto function to Once
camera.Parameters[PLCamera.PatternRemovalAuto].SetValue(PLCamera.PatternRemovalAuto.Once);
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
camera.Parameters[PLCamera.UserSetSelector].SetValue(PLCamera.UserSetSelector.UserSet1);
camera.Parameters[PLCamera.UserSetSave].Execute();
// Set the operating mode of the Pattern Removal Auto auto function to Once
Pylon.DeviceFeatureFromString(hdev, "PatternRemovalAuto", "Once");
// Acquire three images
// ...
// (Implement your own image grabbing routine here.
// For example, the InstantCamera class provides the StartGrabbing() method.)
// ...
// Save the correction values in User Set 1
Pylon.DeviceFeatureFromString(hdev, "UserSetSelector", "UserSet1");
Pylon.DeviceExecuteCommandFeature(hdev, "UserSetSave");
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Set the operating mode of the Pattern Removal Auto auto function to Once */
errRes = PylonDeviceFeatureFromString(hdev, "PatternRemovalAuto", "Once");
CHECK(errRes);
/* Acquire three images */
/* ... */
/* (Implement your own image grabbing routine here. */
/* For example, the InstantCamera class provides the StartGrabbing() method.) */
/* ... */
/* Save the correction values in User Set 1 */
errRes = PylonDeviceFeatureFromString(hdev, "UserSetSelector", "UserSet1");
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "UserSetSave");
CHECK(errRes);

You can also use the pylon Viewer to easily set the parameters.