Defect Pixel Correction Mode#
Defect pixel correction minimizes the influence of single pixels that appear too bright or too dark.
Using the Feature#
How It Works#
In acquired images, some pixels may appear significantly brighter or darker than the rest, even if uniform light is used. This problem is caused by differences in sensitivity of the individual pixels which in turn are due to production tolerances.
Defect pixel correction minimizes the influence of these sensitivity differences. The camera identifies pixels that have a significantly higher or lower intensity value than their neighboring pixels ("outlier pixels") and adjusts their intensity value.
Basler cameras that support this feature can perform two types of pixel corrections:
- The static pixel correction corrects pixels that have a significantly lesser intensity value than its neighboring pixels, including completely black pixels.
- The dynamic pixel correction corrects pixels that have a significantly greater intensity value than its neighboring pixels, including completely white pixels.
Enabling Defect Pixel Correction Mode#
To configure how the camera performs defect pixel correction, set the
DefectPixelCorrectionMode parameter to one of the following values:
On(default): The camera performs static and dynamic pixel corrections.
StaticOnly: The camera performs the static pixel correction only.
Off: The camera does not perform pixel corrections.
// Disable defect pixel correction camera.DefectPixelCorrectionMode.SetValue(DefectPixelCorrectionMode_Off);
INodeMap& nodemap = camera.GetNodeMap(); // Disable defect pixel correction CEnumParameter(nodemap, "DefectPixelCorrectionMode").SetValue("Off");
// Disable defect pixel correction camera.Parameters[PLCamera.DefectPixelCorrectionMode].SetValue(PLCamera.DefectPixelCorrectionMode.Off);
/* 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 */ /* Disable defect pixel correction */ errRes = PylonDeviceFeatureFromString(hdev, "DefectPixelCorrectionMode", "Off"); CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.