<a id="e3d-object-extractor"></a>

# Easy3DObject - Extracting 3D Objects

`Easy3DObject` extracts objects and their features from a ZMap.

* The [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) class uses a set of criteria to select the objects to extract.
* The extracted objects are instances of the [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) class.

<a id="e3d-obj-workflow"></a>

## Workflow

1. Load or build a [ZMap](easy3d/zmap.html.md) (from an image or a point cloud).
2. Construct an [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) instance.
3. Set the selection criteria of the [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) instance.
4. Extract the 3D objects, with or without 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).
5. Get and process the extracted objects list.

<a id="e3d-obj-features"></a>

## Object Features

<a id="e3d-obj-units"></a>

### Units

Both the [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) parameters and the [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) features are expressed in metric units.

* For example: if the resolution of the input [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html) is expressed in mm / pixel, the length parameter is expressed in mm.
* Use the [`EZMap::GetResolution`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html#a6e379dbe03b83369132fba090b8a6ac8) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html#a4c62144e1a9c26401f8a33af6a8bb117) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html#a26c874d344378a692e3da312d79d6b54) and [`EZMap::SetResolution`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html#a5642c614e0885206e7c0e8cb4b4a1ab5) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html#ac67797521aa15207065b151b14cef7c6) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html#a20ed6e2a7c0ea090f28ed698bc95bfca) accessors of the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html) to query and change its resolution.

Angles are expressed in the unit defined by [`Easy::SetAngleUnit`](../../doxygen_cpp/classeVision_1_1Easy.html#a3f16cccaa4404377fbd42bf435111020) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy.html#ae0a5022bfad11d93725749f840a1fbf9) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy.html#afd95f7439ea9d6b35f48399f10c77c4b).

#### HINT
In this documentation, we use the default setting and all angles are expressed in degrees.

<a id="e3d-obj-planes"></a>

### Object Plane and Base Plane

The [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) fits a plane to the pixels of each [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) output:

* Use [`E3DObject::GetPlane`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html#ac5031b902c177ecf952f079db3a4a03a) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html#af644f2aff5f0dfde3765ba6a3cc788b5) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html#a89009f0198a3d6cf2c6a838b81eaa18c) to access this plane.

The [`E3DObjectExtractor`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html) also tries to fit a plane to the pixels surrounding an [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html)

* This plane is called the *base plane*.
* It is an estimation of the local background around the object.
* If there are too many undefined pixels in this area, the base plane is equal to the reference plane of the input [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html).

![image](assets/images/easy3d/easy3dobject/setting_objects_01.webp)

<a id="e3d-obj-bounding-box"></a>

### Bounding Box

The *bounding box* is the minimal enclosing rectangle for all the object positions.

* It is oriented in the XY plane of the ZMap space (rotation around the Z axis of the ZMap).
* Its rotation is used as the orientation of the object (see [`E3DObject::GetOrientation`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html#a2bc0f30ad5600f91a3fd5a6e659b7a4a) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html#a48e63e96dbcb58ce41dacb617eccb281) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html#ae44a6fb177339a740b1a2560aa2f854b)).
* Its X and Y sizes are the object length and width (see [`E3DObject::GetLength`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html#a0a81b3485c5fecd9f389576ba5bd94e7) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html#ae27328320c10594cce8829b76964b277) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html#a1d5f6c88ca50d9e2e4a329c2b1f7c15d) and [`E3DObject::GetWidth`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html#a77fb6c7190edeea42a14f21a92460630) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html#a427a8f60d220219b720b3094aa5ed2da) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html#a0689ec10ff58a58738f042fedefd16d3)).
* Its Z size is always in the Z axis of the ZMap direction.

![image](assets/images/easy3d/easy3dobject/setting_objects_02.webp)

<a id="e3d-obj-length-width"></a>

### Length and Width

The *length* of an object is the largest dimension on the XY plane in the ZMap space. It is the same as the size of the major axis of the bounding box.

The *width* of an object is the smallest dimension on the XY plane in the ZMap space. It is the same as the size of the minor axis of the bounding box.

Use the [`E3DObjectExtractor::SetLengthRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a76f254b353c20d095e294fe807496c6a) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a59973c5efe7c8b95a269429fce4663aa) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#adf117d60b1aeda94a83c5452de963a30) and the [`E3DObjectExtractor::SetWidthRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#adbdde56b7ad0dd87f6b894f75ea53226) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a18d8b1fc2fb76e3712a98ce257cd7d08) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a3bb1013b40d473f140173a35c416a715) accessors to set the ranges of allowed values for the length and the width.

![Length and width of 3D objects in a ZMap.](assets/images/easy3d/easy3dobject/setting_objects_03.webp)![Length and width of 3D objects in a point cloud.](assets/images/easy3d/easy3dobject/setting_objects_04.webp)

<a id="e3d-obj-heights"></a>

### Local and Reference Top Positions and Heights

The *local top position* of an object is the position (3D coordinates) of the point in the [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) that is the furthest from the base plane.

The *local height* of an object is the distance between the local top position and the base plane.

The *reference top position* of an object is the position (3D coordinates) of the point in the [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) that is the furthest from the reference plane.

The *reference height* of an object is the distance between the reference top position and the reference plane.

![](assets/images/easy3d/easy3dobject/setting_objects_06.webp)![](assets/images/easy3d/easy3dobject/setting_objects_05.webp)

If there are too many undefined pixels in the object surroundings:

* The base plane is equal to the reference plane of the input [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html).
* The local top position is equal to the reference top position.
* The local height is equal to the reference height.

Use the [`E3DObjectExtractor::SetLocalHeightRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a74a5f92573336145f8cdcf4cb3a73a8b) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ad3b8d8d7e886b5f67f2b529d50c8bb49) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a1eef4692fdc1343ad7feb19af1892456) and the [`E3DObjectExtractor::SetReferenceHeightRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a4f998d6e0e996db0c24533d9d5b405b8) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aa6d9b69d5b38f699b483a8eefdde5eb6) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a2d02d774c788760120462f961223e7b8) accessors to set the ranges of allowed values for the local and the reference height.

<a id="e3d-obj-average-position"></a>

### Average Position

The *average position* is the arithmetic mean of the 3D positions of the object, also known as the barycenter.

![image](assets/images/easy3d/easy3dobject/setting_objects_07.webp)

<a id="e3d-obj-aspect-ratio"></a>

### Aspect Ratio

The *aspect ratio* is the width (the smallest dimension on the XY plane) divided by the length (the largest dimension).

* It lies between 0 and 1.
* The smaller the ratio, the more elongated the object is.
* A square has an aspect ratio of 1.

Use the [`E3DObjectExtractor::SetAspectRatioRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a853e2dc0e8f84827640285738e588658) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a94a8c7282aa56a8d39be145d648c806a) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aebe33baa3d9b358adb3507396ad19c36) accessor to set the range of allowed values for the aspect ratio.

![image](assets/images/easy3d/easy3dobject/setting_objects_08.webp)

<a id="e3d-obj-orientation"></a>

### Orientation Angle

The *orientation angle* is the angle between the X axis of the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html) and the longest axis (the length) of the object.

* The angle is measured in the clockwise direction.
* The value must lie between $-90°$ and $+90°$.

Use the [`E3DObjectExtractor::SetOrientationRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a88c1b7058e6835c24a5312f34b97d513) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a6f9145f71df7f242e3cd18b292146e6b) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a4984cd50fa9768ebfc91f2999078ffd3) accessor to set the range of allowed values for the orientation angle.

![image](assets/images/easy3d/easy3dobject/setting_objects_09.webp)

<a id="e3d-obj-tilt"></a>

### Local and Reference Tilt Angles

The *local tilt angle* is the angle between the base plane and the object plane.

* A value of 0 means that the object top surface is parallel to its base.
* The value must lie between $0°$ and $+90°$.

The *reference tilt angle* is the angle between the object plane and ZMap XY plane.

* A value of 0 means that the object top surface is parallel to its base.
* The value must lie between $0°$ and $+90°$.

Use the [`E3DObjectExtractor::SetLocalTiltRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aa988f2a74b5e386901c0ad1596ac84d1) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aae0fe4085aa00eee66fe7846696d455c) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a09b9a8464cb84f59589537939ded7d6b) and the [`E3DObjectExtractor::SetReferenceTiltRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a64e89894628bc76e66d2e7266eb96195) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a3d108654ecf0e560fedfc97a6b479563) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a05a3f2ec6abca82a00a382054f149a08) accessors to set the range of allowed values for the tilt angles.

![Local tilt.](assets/images/easy3d/easy3dobject/setting_objects_10.webp)![Reference tilt.](assets/images/easy3d/easy3dobject/setting_objects_11.webp)

<a id="e3d-obj-area"></a>

### Area

The object *area* is the area of the top surface of the object projected on the reference plane of the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html).

* It is equal to the number of pixels in the object × the x-resolution of the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html) × the y-resolution of the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html).

