コンテンツにスキップ

Image ROI (dart E)#

Image ROIカメラ機能を使用すると、画像取得に使用するセンサーアレイの部分を指定できます。

ROIはregion of interest(対象領域)の略です。

画像ROIを指定した場合、カメラはその領域内からの画素データのみを送信します。ほとんどのカメラでは、これによりカメラの最大フレームレートが大幅に向上します。

機能を使用する#

Image ROIの位置とサイズの変更#

工場出荷時の設定を有効にすると、カメラはデフォルトの解像度に設定されます。ただし、必要に応じて位置とサイズを変更できます。

画像ROIの位置とサイズを変更するには、次の手順に従います。

  1. カメラがアイドル状態であること、つまり画像をキャプチャしていないことを確認します。
  2. 次のパラメーターを使用して、画像ROIのサイズを指定します。

    • Width
    • Height
  3. 次のパラメーターを使用して、画像ROIの位置を指定します。

    • OffsetX
    • OffsetY

画像ROIの原点は、センサーアレイの左上隅(列0、行0)になります。

例:次の設定を指定したとします。

  • Width = 16
  • Height = 10
  • OffsetX = 2
  • OffsetY = 6

これにより、次のイメージROIが作成されます。

Image ROIの例

画像ROIのサイズ(特に高さ)を小さくすると、カメラの最大フレームレートが非常に高くなります。

ガイドライン#

画像ROIを指定する場合は、次のガイドラインに従ってください。

ガイドライン
OffsetX + WidthWidthMax Camera with a 1920 x 1080 pixel sensor:
OffsetX + Width ≤ 1920
OffsetY + HeightHeightMax Camera with a 1920 x 1080 pixel sensor:
OffsetY + Height ≤ 1080

特性#

Image ROIのサイズ#

カメラモデル Minimum Width Width Increment Minimum Height Height Increment
daA2500-60mc 2 2 2 2
daA2500-60mci 96 8 64 8
daA3840-30mc 2 2 2 2
daA4200-30mci 96 8 64 8

Image ROIのオフセット#

カメラモデル Offset X Increment Offset Y Increment
daA2500-60mc 2 2
daA2500-60mci 8 8
daA3840-30mc 2 2
daA4200-30mci 8 8

サンプルコード#

// Set the width to the maximum value
int64_t maxWidth = camera.WidthMax.GetValue();
camera.Width.SetValue(maxWidth);
// Set the height to 500
camera.Height.SetValue(500);
// Set the offset to 0
camera.OffsetX.SetValue(0);
camera.OffsetY.SetValue(0);
INodeMap& nodemap = camera.GetNodeMap();
// Set the width to the maximum value
int64_t maxWidth = CIntegerParameter(nodemap, "WidthMax").GetValue();
CIntegerParameter(nodemap, "Width").SetValue(maxWidth);
// Set the height to 500
CIntegerParameter(nodemap, "Height").SetValue(500);
// Set the offset to 0
CIntegerParameter(nodemap, "OffsetX").SetValue(0);
CIntegerParameter(nodemap, "OffsetY").SetValue(0);
// Set the width to the maximum value
Int64 maxWidth = camera.Parameters[PLCamera.WidthMax].GetValue();
camera.Parameters[PLCamera.Width].SetValue(maxWidth);
// Set the height to 500
camera.Parameters[PLCamera.Height].SetValue(500);
// Set the offset to 0
camera.Parameters[PLCamera.OffsetX].SetValue(0);
camera.Parameters[PLCamera.OffsetY].SetValue(0);
/* 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 */
int64_t maxWidth = 0;
/* Set the width to the maximum value */
errRes = PylonDeviceGetIntegerFeature(hdev, "WidthMax", &maxWidth);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", maxWidth);
CHECK(errRes);
/* Set the height to 500 */
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 500);
CHECK(errRes);
/* Set the offset to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetX", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetY", 0);
CHECK(errRes);
# Set the width to the maximum value
maxWidth = camera.WidthMax.Value
camera.Width.Value = maxWidth
# Set the height to 500
camera.Height.Value = 500
# Set the offset to 0
camera.OffsetX.Value = 0
camera.OffsetY.Value = 0
/* 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 */
int64_t maxWidth = 0;
/* Set the width to the maximum value */
errRes = PylonDeviceGetIntegerFeature(hdev, "WidthMax", &maxWidth);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", maxWidth);
CHECK(errRes);
/* Set the height to 500 */
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 500);
CHECK(errRes);
/* Set the offset to 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetX", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "OffsetY", 0);
CHECK(errRes);

pylonViewerアを使用して、パラメーターを簡単に設定することもできます。