跳转到内容

Center X and Center Y (dart E)#

相机的 Center X and Center Y 功能使您可以水平和/或垂直地将图像 ROI 居中。

该功能的使用#

使用 Center X#

To center the image horizontally, 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.

使用 Center Y#

To center the image vertically, 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.

示例代码#

// Center the image ROI
camera.BslCenterX.Execute();
camera.BslCenterY.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Center the image ROI
CCommandParameter(nodemap, "BslCenterX").Execute();
CCommandParameter(nodemap, "BslCenterY").Execute();
// Center the image ROI
camera.Parameters[PLCamera.BslCenterX].Execute();
camera.Parameters[PLCamera.BslCenterY].Execute();
/* 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 */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterX");
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterY");
CHECK(errRes);
# Center the image ROI
camera.BslCenterX.Execute()
camera.BslCenterY.Execute()
/* 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 */
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterX");
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "BslCenterY");
CHECK(errRes);

您还可以使用 pylon Viewer 轻松设置参数。