Basler ace 2 R, ace 2 X, boost R, and dart M cameras support static defect pixel correction. This correction is based on files that are stored on the camera and contain a list of defect pixel coordinates.
The static pixel correction corrects pixels that have significantly lesser intensity values than their neighboring pixels, including completely black pixels.
The dynamic pixel correction corrects pixels that have significantly higher intensity values than their neighboring pixels, including completely white pixels. An internal threshold value defines when a pixel is detected as a "hot pixel". "Dynamic" means that the defect pixel correction is calculated individually for each acquired image.
// Set static user defect pixel correctioncamera.BslStaticDefectPixelCorrectionMode.SetValue(BslStaticDefectPixelCorrectionMode_User);// Reload static defect pixel correction filecamera.BslStaticDefectPixelCorrectionReload.Execute();
INodeMap&nodemap=camera.GetNodeMap();// Set static user defect pixel correctionCEnumParameter(nodemap,"BslStaticDefectPixelCorrectionMode").SetValue("User");// Reload static defect pixel correction fileCCommandParameter(nodemap,"BslStaticDefectPixelCorrectionReload").Execute();
// Set static user defect pixel correctioncamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionMode].SetValue(PLCamera.BslStaticDefectPixelCorrectionMode.User);// Reload static defect pixel correction filecamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionReload].Execute();
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Set static user defect pixel correction */errRes=PylonDeviceFeatureFromString(hdev,"BslStaticDefectPixelCorrectionMode","User");CHECK(errRes);/* Reload static defect pixel correction file */errRes=PylonDeviceExecuteCommandFeature(hdev,"BslStaticDefectPixelCorrectionReload");CHECK(errRes);
# Set static user defect pixel correctioncamera.BslStaticDefectPixelCorrectionMode.Value="User"# Reload static defect pixel correction filecamera.BslStaticDefectPixelCorrectionReload.Execute()
// Set the defect pixel correction mode to Usercamera.BslStaticDefectPixelCorrectionMode.SetValue(BslStaticDefectPixelCorrectionMode_User);// Assume there are two defect pixels at coordinates (120,430) and (182,430)// Set the y coordinate to 430camera.BslStaticDefectPixelCorrectionYCoordinate.SetValue(430);// Select entry X0 and assign the first x coordinatecamera.BslStaticDefectPixelCorrectionXSelector.SetValue(BslStaticDefectPixelCorrectionXSelector_X0);camera.BslStaticDefectPixelCorrectionXCoordinate.SetValue(120);// Select entry X1 and assign the second x coordinate, which is in the same linecamera.BslStaticDefectPixelCorrectionXSelector.SetValue(BslStaticDefectPixelCorrectionXSelector_X1);camera.BslStaticDefectPixelCorrectionXCoordinate.SetValue(182);// Save changes to flash memorycamera.BslStaticDefectPixelCorrectionSave.Execute();
INodeMap&nodemap=camera.GetNodeMap();// Set the defect pixel correction mode to UserCEnumParameter(nodemap,"BslStaticDefectPixelCorrectionMode").SetValue("User");// Assume there are two defect pixels at coordinates (120,430) and (182,430)// Set the y coordinate to 430CIntegerParameter(nodemap,"BslStaticDefectPixelCorrectionYCoordinate").SetValue(430);// Select entry X0 and assign the first x coordinateCEnumParameter(nodemap,"BslStaticDefectPixelCorrectionXSelector").SetValue("X0");CIntegerParameter(nodemap,"BslStaticDefectPixelCorrectionXCoordinate").SetValue(120);// Select entry X1 and assign the second x coordinate, which is in the same lineCEnumParameter(nodemap,"BslStaticDefectPixelCorrectionXSelector").SetValue("X1");CIntegerParameter(nodemap,"BslStaticDefectPixelCorrectionXCoordinate").SetValue(182);// Save changes to flash memoryCCommandParameter(nodemap,"BslStaticDefectPixelCorrectionSave").Execute();
// Set the defect pixel correction mode to Usercamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionMode].SetValue(PLCamera.BslStaticDefectPixelCorrectionMode.User);// Assume there are two defect pixels at coordinates (120,430) and (182,430)// Set the y coordinate to 430camera.Parameters[PLCamera.BslStaticDefectPixelCorrectionYCoordinate].SetValue(430);// Select entry X0 and assign the first x coordinatecamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionXSelector].SetValue(PLCamera.BslStaticDefectPixelCorrectionXSelector.X0);camera.Parameters[PLCamera.BslStaticDefectPixelCorrectionXCoordinate].SetValue(120);// Select entry X1 and assign the second x coordinate, which is in the same linecamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionXSelector].SetValue(PLCamera.BslStaticDefectPixelCorrectionXSelector.X1);camera.Parameters[PLCamera.BslStaticDefectPixelCorrectionXCoordinate].SetValue(182);// Save changes to flash memorycamera.Parameters[PLCamera.BslStaticDefectPixelCorrectionSave].Execute();
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Set the defect pixel correction mode to User */errRes=PylonDeviceFeatureFromString(hdev,"BslStaticDefectPixelCorrectionMode","User");CHECK(errRes);/* Assume there are two defect pixels at coordinates (120,430) and (182,430) *//* Set the y coordinate to 430 */errRes=PylonDeviceSetIntegerFeature(hdev,"BslStaticDefectPixelCorrectionYCoordinate",430);CHECK(errRes);/* Select entry X0 and assign the first x coordinate */errRes=PylonDeviceFeatureFromString(hdev,"BslStaticDefectPixelCorrectionXSelector","X0");CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"BslStaticDefectPixelCorrectionXCoordinate",120);CHECK(errRes);/* Select entry X1 and assign the second x coordinate, which is in the same line */errRes=PylonDeviceFeatureFromString(hdev,"BslStaticDefectPixelCorrectionXSelector","X1");CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"BslStaticDefectPixelCorrectionXCoordinate",182);CHECK(errRes);/* Save changes to flash memory */errRes=PylonDeviceExecuteCommandFeature(hdev,"BslStaticDefectPixelCorrectionSave");CHECK(errRes);
# Set the defect pixel correction mode to Usercamera.BslStaticDefectPixelCorrectionMode.Value="User"# Assume there are two defect pixels at coordinates (120,430) and (182,430)# Set the y coordinate to 430camera.BslStaticDefectPixelCorrectionYCoordinate.Value=430# Select entry X0 and assign the first x coordinatecamera.BslStaticDefectPixelCorrectionXSelector.Value="X0"camera.BslStaticDefectPixelCorrectionXCoordinate.Value=120# Select entry X1 and assign the second x coordinate, which is in the same linecamera.BslStaticDefectPixelCorrectionXSelector.Value="X1"camera.BslStaticDefectPixelCorrectionXCoordinate.Value=182# Save changes to flash memorycamera.BslStaticDefectPixelCorrectionSave.Execute()
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Disable defect pixel correction */errRes=PylonDeviceFeatureFromString(hdev,"DefectPixelCorrectionMode","Off");CHECK(errRes);