コンテンツにスキップ
ステージングサーバー
開発サーバー

Center X and Center Y (dart E)#

Center X and Center Yカメラ機能を使用すると、画像ROIを水平方向、垂直方向、またはその両方にセンタリングできます。

機能を使用する#

中心Xを使用#

画像を水平方向の中央に配置するには、次を実行します: BslCenterX コマンド。

カメラは次を調整します。 OffsetX パラメータ値を使用して次の中央に配置します。 画像ROI 水平方向に。これは1回限りの操作です。次の幅を変更する場合: 画像ROI、もう一度コマンドを実行する必要があります。

中心Yを使用#

画像を垂直方向の中央に配置するには、次を実行します: BslCenterY コマンド。

カメラは次を調整します。 OffsetY パラメータ値を使用して次の中央に配置します。 画像ROI 垂直方向に。これは1回限りの操作です。次の高さを変更する場合: 画像ROI、もう一度コマンドを実行する必要があります。

サンプルコード#

// Center the image ROI
camera.BslCenterX.Execute();
camera.BslCenterY.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Center the image ROI
CCommandParameter(nodemap, "BslCenterX").Execute();
CCommandParameter(nodemap, "BslCenterY").Execute();
// Center the image ROI
camera.Parameters[PLCamera.BslCenterX].Execute();
camera.Parameters[PLCamera.BslCenterY].Execute();
/* 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);
# Center the image ROI
camera.BslCenterX.Execute()
camera.BslCenterY.Execute()
/* 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 を使用してパラメータを簡単に設定することもできます。