This increases the brightness of the image. If your camera doesn't support the digital shift feature, you can use the Gain feature to achieve a similar effect.
In this topic Hide
Configuring a digital shift factor of n results in a logical left shift by n on all pixel values. This has the effect of multiplying all pixel values by 2n.
If the resulting pixel value is greater than the maximum value possible for the current pixel format (e.g., 4 095 for a 12-bit pixel format), the value is set to the maximum value.
For more information, see the examples below.
To configure the digital shift factor, enter the desired value for the DigitalShift parameter.
By default, the parameter is set to 0, i.e., digital shift is disabled.
Assume that you have entered a digital shift factor of 1 on a camera that uses a 12-bit pixel format. This has the following effects:
Assume that you have entered a digital shift factor of 2 on a camera that uses a 12-bit pixel format. This has the following effects:
Assume that your camera has a maximum pixel bit depth of 12 bit, but is currently using an 8-bit pixel format.
In this case, the camera first performs the digital shift calculation on the 12-bit image data. Then, the camera drops the 4 least significant bits and transmits the 8 most significant bits:
On the following camera models, if an 8-bit pixel format is set, digital shift will be performed on 10-bit image data, regardless of the maximum pixel bit depth: acA720-290gm/gc, acA1440-73gm/gc, acA1920-40gm/gc, acA1920-50gm/gc, acA1440-220um/uc, acA1920-40um/uc, acA1920-155um/uc, acA2040-120um/uc, acA2440-75um/uc, acA4096-40um/uc, acA4112-30um/uc.
Assume that your camera is using a 12-bit pixel format. Also assume that one of your original pixel values is 2 839:
If you apply digital shift by 1 to this pixel value, the resulting value is greater than the maximum possible value for 12-bit pixel formats (4096 + 1024 + 512 + 32 + 8 + 4 + 2 = 5678; maximum value for 12-bit formats: 4 095). In this case, the value is set to the maximum value, i.e., all bits are set to 1:
As a consequence, make sure not to apply a digital shift factor that is too high for your imaging scenario. Otherwise, all bright areas in your images will be set to white, i.e., image information will be lost.
// Disable digital shift
camera.DigitalShift.SetValue(0);
// Enable digital shift by 2
camera.DigitalShift.SetValue(2);
INodeMap& nodemap = camera.GetNodeMap();
// Disable digital shift
CIntegerPtr(nodemap.GetNode("DigitalShift"))->SetValue(0);
// Enable digital shift by 2
CIntegerPtr(nodemap.GetNode("DigitalShift"))->SetValue(2);
// Disable digital shift
camera.Parameters[PLCamera.DigitalShift].SetValue(0);
// Enable digital shift by 2
camera.Parameters[PLCamera.DigitalShift].SetValue(2);
// Disable digital shift
Pylon.DeviceSetIntegerFeature(hdev, "DigitalShift", 0);
// Enable digital shift by 2
Pylon.DeviceSetIntegerFeature(hdev, "DigitalShift", 2);
/* 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 digital shift */
errRes = PylonDeviceSetIntegerFeature(hdev, "DigitalShift", 0);
CHECK(errRes);
/* Enable digital shift by 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "DigitalShift", 2);
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.