The Image ROI camera feature allows you to specify the part of the sensor array that you want to use for image acquisition.
ROI is short for region of interest.
If an image ROI has been specified, the camera will only transmit pixel data from within that region. On most cameras, this increases the camera's maximum frame rate significantly.
// Set the width to the maximum valueint64_tmaxWidth=camera.WidthMax.GetValue();camera.Width.SetValue(maxWidth);// Set the height to 500camera.Height.SetValue(500);// Set the offset to 0camera.OffsetX.SetValue(0);camera.OffsetY.SetValue(0);
INodeMap&nodemap=camera.GetNodeMap();// Set the width to the maximum valueint64_tmaxWidth=CIntegerParameter(nodemap,"WidthMax").GetValue();CIntegerParameter(nodemap,"Width").SetValue(maxWidth);// Set the height to 500CIntegerParameter(nodemap,"Height").SetValue(500);// Set the offset to 0CIntegerParameter(nodemap,"OffsetX").SetValue(0);CIntegerParameter(nodemap,"OffsetY").SetValue(0);
// Set the width to the maximum valueInt64maxWidth=camera.Parameters[PLCamera.WidthMax].GetValue();camera.Parameters[PLCamera.Width].SetValue(maxWidth);// Set the height to 500camera.Parameters[PLCamera.Height].SetValue(500);// Set the offset to 0camera.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_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods */int64_tmaxWidth=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 valuemaxWidth=camera.WidthMax.Valuecamera.Width.Value=maxWidth# Set the height to 500camera.Height.Value=500# Set the offset to 0camera.OffsetX.Value=0camera.OffsetY.Value=0
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods */int64_tmaxWidth=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);
You can also use the pylon Viewer to easily set the parameters.