Region

Support

Required licenses

EasyImage

Recommended images

Any

Location

[…]C:\Users\Public\Documents\Euresys\Open eVision 24.02\Sample Programs
\[LANGUAGE] samples
\Image Processing\Region

Purpose

This sample program demonstrates how to:

Create an ERegion and use it to restrict Open eVision processing to its domain.

Code highlights

1. Create an ERegion with the desired geometrical shape.
_region = new EPolygonRegion(...);
_region = new ERectangleRegion(...);
_region = new ECircleRegion(...);
_region = new EEllipseRegion(...);
2. Retrieve the handle at the given coordinates so you can later move it to new coordinates and modify the ERegion.
handle = _region.HitTest(x, y);
3. Move the previously retrieved handle to a new position to modify the ERegion.
_region.Drag(handle, x, y);
4. Draw the ERegion components, respectively the area, the contour and the handles (for graphical manipulation purposes).
_region->Draw(render_hdc);
_region->DrawContour(render_hdc);
_region->DrawHandles(render_hdc);
5. Compute the pixel average on the image, restricted to the domain of the ERegion.
EasyImage::PixelAverage(&_image, *_region, average);