Center X and Center Y

The Center X and Center Y camera feature allows you to center the image ROI horizontally, vertically, or both.

In this topic Hide

Using the Feature

Enabling Center X

The way you enable Center X varies by camera model.

To enable Center X:

  1. If the CenterX parameter is available for your camera model, set the CenterX parameter to true.
    The camera adjusts the OffsetX parameter value to center the image ROI horizontally.
    When you change the width of the image ROI, the OffsetX parameter value automatically adapts.  The OffsetX parameter becomes read-only.
  2. If the BslCenterX parameter is available for your camera model, execute the BslCenterX command.
    The camera adjusts the OffsetX parameter value to center the image ROI horizontally.
    This is a one-time operation. When you change the width of the image ROI, you must execute the command again.

Enabling Center Y

The way you enable Center Y varies by camera model.

To enable Center Y:

  1. If the CenterY parameter is available for your camera model, set the CenterY parameter to true.
    The camera adjusts the OffsetY parameter value to center the image ROI vertically.
    When you change the height of the image ROI, the OffsetY parameter value automatically adapts.  The OffsetY parameter becomes read-only.
  2. If the BslCenterY parameter is available for your camera model, execute the BslCenterY command.
    The camera adjusts the OffsetY parameter value to center the image ROI vertically.
    This is a one-time operation. When you change the height of the image ROI, you must execute the command again.

Specifics

Camera Model Parameter Names
All ace 2 GigE camera models
  • BslCenterX
  • BslCenterY
All ace 2 USB 3.0 camera models
  • BslCenterX
  • BslCenterY
All ace USB 3.0 camera models
  • CenterX
  • CenterY
All ace GigE camera models
  • CenterX
  • CenterY
All boost CXP-12 camera models
  • BslCenterX
  • BslCenterY
All dart BCON for LVDS camera models Center X and Center Y feature not supported
All dart BCON for MIPI cameras models Center X and Center Y feature not supported
All dart USB 3.0 camera models Center X and Center Y feature not supported
All pulse USB 3.0 camera models Center X and Center Y feature not supported

Sample Code

// Center the image ROI using CenterX and CenterY parameters
camera.CenterX.SetValue(true);
camera.CenterY.SetValue(true);
// Center the image ROI using BslCenterX and BslCenterY parameters
camera.BslCenterX.Execute();
camera.BslCenterY.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Center the image ROI using CenterX and CenterY parameters
CBooleanPtr(nodemap.GetNode("CenterX"))->SetValue(true);
CBooleanPtr(nodemap.GetNode("CenterY"))->SetValue(true);
// Center the image ROI using BslCenterX and BslCenterY parameters
CCommandPtr(nodemap.GetNode("BslCenterX"))->Execute();
CCommandPtr(nodemap.GetNode("BslCenterY"))->Execute();
// Center the image ROI using CenterX and CenterY parameters
camera.Parameters[PLCamera.CenterX].SetValue(true);
camera.Parameters[PLCamera.CenterY].SetValue(true);
// Center the image ROI using BslCenterX and BslCenterY parameters
camera.Parameters[PLCamera.BslCenterX].Execute();
camera.Parameters[PLCamera.BslCenterY].Execute();
// Center the image ROI using CenterX and CenterY parameters
Pylon.DeviceSetBooleanFeature(hdev, "CenterX", true);
Pylon.DeviceSetBooleanFeature(hdev, "CenterY", true);
// Center the image ROI using BslCenterX and BslCenterY parameters
Pylon.DeviceExecuteCommandFeature(hdev, "BslCenterX");
Pylon.DeviceExecuteCommandFeature(hdev, "BslCenterY");
/* 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 */
/* Center the image ROI using CenterX and CenterY parameters */
errRes = PylonDeviceSetBooleanFeature(hdev, "CenterX", 1);
CHECK(errRes);
errRes = PylonDeviceSetBooleanFeature(hdev, "CenterY", 1);
CHECK(errRes);
/* Center the image ROI using BslCenterX and BslCenterY parameters */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterX");
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterY");
CHECK(errRes);

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