Center X and Center Y (dart E)#
该功能的使用#
使用 Center X#
To center the image horizontally, execute the BslCenterX command.
The camera adjusts the OffsetX parameter value to center the 图像 ROI horizontally. This is a one-time operation. When you change the width of the 图像 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 图像 ROI vertically. This is a one-time operation. When you change the height of the 图像 ROI, you must execute the command again.
示例代码#
/* 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.