E3DAligner Minimal Code¶
This code snippet shows how to compute the alignment between a sample and a cad reference.
C++¶
#include <eVision/Easy3D/Easy3DMatch/E3DAligner.h>
using namespace eVision;
// load the reference mesh and define the pose
Easy3D::E3DAligner aligner;
Easy3D::EMesh cad;
cad.Load("...");
float azimuthReference = 0.f, elevationReference = 90.f;
aligner.SetReference(cad, azimuthReference, elevationReference);
// load the sample
Easy3D::EPointCloud sample;
sample.Load("...");
float azimuthSample = 0.f, elevationSample = -90.f;
// perform alignment
Easy3D::E3DAlignment alignment = aligner.Align(sample, azimuthSample, elevationSample);
C#¶
using eVision.Easy3D;
// load the reference mesh and define the pose
E3DAligner aligner = new E3DAligner();
EMesh cad = new EMesh();
cad.Load("...");
float azimuthReference = 0.0f, elevationReference = 90.0f;
aligner.SetReference(cad, azimuthReference, elevationReference);
// load the sample
EPointCloud sample = new EPointCloud();
sample.Load("...");
float azimuthSample = 0.0f, elevationSample = -90.0f;
// perform alignment
E3DAlignment alignment = aligner.Align(sample, azimuthSample, elevationSample);
Python¶
from eVision import Easy3D
# load the reference mesh and define the pose
aligner = Easy3D.E3DAligner()
cad = Easy3D.EMesh()
cad.Load("...")
aligner.SetReference(cad, azimuth=0., elevation=90.)
# load the sample
sample = Easy3D.EPointCloud()
sample.Load("...")
# perform alignment
alignment = aligner.Align(sample, azimuth=0., elevation=-90.)