Use the [`E3DObjectExtractor::SetAreaRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a5e442277167963725a627b0334596580) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aa084f9a231f2b24811aff58aab6143af) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ab9d0f6544fefca3dd36523332c1e0bb5) accessor to set the range of allowed values for the area.

![image](assets/images/easy3d/easy3dobject/setting_objects_12.webp)

<a id="e3d-obj-volume"></a>

### Volume

The object *volume* is the volume that lies between the top surface and the base plane of the object.

Use the [`E3DObjectExtractor::SetVolumeRange`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ade22196830df5c237a81a4c59bf7b171) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ac31284aa91ade19dfafd8fc6a130b255) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ac4eaafbd9e50cad70e1dfbde85f1e0eb) accessor to set the range of allowed values for the volume.

![image](assets/images/easy3d/easy3dobject/setting_objects_13.webp)

<a id="e3d-obj-sphere"></a>

### Sphere

This feature is disabled by default.

When enabled, a sphere is an object [`E3DSphere`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DSphere.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DSphere.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DSphere.html) that represents the sphere that best fits the object (calculated according to the least squares).

<a id="e3d-obj-extracting"></a>

## Extracting and Using Objects

<a id="e3d-obj-extract"></a>

### Extracting the Objects

Use the [`E3DObjectExtractor::Extract`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a24f28f27d189595d9c072d74bfd91418) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ace913c64931506a1bc76ca57475bfc9e) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a7948bf8c345e776096d8bc001c8e4478) method to perform the objects extraction.

![image](assets/images/easy3d/easy3dobject/exracting_01.webp)

You can limit the extraction to 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), for example to ignore parts of the ZMap that are not interesting and/or to speed up the extraction process.

![image](assets/images/easy3d/easy3dobject/exracting_02.webp)

The processing speed of the extraction depends directly on:

* The number of pixels in the ZMap or in the ERegion.
* The number of segmented objects.
* The computer features for each segmented object.

#### HINT
To speed up the extraction process:

- Adjust the extraction ranges to reduce the number of objects.
- Disable the features you do not need.

<a id="e3d-obj-overlapped"></a>

### Overlapped Objects

By default, the extraction does not produce objects that overlap on the ZMap. You must enable the [`E3DObjectExtractor::SetOverlappedObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a439bac2c07057c603366c30c7e27c973) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ad3ef34960be5c007ec2c74fbd7d0881d) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a6aa4c4e4ef538b0639fdc241e4bdb41b) option to extract “stacked” objects.

