The main purpose of the PGI feature set is to optimize images to meet the needs of human vision. It combines up to four image optimization processes.
In this topic Hide
Depending on your camera model, a selection of the following image optimizations will be performed:
The noise reduction (also called "denoising") reduces random variations in brightness or color information in your images.
This optimization increases the sharpness of the images. The higher the sharpness, the more distinct the contours of the image objects will be. This is especially useful in applications where cameras must correctly identify numbers or letters.
5×5 demosaicing (also called "debayering") carries out color interpolation on regions of 5×5 pixels on the sensor and is therefore more elaborate than the "simple" 2×2 demosaicing used otherwise by the camera.
Color errors, especially on sharp edges and in sections of the image with high spatial frequencies, are a common side effect of demosaicing algorithms. Even colorless structures can suddenly appear to have color. The color anti-aliasing optimization analyzes and corrects the discolorations.
For more information about the PGI image optimizations, see the Better Image Quality with Basler PGI white paper.
To enable the PGI image optimizations (if available) on Basler dart and pulse cameras:
To enable the PGI image optimizations (if available) on Basler ace cameras:
Once you have enabled the PGI feature set, you can configure the individual image optimization processes.
Which image optimizations are available and can be configured depends on your camera model.
If this optimization is configurable, you can use the NoiseReductionAbsNoiseReduction parameter to specify the desired noise reduction. The higher the parameter value, the more noise reduction is applied.
If this optimization is not configurable, noise reduction is applied automatically.
Noise reduction is best used together with improved sharpness. If the parameter value is set too high, fine structure in the image can become indistinct or even disappear.
Configuring Improved Sharpness
If this optimization is configurable, you can use the SharpnessEnhancementAbsSharpnessEnhancement parameter to specify the desired level of sharpness. The higher the parameter value, the more sharpening is applied.
If this optimization is not configurable, sharpness is improved automatically.
In most cases, best results are obtained at low parameter value settings and when using noise reduction at the same time.
Configuring 5×5 Demosaicing
If available, 5×5 demosaicing is performed automatically whenever the PGI feature set is enabled. You can't configure this optimization.
Configuring Color Anti-Aliasing
If available, color anti-aliasing is performed automatically whenever the PGI feature set is enabled. You can't configure this optimization.
Camera Model | Available Image Optimizations | Configurable Image Optimizations |
---|---|---|
a2A1920-51gmBAS | PGI Feature Set not supported | None |
a2A1920-51gcBAS | PGI Feature Set not supported | None |
a2A1920-160umBAS | PGI Feature Set not supported | None |
a2A1920-160ucBAS | PGI Feature Set not supported | None |
acA640-90gm | PGI Feature Set not supported | None |
acA640-90gc | PGI Feature Set not supported | None |
acA640-120gm | PGI Feature Set not supported | None |
acA640-120gc | PGI Feature Set not supported | None |
acA640-121gm |
|
|
acA640-300gm |
|
|
acA640-300gc |
|
|
acA720-290gm |
|
|
acA720-290gc |
|
|
acA780-75gm | PGI Feature Set not supported | None |
acA780-75gc | PGI Feature Set not supported | None |
acA800-200gm |
|
|
acA800-200gc |
|
|
acA1280-60gm | PGI Feature Set not supported | None |
acA1280-60gc | PGI Feature Set not supported | None |
acA1300-22gm | PGI Feature Set not supported | None |
acA1300-22gc | PGI Feature Set not supported | None |
acA1300-30gm | PGI Feature Set not supported | None |
acA1300-30gc | PGI Feature Set not supported | None |
acA1300-60gm | PGI Feature Set not supported | None |
acA1300-60gmNIR | PGI Feature Set not supported | None |
acA1300-60gc | PGI Feature Set not supported | None |
acA1300-75gm |
|
|
acA1300-75gc |
|
|
acA1440-73gm |
|
|
acA1440-73gc |
|
|
acA1600-20gm | PGI Feature Set not supported | None |
acA1600-20gc | PGI Feature Set not supported | None |
acA1600-60gm | PGI Feature Set not supported | None |
acA1600-60gc | PGI Feature Set not supported | None |
acA1920-25gm | PGI Feature Set not supported | None |
acA1920-25gc | PGI Feature Set not supported | None |
acA1920-40gm |
|
|
acA1920-40gc |
|
|
acA1920-48gm |
|
|
acA1920-48gc |
|
|
acA1920-50gm |
|
|
acA1920-50gc |
|
|
acA2000-50gm | PGI Feature Set not supported | None |
acA2000-50gmNIR | PGI Feature Set not supported | None |
acA2000-50gc | PGI Feature Set not supported | None |
acA2040-25gm | PGI Feature Set not supported | None |
acA2040-25gmNIR | PGI Feature Set not supported | None |
acA2040-25gc | PGI Feature Set not supported | None |
acA2040-35gm |
|
|
acA2040-35gc |
|
|
acA2440-20gm |
|
|
acA2440-20gc |
|
|
acA2500-14gm | PGI Feature Set not supported | None |
acA2500-14gc | PGI Feature Set not supported | None |
acA2500-20gm |
|
|
acA2500-20gc |
|
|
acA2500-20gmMED |
|
|
acA2500-20gcMED |
|
|
acA3088-16gm |
|
|
acA3088-16gc |
|
|
acA3800-10gm | PGI Feature Set not supported | None |
acA3800-10gc | PGI Feature Set not supported | None |
acA4024-8gm |
|
|
acA4024-8gc |
|
|
acA4096-11gm |
|
|
acA4096-11gc |
|
|
acA4112-8gm |
|
|
acA4112-8gc |
|
|
acA4600-7gc | PGI Feature Set not supported | None |
acA5472-5gm |
|
|
acA5472-5gc |
|
|
acA640-750um |
|
|
acA640-750uc |
|
|
acA640-90um | PGI Feature Set not supported | None |
acA640-90uc | PGI Feature Set not supported | None |
acA640-120um | PGI Feature Set not supported | None |
acA640-120uc | PGI Feature Set not supported | None |
acA720-520um |
|
|
acA720-520uc |
|
|
acA800-510um |
|
|
acA800-510uc |
|
|
acA1300-200um |
|
|
acA1300-200uc |
|
|
acA1300-30um | PGI Feature Set not supported | None |
acA1300-30uc | PGI Feature Set not supported | None |
acA1440-220um |
|
|
acA1440-220uc |
|
|
acA1600-20um | PGI Feature Set not supported | None |
acA1600-20uc | PGI Feature Set not supported | None |
acA1920-25um | PGI Feature Set not supported | None |
acA1920-25uc | PGI Feature Set not supported | None |
acA1920-40um |
|
|
acA1920-40uc |
|
|
acA1920-40umMED |
|
|
acA1920-40ucMED |
|
|
acA1920-150um |
|
|
acA1920-150uc |
|
|
acA1920-155um |
|
|
acA1920-155uc |
|
|
acA1920-155umMED |
|
|
acA1920-155ucMED |
|
|
acA2040-90um | PGI Feature Set not supported | None |
acA2040-90umNIR | PGI Feature Set not supported | None |
acA2040-90uc | PGI Feature Set not supported | None |
acA2000-165um | PGI Feature Set not supported | None |
acA2000-165umNIR | PGI Feature Set not supported | None |
acA2000-165uc | PGI Feature Set not supported | None |
acA2040-55um |
|
|
acA2040-55uc |
|
|
acA2040-120um |
|
|
acA2040-120uc |
|
|
acA2440-35um |
|
|
acA2440-35uc |
|
|
acA2440-35umMED |
|
|
acA2440-35ucMED |
|
|
acA2440-75um |
|
|
acA2440-75uc |
|
|
acA2440-75umMED |
|
|
acA2440-75ucMED |
|
|
acA2500-14um | PGI Feature Set not supported | None |
acA2500-14uc | PGI Feature Set not supported | None |
acA2500-60um |
|
|
acA2500-60uc |
|
|
acA3088-57um |
|
|
acA3088-57uc |
|
|
acA3800-14um | PGI Feature Set not supported | None |
acA3800-14uc | PGI Feature Set not supported | None |
acA4024-29um |
|
|
acA4024-29uc |
|
|
acA4096-30um |
|
|
acA4096-30uc |
|
|
acA4096-30umMED |
|
|
acA4096-30ucMED |
|
|
acA4096-40um |
|
|
acA4096-40uc |
|
|
acA4096-40umMED |
|
|
acA4096-40ucMED |
|
|
acA4112-20um |
|
|
acA4112-20uc |
|
|
acA4112-20umMED |
|
|
acA4112-20ucMED |
|
|
acA4112-30um |
|
|
acA4112-30uc |
|
|
acA4112-30umMED |
|
|
acA4112-30ucMED |
|
|
acA4600-10uc | PGI Feature Set not supported | None |
acA5472-17um |
|
|
acA5472-17uc |
|
|
boA4096-93cm | PGI Feature Set not supported | None |
boA4096-93cc | PGI Feature Set not supported | None |
boA4112-68cm | PGI Feature Set not supported | None |
boA4112-68cc | PGI Feature Set not supported | None |
daA1280-54lm |
|
|
daA1280-54lc |
|
|
daA1600-60lm |
|
|
daA1600-60lc |
|
|
daA2500-14lm |
|
|
daA2500-14lc |
|
|
daA2500-60mc (SD820) | PGI Feature Set not supported | None |
daA1280-54um |
|
|
daA1280-54uc |
|
|
daA1600-60um |
|
|
daA1600-60uc |
|
|
daA1920-15um |
|
|
daA1920-30um |
|
|
daA1920-30uc |
|
|
daA2500-14um |
|
|
daA2500-14uc |
|
|
puA1280-54um |
|
|
puA1280-54uc |
|
|
puA1600-60um |
|
|
puA1600-60uc |
|
|
puA1920-30um |
|
|
puA1920-30uc |
|
|
puA2500-14um |
|
|
puA2500-14uc |
|
|
aOnly configurable if the PgiMode parameter is set to ERROR: Variable (PgiMode.Manual) is undefined..
bIf the PgiMode parameter is set to ERROR: Variable (PgiMode.Automatic) is undefined. and you use the Gain feature in combination with Improved Sharpness, increasing the gain reduces the amount of sharpening applied. The value of the SharpnessEnhancement parameter remains the same, but the image appears less sharpened. This adjustment is done automatically to keep noise as low as possible. To disable the adjustment, set the PgiMode parameter to ERROR: Variable (PgiMode.Manual) is undefined..
/* dart and pulse Cameras */
// Enable the PGI feature set with manual noise reduction
camera.PgiMode.SetValue(PgiMode_Manual);
// Configure noise reduction
camera.NoiseReduction.SetValue(0.2);
// Configure improved sharpness
camera.SharpnessEnhancement.SetValue(1.0);
/* ace cameras */
// Enable the PGI feature set (mono cameras only)
camera.PgiMode.SetValue(PgiMode_On);
// Enable the PGI feature set (color cameras only)
camera.DemosaicingMode.SetValue(DemosaicingMode_BaslerPGI);
// Configure noise reduction (if available)
camera.NoiseReductionAbs.SetValue(0.2);
// Configure improved sharpness (if available)
camera.SharpnessEnhancementAbs.SetValue(1.0);
/* dart and pulse Cameras */
// Enable the PGI feature set with manual noise reduction
camera.PgiMode.SetValue(PgiMode_Manual);
// Configure noise reduction
camera.NoiseReduction.SetValue(0.2);
// Configure improved sharpness
camera.SharpnessEnhancement.SetValue(1.0);
/* ace cameras */
// Enable the PGI feature set (mono cameras only)
camera.PgiMode.SetValue(PgiMode_On);
// Enable the PGI feature set (color cameras only)
camera.DemosaicingMode.SetValue(DemosaicingMode_BaslerPGI);
// Configure noise reduction (if available)
camera.NoiseReduction.SetValue(0.2);
// Configure improved sharpness (if available)
camera.SharpnessEnhancement.SetValue(1.0);
INodeMap& nodemap = camera.GetNodeMap();
/*dart and pulse Cameras*/
CEnumerationPtr(nodemap.GetNode("PgiMode"))->FromString("Manual");
// Configure noise reduction
CFloatPtr(nodemap.GetNode("NoiseReduction"))->SetValue(0.2);
// Configure improved sharpness
CFloatPtr(nodemap.GetNode("SharpnessEnhancement"))->SetValue(1.0);
/*ace cameras*/
CEnumerationPtr(nodemap.GetNode("PgiMode"))->FromString("On");
// Enable the PGI feature set (color cameras only)
CEnumerationPtr(nodemap.GetNode("DemosaicingMode"))->FromString("BaslerPGI");
// Configure noise reduction (if available)
CFloatPtr(nodemap.GetNode("NoiseReductionAbs"))->SetValue(0.2);
// Configure improved sharpness (if available)
CFloatPtr(nodemap.GetNode("SharpnessEnhancementAbs"))->SetValue(1.0);
/*dart and pulse Cameras*/
CEnumerationPtr(nodemap.GetNode("PgiMode"))->FromString("Manual");
// Configure noise reduction
CFloatPtr(nodemap.GetNode("NoiseReduction"))->SetValue(0.2);
// Configure improved sharpness
CFloatPtr(nodemap.GetNode("SharpnessEnhancement"))->SetValue(1.0);
/*ace cameras*/
CEnumerationPtr(nodemap.GetNode("PgiMode"))->FromString("On");
// Enable the PGI feature set (color cameras only)
CEnumerationPtr(nodemap.GetNode("DemosaicingMode"))->FromString("BaslerPGI");
// Configure noise reduction (if available)
CFloatPtr(nodemap.GetNode("NoiseReduction"))->SetValue(0.2);
// Configure improved sharpness (if available)
CFloatPtr(nodemap.GetNode("SharpnessEnhancement"))->SetValue(1.0);
/*dart and pulse Cameras*/
camera.Parameters[PLCamera.PgiMode].SetValue(PLCamera.PgiMode.Manual);
// Configure noise reduction
camera.Parameters[PLCamera.NoiseReduction].SetValue(0.2);
// Configure improved sharpness
camera.Parameters[PLCamera.SharpnessEnhancement].SetValue(1.0);
/*ace cameras*/
camera.Parameters[PLCamera.PgiMode].SetValue(PLCamera.PgiMode.On);
// Enable the PGI feature set (color cameras only)
camera.Parameters[PLCamera.DemosaicingMode].SetValue(PLCamera.DemosaicingMode.BaslerPGI);
// Configure noise reduction (if available)
camera.Parameters[PLCamera.NoiseReductionAbs].SetValue(0.2);
// Configure improved sharpness (if available)
camera.Parameters[PLCamera.SharpnessEnhancementAbs].SetValue(1.0);
/*dart and pulse Cameras*/
camera.Parameters[PLCamera.PgiMode].SetValue(PLCamera.PgiMode.Manual);
// Configure noise reduction
camera.Parameters[PLCamera.NoiseReduction].SetValue(0.2);
// Configure improved sharpness
camera.Parameters[PLCamera.SharpnessEnhancement].SetValue(1.0);
/*ace cameras*/
camera.Parameters[PLCamera.PgiMode].SetValue(PLCamera.PgiMode.On);
// Enable the PGI feature set (color cameras only)
camera.Parameters[PLCamera.DemosaicingMode].SetValue(PLCamera.DemosaicingMode.BaslerPGI);
// Configure noise reduction (if available)
camera.Parameters[PLCamera.NoiseReduction].SetValue(0.2);
// Configure improved sharpness (if available)
camera.Parameters[PLCamera.SharpnessEnhancement].SetValue(1.0);
/*dart and pulse Cameras*/
Pylon.DeviceFeatureFromString(hdev, "PgiMode", "Manual");
// Configure noise reduction
Pylon.DeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
// Configure improved sharpness
Pylon.DeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
/*ace cameras*/
Pylon.DeviceFeatureFromString(hdev, "PgiMode", "On");
// Enable the PGI feature set (color cameras only)
Pylon.DeviceFeatureFromString(hdev, "DemosaicingMode", "BaslerPGI");
// Configure noise reduction (if available)
Pylon.DeviceSetFloatFeature(hdev, "NoiseReductionAbs", 0.2);
// Configure improved sharpness (if available)
Pylon.DeviceSetFloatFeature(hdev, "SharpnessEnhancementAbs", 1.0);
/*dart and pulse Cameras*/
Pylon.DeviceFeatureFromString(hdev, "PgiMode", "Manual");
// Configure noise reduction
Pylon.DeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
// Configure improved sharpness
Pylon.DeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
/*ace cameras*/
Pylon.DeviceFeatureFromString(hdev, "PgiMode", "On");
// Enable the PGI feature set (color cameras only)
Pylon.DeviceFeatureFromString(hdev, "DemosaicingMode", "BaslerPGI");
// Configure noise reduction (if available)
Pylon.DeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
// Configure improved sharpness (if available)
Pylon.DeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
/* 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 */
/*dart and pulse Cameras*/
errRes = PylonDeviceFeatureFromString(hdev, "PgiMode", "Manual");
CHECK(errRes);
/* Configure noise reduction */
errRes = PylonDeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
CHECK(errRes);
/* Configure improved sharpness */
errRes = PylonDeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
CHECK(errRes);
/*ace cameras*/
errRes = PylonDeviceFeatureFromString(hdev, "PgiMode", "On");
CHECK(errRes);
/* Enable the PGI feature set (color cameras only) */
errRes = PylonDeviceFeatureFromString(hdev, "DemosaicingMode", "BaslerPGI");
CHECK(errRes);
/* Configure noise reduction (if available) */
errRes = PylonDeviceSetFloatFeature(hdev, "NoiseReductionAbs", 0.2);
CHECK(errRes);
/* Configure improved sharpness (if available) */
errRes = PylonDeviceSetFloatFeature(hdev, "SharpnessEnhancementAbs", 1.0);
CHECK(errRes);
/*dart and pulse Cameras*/
errRes = PylonDeviceFeatureFromString(hdev, "PgiMode", "Manual");
CHECK(errRes);
/* Configure noise reduction */
errRes = PylonDeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
CHECK(errRes);
/* Configure improved sharpness */
errRes = PylonDeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
CHECK(errRes);
/*ace cameras*/
errRes = PylonDeviceFeatureFromString(hdev, "PgiMode", "On");
CHECK(errRes);
/* Enable the PGI feature set (color cameras only) */
errRes = PylonDeviceFeatureFromString(hdev, "DemosaicingMode", "BaslerPGI");
CHECK(errRes);
/* Configure noise reduction (if available) */
errRes = PylonDeviceSetFloatFeature(hdev, "NoiseReduction", 0.2);
CHECK(errRes);
/* Configure improved sharpness (if available) */
errRes = PylonDeviceSetFloatFeature(hdev, "SharpnessEnhancement", 1.0);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.