Center X and Center Y (dart E)#
该功能的使用#
使用 Center X#
要水平居中图像,请执行 BslCenterX 命令。
相机调整 OffsetX 参数值以便将 图像 ROI 水平居中。这是一次性操作。当您更改 图像 ROI的宽度时,必须重新执行该命令。
使用 Center Y#
要垂直居中图像,请执行 BslCenterY 命令。
相机调整 OffsetY 参数值以便将 图像 ROI 垂直。这是一次性操作。当您更改 图像 ROI的宽度时,必须重新执行该命令。
示例代码#
/* 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);
/* 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 轻松设置参数。