# Inspecting Pads Using Regions

#### SEE ALSO
[Arbitrary-Shaped ROI (ERegion)](../../using/basic_operations/regions/arbitrarily_shaped_roi__eregion_.html.md) / code snippets: [ERegion](../code_snippets/basic_operations/eregion/index.html.md)

The code of this application is available in the `GGeRegion` sample installed with eVision.

## Application objective

This application demonstrates how to use regions to inspect the pads on the underside of a non-aligned electronic chip package.

![image](assets/images/2d_application_examples/inspecting_pads_using_regions/chip.webp)

#### NOTE
To run this program, you need the EasyObject and EasyGauge licenses.

## Processing

To do this, we will use EasyGauge to detect the position of the package, then perform an EasyObject segmentation on the detected position:

1. Use [`ERectangleGauge`](../../doxygen_cpp/classeVision_1_1ERectangleGauge.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1ERectangleGauge.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1ERectangleGauge.html) from the EasyGauge library to detect the package and its position.

![image](assets/images/2d_application_examples/inspecting_pads_using_regions/chip_erectanglegauge.webp)
1. Use the [`ERectangleRegion::ERectangleRegion`](../../doxygen_cpp/classeVision_1_1ERectangleRegion.html#afb5e8e4c9d1ac939905d5d9671649b7f) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1ERectangleRegion.html#ab4355667cc59dea6014a59e88062258b) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1ERectangleRegion.html#acf98ccbc41d45ed31f81a294f3789240) constructor with the [`ERectangle`](../../doxygen_cpp/classeVision_1_1ERectangle.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1ERectangle.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1ERectangle.html) returned by [`ERectangleGauge`](../../doxygen_cpp/classeVision_1_1ERectangleGauge.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1ERectangleGauge.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1ERectangleGauge.html) to create an [`ERegion`](../../doxygen_cpp/classeVision_1_1ERegion.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1ERegion.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1ERegion.html).

![image](assets/images/2d_application_examples/inspecting_pads_using_regions/chip_erectangle.webp)
1. Use the [`EImageEncoder::Encode`](../../doxygen_cpp/classeVision_1_1EImageEncoder.html#a0212a8144f93eba43fbed584140a83cd) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EImageEncoder.html#a0956dbfef4ebce656f72e3471997e518) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EImageEncoder.html#a1292c1003f94e89af9600e99198aed4c) method from the EasyObject library to perform the blob detection within the region.

![image](assets/images/2d_application_examples/inspecting_pads_using_regions/chip_blobs.webp)
1. Filter the blobs using [`EObjectSelection`](../../doxygen_cpp/classeVision_1_1EObjectSelection.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EObjectSelection.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EObjectSelection.html).
2. Perform any required measurement and check.

![image](assets/images/2d_application_examples/inspecting_pads_using_regions/chip_blobs_selection.webp)
