Center X and Center Y (dart E)#
機能を使用する#
中心Xを使用#
画像を水平方向にセンタリングするには、BslCenterX
コマンドを実行します。
カメラは、画像ROIを水平方向にセンタリングするようにOffsetX
パラメーター値を調整します。これは1回限りの操作です。画像ROIの幅を変更する場合は、コマンドを再度実行する必要があります。
中心Yを使用#
画像を垂直方向にセンタリングするには、BslCenterY
コマンドを実行します。
カメラは、画像ROIを垂直方向にセンタリングするようにOffsetY
パラメーター値を調整します。これは1回限りの操作です。画像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.