The *area ratio* and the *height difference* parameters control how overlapped objects are extracted:

* The *area ratio* is configured by [`E3DObjectExtractor::SetOverlappedAreaRatio`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a1dc790707692fd272e6027e8704f2dbc) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a3643601271051878f205775bb02bf1c6) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ab231461d5f7ad12e64768230f5117aec). The area of the bottom object divided by the area of the top object must be larger or equal than that ratio.

![image](assets/images/easy3d/easy3dobject/overlappeds_objects_01.webp)![image](assets/images/easy3d/easy3dobject/overlappeds_objects_02.webp)![image](assets/images/easy3d/easy3dobject/overlappeds_objects_03.webp)
* The *height difference* is configured by [`E3DObjectExtractor::SetOverlappedHeightDifference`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ab24767bc72e4e292a858c7283a236e0d) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a7428c74ce4e1c9eb51e4292b355ee1b8) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a8bf452b430da80632470c919ba3d4556). This represent the minimum height difference between the top and the bottom object

![image](assets/images/easy3d/easy3dobject/overlappeds_objects_04.webp)![image](assets/images/easy3d/easy3dobject/overlappeds_objects_05.webp)

<a id="e3d-obj-detection-control"></a>

### Controlling the Object Detection

Two optional parameters affect the detection of the object:

* [`E3DObjectExtractor::SetExtractionSensitivity`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ad3ecf564aedfcbdf7533e9d9ca67994b) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a9c4f1fbf6389bc9ef71761b1c7d574d8) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a031d1c3b2d25cbe9ffd51d1564a1ebbd) controls the sensitivity of the extraction.
  * A higher value increases the ability to detect objects that are mixed with their surrounding, because their grey values are close to the background or because the transition (the gradient) between the object and the background is smooth.
  * This parameter value ranges from 0 to 1 (the default value is 0.6).

![image](assets/images/easy3d/easy3dobject/exracting_05.webp)
* [`E3DObjectExtractor::SetContourReinforce`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aea7e6f03df1db363a4995b1775edc81b) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aeef1af7ea50b68a9d91e276eac3b5229) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a3de7c9f61d41f214984a60bd0490e2be) affects the extraction of the objects.
  * As the extraction can fail when objects are close or touch each other, this parameter enables a filter to enhance the frontiers between objects and enable the extraction of such objects.
  * The filter can affect the measurements.

