Center X and Center Y (dart E)#
機能を使用する#
中心Xを使用#
画像を水平方向の中央に配置するには、次を実行します: BslCenterX コマンド。
カメラは次を調整します。 OffsetX パラメータ値を使用して次の中央に配置します。 画像ROI 水平方向に。これは1回限りの操作です。次の幅を変更する場合: 画像ROI、もう一度コマンドを実行する必要があります。
中心Yを使用#
画像を垂直方向の中央に配置するには、次を実行します: BslCenterY コマンド。
カメラは次を調整します。 OffsetY パラメータ値を使用して次の中央に配置します。 画像ROI 垂直方向に。これは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);
pylon Viewer を使用してパラメータを簡単に設定することもできます。