ROI Placement Code Snippet

This code snippet shows how to attach an ROI to an image and set its placement.

C++

#include <eVision/Easy/EImageBW8.h>
using namespace eVision;
// Image constructor
EImageBW8 parentImage;
// ROI constructor
EROIBW8 myROI;
// ...
// Attach the ROI to the image
myROI.Attach(&parentImage);
// Set the ROI position
myROI.SetPlacement(50, 50, 200, 100);

C#

using eVision;
// Image constructor
EImageBW8 parentImage = new EImageBW8();
// ROI constructor
EROIBW8 myROI = new EROIBW8();
// Attach the ROI to the image
myROI.Attach(parentImage);
//Set the ROI position
myROI.SetPlacement(50, 50, 200, 100);

Python

import eVision
# Image constructor
parent_image = eVision.EImageBW8()
# ROI constructor
my_roi = eVision.EROIBW8()
# Attach the ROI to the image
my_roi.Attach(parent_image)
# Set the ROI position
my_roi.SetPlacement(50, 50, 200, 100)