![Contour reinforcement OFF.](assets/images/easy3d/easy3dobject/exracting_06.webp)![Contour reinforcement ON.](assets/images/easy3d/easy3dobject/exracting_07.webp)

<a id="e3d-obj-using"></a>

### Using the Objects

The [`E3DObjectExtractor::Extract`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a24f28f27d189595d9c072d74bfd91418) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#ace913c64931506a1bc76ca57475bfc9e) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a7948bf8c345e776096d8bc001c8e4478) method populates a list of [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) fulfilling your set criteria.

* Each [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) is a collection of descriptive features of the associated 3D points in the [`EZMap`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1EZMap.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1EZMap.html), such as its oriented bounding box, its local height and its volume.
* Call the associated [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) method to access a feature.
* The [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) list is sorted from the smallest area to the largest area.
* Use [`E3DObjectExtractor::GetObjectsMask`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a30b1d4c7d0fcffa2f0b5495bd3683e09) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#a05377511423c94a9892b6bdcecc3ac8b) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObjectExtractor.html#aed32545fe8e91c8c9d76a5bdd4ac2aba) to get the mask of all the extracted [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html).

<a id="e3d-obj-visualizing"></a>

### Visualizing the Objects

To visualize some of these features in 2D or 3D:

* Use the [`E3DObject::Draw`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html#aef4c54a3837f1478c672e1585ddd24cc) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html#a11f1a1fc4dae0cfab23354f376404c7b) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html#a338a94b2303171911b02a8a512faa957) method.
* Or submit a list of [`E3DObject`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DObject.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DObject.html) to an [`E3DViewer`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DViewer.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DViewer.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DViewer.html).

#### HINT
In an [`E3DViewer`](../../doxygen_cpp/classeVision_1_1Easy3D_1_1E3DViewer.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1Easy3D_1_1E3DViewer.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1E3DViewer.html), use the [`ERenderStyle`](../../doxygen_cpp/structeVision_1_1Easy3D_1_1ERenderStyle.html) [<sub>.NET</sub>](../../doxygen_cs/structeVision_1_1Easy3D_1_1ERenderStyle.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1Easy3D_1_1ERenderStyle.html) structure to choose your rendering style.

See below some examples to draw features from a list of `E3DObjects`:

* Drawing 2D features:

  ### C++

  ```cpp
  #include <eVision/Easy3D/Easy3DObject/E3DObjectExtractor.h>
  #include <eVision/Easy/EGenericDrawAdapter.h>
  ```

  ```cpp
  using namespace eVision;
  using namespace eVision::Easy3D;
  E3DObjectExtractor extractor;
  // Get the list of E3DObjects
  std::vector<E3DObject> objects = extractor.GetObjects();

  // Get the dimensions of the 2D feature
  ERegion region = extractor.GetObjectsMask();

  // Get an image on which to draw the 3D objects
  EImageC24A image(region.GetBoundingBoxWidth(), region.GetBoundingBoxHeight());
  EGenericDrawAdapter drawContext(&image);

  // Draw the ERegion of each object
  int nObjects = (int)objects.size();
  for (int i = 0; i < nObjects; i++)
    objects[i].Draw(&drawContext, E3DObjectFeature_ERegion, ERGBColor(0, 255, 0));
  ```

  ### C#

  ```cs
  using eVision;
  using eVision.Easy3D;
  ```

  ```cs
  E3DObjectExtractor extractor = new E3DObjectExtractor();

  // Get the list of E3DObjects
  E3DObject[] objects = extractor.Objects;

  // Get the dimensions of the 2D feature
  ERegion region = extractor.ObjectsMask;

  // Get an image on which to draw the 3D objects
  EImageC24A image = new EImageC24A(region.BoundingBoxWidth, region.BoundingBoxHeight);
  EGenericDrawAdapter drawContext = new EGenericDrawAdapter(image);

  // Draw the ERegion of each object
  int nObjects = objects.Length;
  for (int i = 0; i < nObjects; i++)
    objects[i].Draw(drawContext, E3DObjectFeature.ERegion, new ERGBColor(0, 255, 0));
  ```

  ### Python

  ```py
  import eVision
  from eVision import Easy3D
  extractor = Easy3D.E3DObjectExtractor()

  # Get the list of E3DObjects
  objects = extractor.Objects

  # Get the dimensions of the 2D feature
  region = extractor.ObjectsMask

  # The drawing surface
  display_img = eVision.EImageC24A(width=region.BoundingBoxWidth, height=region.BoundingBoxHeight)
  draw_adapter = eVision.EGenericDrawAdapter(display_img)

  # Draw the ERegion of each object
  for object_i in objects:
      object_i.Draw(draw_adapter, Easy3D.E3DObjectFeature.ERegion, eVision.ERGBColor(0, 255, 0))
  ```

  ![image](assets/images/easy3d/easy3dobject/exracting_03.webp)
* Drawing 3D features:

  ### C++

  ```cpp
  #include <eVision/Easy3D/Easy3DObject/E3DObjectExtractor.h>
  #include <eVision/Easy3D/E3DViewer.h>
  ```

  ```cpp
  using namespace eVision;
  using namespace eVision::Easy3D;
  E3DObjectExtractor extractor;
  // Get the list of E3DObjects
  std::vector<E3DObject> objects = extractor.GetObjects();

  // Register the list of E3DObjects to the 3D viewer
  E3DViewer viewer3D(0, 0, 640, 480);
  viewer3D.Register3DObjects(objects);


  // Define and use a render style for the ReferenceTopPosition feature
  ERenderStyle renderStyle;
  renderStyle.pointRGB = EC24A(100, 0, 0);
  viewer3D.SetFeatureStyleForAll3DObjects(renderStyle, E3DObjectFeature_ReferenceTopPosition);

  // Set a different rendering color for the first object
  ERenderStyle selectedRenderStyle;
  selectedRenderStyle.pointRGB = EC24A(255, 255, 0);
  viewer3D.SetFeatureStyleFor3DObject(0, selectedRenderStyle, E3DObjectFeature_ReferenceTopPosition);

  // Enable the display of the TopZPosition feature
  viewer3D.ShowFeatureForAll3DObjects(E3DObjectFeature_ReferenceTopPosition);
  ```

  ### C#

  ```cs
  using eVision;
  using eVision.Easy3D;
  ```

  ```cs
  E3DObjectExtractor extractor = new E3DObjectExtractor();

  // Get the list of E3DObjects
  E3DObject[] objects = extractor.Objects;

  // Register the list of E3DObject to the 3D viewer
  E3DViewer viewer3D = new E3DViewer(0, 0, 100, 100);
  viewer3D.Register3DObjects(objects);


  // Define and use a render style for the ReferenceTopPosition feature
  ERenderStyle renderStyle = new ERenderStyle();
  renderStyle.pointRGB = new EC24A(100, 0, 0);
  viewer3D.SetFeatureStyleForAll3DObjects(renderStyle, E3DObjectFeature.ReferenceTopPosition);

  // Set a different rendering color for the first object
  ERenderStyle selectedRenderStyle = new ERenderStyle();
  selectedRenderStyle.pointRGB = new EC24A(255, 255, 0);
  viewer3D.SetFeatureStyleFor3DObject(0, selectedRenderStyle, E3DObjectFeature.ReferenceTopPosition);

  // Enable the display of the ReferenceTopPosition feature
  viewer3D.ShowFeatureForAll3DObjects(E3DObjectFeature.ReferenceTopPosition);
  ```

  ### Python

  ```py
  import eVision
  from eVision import Easy3D
  extractor = Easy3D.E3DObjectExtractor()

  # Get the list of E3DObjects
  objects = extractor.Objects

  # Register the list of E3DObject to the 3D viewer
  viewer3D = Easy3D.E3DViewer(0, 0, 100, 100)
  viewer3D.Register3DObjects(objects)

  # Define and use a render style for the ReferenceTopPosition feature
  render_style = Easy3D.ERenderStyle()
  render_style.pointRGB = eVision.EC24A(100, 0, 0)
  viewer3D.SetFeatureStyleForAll3DObjects(render_style, Easy3D.E3DObjectFeature.ReferenceTopPosition)

  # Set a different rendering color for the first object
  selected_render_style = Easy3D.ERenderStyle()
  selected_render_style.pointRGB = eVision.EC24A(255, 255, 0)
  viewer3D.SetFeatureStyleFor3DObject(0, selected_render_style, Easy3D.E3DObjectFeature.ReferenceTopPosition)

  # Enable the display of the ReferenceTopPosition feature
  viewer3D.ShowFeatureForAll3DObjects(Easy3D.E3DObjectFeature.ReferenceTopPosition)
  ```

  ![image](assets/images/easy3d/easy3dobject/exracting_04.webp)
