Image ROI (dart E)#
ROI 是 region of interest(感興趣區域)的縮寫。
若已指定 Image ROI,相機將僅傳輸該區域內的像素資料。在most cameras上,這會大幅提升相機的最大幀率。
使用此功能#
變更 Image ROI 的位置與大小#
啟用原廠設定後,相機會設為預設解析度。不過,您可以依需求變更位置與大小。
若要變更 Image ROI 的位置與大小:
- 請確保相機處於閒置狀態,也就是未擷取影像。
-
使用下列參數來指定 Image ROI 的 size:
WidthHeight
-
使用下列參數來指定 Image ROI 的 position:
OffsetXOffsetY
Image ROI 的原點位於感光元件陣列的左上角(第 0 行,第 0 列)。
Example: 假設您已指定下列設定:
Width= 16Height= 10OffsetX= 2OffsetY= 6
這會建立下列 Image ROI:
縮小圖像 ROI 的尺寸(尤其是高度)可顯著提高相機的最大幀率。
指導原則#
在指定 Image ROI 時,請遵循以下準則:
| 準則 | 範例 |
|---|---|
OffsetX + Width ≤ WidthMax | 具有 1920 x 1080 像素感測器的相機:OffsetX + Width ≤ 1920 |
OffsetY + Height ≤ HeightMax | 具有 1920 x 1080 像素感測器的相機: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 Offsets#
| 相機型號 | Offset X Increment | Offset Y Increment |
|---|---|---|
| daA2500-60mc | 2 | 2 |
| daA2500-60mci | 8 | 8 |
| daA3840-30mc | 2 | 2 |
| daA4200-30mci | 8 | 8 |
範例程式碼#
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);
/* 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);
您也可以使用 pylon Viewer 輕鬆設定參數。