Make sure the camera is idle, i.e., not capturing images.
Set the BslDualROIRowsEnable parameter to true.
Set the BslDualROIRowSelector parameter to Row1.
Set the BslDualROIRowOffset parameter to the desired vertical offset of the row, e.g., 100.
Set the BslDualROIRowSize parameter to the desired height of the row, e.g., 50.
Verify that the value of the BslDualROIImageValid parameter is true. If not, change your parameter settings. For example, the regions must not overlap, and the total height of all regions must not exceed the height of the image sensor.
Repeat the above steps for row 2.
Set the OffsetX parameter to the desired horizontal offset of both regions.
Set the Width parameter to the desired width of both regions.
If the BslDualROIRowsEnable parameter is set to true, the following parameters are set automatically whenever image acquisition starts:
OffsetY: The parameter is set to the vertical offset of row 1.
Height: The parameter is set to the total height of all regions, i.e., the height of the images created by the Dual ROI feature.
Changing these parameters while using the Dual ROI feature is possible, but has no effect.
The auto function ROI position and size does not automatically adapt to the output of the Dual ROI feature. If you're using an auto function, make sure the Dual ROI regions are contained in the auto function ROI.
// ** In this example, we define two regions in vertical direction// that will be transmitted as a single image. **// Enable the Dual ROI featurecamera.BslDualROIRowsEnable.SetValue(true);// Select row 1camera.BslDualROIRowSelector.SetValue(BslDualROIRowSelector_Row1);// The first region should have a vertical offset of 100 and a height of 300 pixelscamera.BslDualROIRowOffset.SetValue(100);camera.BslDualROIRowSize.SetValue(300);// Select row 2camera.BslDualROIRowSelector.SetValue(BslDualROIRowSelector_Row1);// The second region should have a vertical offset of 500 and a height of 400 pixelscamera.BslDualROIRowOffset.SetValue(500);camera.BslDualROIRowSize.SetValue(400);// Check whether the outgoing image is validboolheightValid=camera.BslDualROIImageValid.GetValue();// Both regions should have a horizontal offset of 200 and a width of 500camera.OffsetX.SetValue(200);camera.Width.SetValue(500);
INodeMap&nodemap=camera.GetNodeMap();// ** In this example, we define two regions in vertical direction// that will be transmitted as a single image. **// Enable the Dual ROI featureCBooleanParameter(nodemap,"BslDualROIRowsEnable").SetValue(true);// Select row 1CEnumParameter(nodemap,"BslDualROIRowSelector").SetValue("Row1");// The first region should have a vertical offset of 100 and a height of 300 pixelsCIntegerParameter(nodemap,"BslDualROIRowOffset").SetValue(100);CIntegerParameter(nodemap,"BslDualROIRowSize").SetValue(300);// Select row 2CEnumParameter(nodemap,"BslDualROIRowSelector").SetValue("Row1");// The second region should have a vertical offset of 500 and a height of 400 pixelsCIntegerParameter(nodemap,"BslDualROIRowOffset").SetValue(500);CIntegerParameter(nodemap,"BslDualROIRowSize").SetValue(400);// Check whether the outgoing image is validboolheightValid=CBooleanParameter(nodemap,"BslDualROIImageValid").GetValue();// Both regions should have a horizontal offset of 200 and a width of 500CIntegerParameter(nodemap,"OffsetX").SetValue(200);CIntegerParameter(nodemap,"Width").SetValue(500);
// ** In this example, we define two regions in vertical direction// that will be transmitted as a single image. **// Enable the Dual ROI featurecamera.Parameters[PLCamera.BslDualROIRowsEnable].SetValue(true);// Select row 1camera.Parameters[PLCamera.BslDualROIRowSelector].SetValue(PLCamera.BslDualROIRowSelector.Row1);// The first region should have a vertical offset of 100 and a height of 300 pixelscamera.Parameters[PLCamera.BslDualROIRowOffset].SetValue(100);camera.Parameters[PLCamera.BslDualROIRowSize].SetValue(300);// Select row 2camera.Parameters[PLCamera.BslDualROIRowSelector].SetValue(PLCamera.BslDualROIRowSelector.Row1);// The second region should have a vertical offset of 500 and a height of 400 pixelscamera.Parameters[PLCamera.BslDualROIRowOffset].SetValue(500);camera.Parameters[PLCamera.BslDualROIRowSize].SetValue(400);// Check whether the outgoing image is validboolheightValid=camera.Parameters[PLCamera.BslDualROIImageValid].GetValue();// Both regions should have a horizontal offset of 200 and a width of 500camera.Parameters[PLCamera.OffsetX].SetValue(200);camera.Parameters[PLCamera.Width].SetValue(500);
/* 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 */_BoolheightValid=false;/* ** In this example, we define two regions in vertical direction *//* that will be transmitted as a single image. ** *//* Enable the Dual ROI feature */errRes=PylonDeviceSetBooleanFeature(hdev,"BslDualROIRowsEnable",1);CHECK(errRes);/* Select row 1 */errRes=PylonDeviceFeatureFromString(hdev,"BslDualROIRowSelector","Row1");CHECK(errRes);/* The first region should have a vertical offset of 100 and a height of 300 pixels */errRes=PylonDeviceSetIntegerFeature(hdev,"BslDualROIRowOffset",100);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"BslDualROIRowSize",300);CHECK(errRes);/* Select row 2 */errRes=PylonDeviceFeatureFromString(hdev,"BslDualROIRowSelector","Row1");CHECK(errRes);/* The second region should have a vertical offset of 500 and a height of 400 pixels */errRes=PylonDeviceSetIntegerFeature(hdev,"BslDualROIRowOffset",500);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"BslDualROIRowSize",400);CHECK(errRes);/* Check whether the outgoing image is valid */errRes=PylonDeviceGetBooleanFeature(hdev,"BslDualROIImageValid",&heightValid);CHECK(errRes);/* Both regions should have a horizontal offset of 200 and a width of 500 */errRes=PylonDeviceSetIntegerFeature(hdev,"OffsetX",200);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"Width",500);CHECK(errRes);
# ** In this example, we define two regions in vertical direction# that will be transmitted as a single image. **# Enable the Dual ROI featurecamera.BslDualROIRowsEnable.Value=True# Select row 1camera.BslDualROIRowSelector.Value="Row1"# The first region should have a vertical offset of 100 and a height of 300 pixelscamera.BslDualROIRowOffset.Value=100camera.BslDualROIRowSize.Value=300# Select row 2camera.BslDualROIRowSelector.Value="Row1"# The second region should have a vertical offset of 500 and a height of 400 pixelscamera.BslDualROIRowOffset.Value=500camera.BslDualROIRowSize.Value=400# Check whether the outgoing image is validheightValid=camera.BslDualROIImageValid.Value# Both regions should have a horizontal offset of 200 and a width of 500camera.OffsetX.Value=200camera.Width.Value=500