Center X and Center Y (dart E)#
该功能的使用#
使用 Center X#
要使图像水平居中,请执行 BslCenterX
命令。
相机调整 OffsetX
参数值,使 Image ROI 水平居中。这是一次性操作。更改 Image ROI 的宽度时,必须再次执行该命令。
使用 Center Y#
要使图像垂直居中,请执行 BslCenterY
命令。
相机调整 OffsetY
参数值使 Image ROI 垂直居中。这是一次性操作。更改 Image 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);
You can also use the pylon Viewer to easily set the parameters.