Inspecting a Feature from the List of E3DObjects¶
The code shows how to inspect the ERectangleRegion of the largest object returned by the extraction.
C++¶
#include <eVision/Easy3D/Easy3DObject/E3DObjectExtractor.h>
using namespace eVision;
using namespace eVision::Easy3D;
E3DObjectExtractor extractor;
// Get the list of E3DObjects
std::vector<E3DObject> objects = extractor.GetObjects();
// Get the volume of the first object
float volume = objects[0].GetVolume();
// Get the ERectangleRegion of the last (the largest) object
ERectangleRegion region = objects.back().GetRectangleRegion();
C#¶
using eVision;
using eVision.Easy3D;
E3DObjectExtractor extractor = new E3DObjectExtractor();
// Get the list of E3DObjects
E3DObject[] objects = extractor.Objects;
// Get the volume of the first object
float volume = objects[0].Volume;
// Get the ERectangleRegion of the last (the largest) object
ERectangleRegion region = objects[objects.Length - 1].RectangleRegion;
Python¶
from eVision import Easy3D
extractor = Easy3D.E3DObjectExtractor()
# Get the list of E3DObjects
objects = extractor.Objects
# Get the volume of the first object
volume = objects[0].Volume
# Get the ERectangleRegion of the last (the largest) object
region = objects[len(objects) - 1].RectangleRegion