Working with a Region

In some cases, most often to decrease the processing time or to single-out the object you want to analyze, you do not want to process the whole image but only a part of it.

You can define and use regions of interest (ROI) to restrict the area processed with your vision tool.

  • In eVision:

    • An ROI EBaseROI .NET Python class designates a rectangular region of interest.

    • A region ERegion .NET Python class designates an arbitrarily shaped ROI. With regions, you can determine precisely which part of the image, down to a single pixel, is used for your processing.

See also

For more details on ERegions, see Arbitrarily Shaped ROI (ERegion).

Hint

An ERegion is an arbitrary shape. If you want to use a simple rectangular ROI attached to an image, consider Step 3: Managing an ROI:.

Process

1. Draw the ERegion

Though it is not required, it is often easier to draw the ERegion based on an actual image:

  • Add an image tool.

  • Open an image representative of your setup.

2. Add a Region Editor Tool:

../../_images/working_with_a_region_1.webp
1. Open the Tool Catalog
2. Open the Easy collection
3. Double-click on the Region editor tool:
  • The Region editor tool is added to the graph.

3. Connect the Source Image:

  • This is only required if you are using an image as input to help drawing the region.

  • Connect the Image file tool to the Region editor tool and select a Link type for this connection.

4. Draw your Region:

1. Open the Setup View of the Region editor tool
2. Add shapes:
  • Use add Primitives buttons and, using your mouse, move and adjust the shapes.

3. Combine and remove shapes:
  • SHIFT + click to select 2 shapes in the list.

  • Click on a button (merge, intersection or substract) to combine them.

4. To Transform a shape:
  • Select it in the list, set the Radius and click on the Grow region or Shrink region button.

5. To reuse thoses regions later:
  • Either in the same project or a different one.

  • Save it first.

  • Then Load it.

Hint

Don’t forget to link the tool by connecting your Region editor output region port to the input region port of another tool.