Performing Plane Leveling on Point Clouds

using Euresys.Open_eVision.Easy3D;

static partial class Snippet
{
  static void PointCloudPlaneLeveling()
  {
    //////////////////////////////////////////////////
    // The code shows how to perform plane leveling //
    // on point clouds                              //
    //////////////////////////////////////////////////

    // find the reference plane on the point cloud​
    E3DPlane ref_plane = new E3DPlane();
    EPointCloud point_cloud = new EPointCloud();

    // define the ground plane as the plane Z=0​
    E3DPlane ground_plane = E3DPlane.ZPlane();

    // get the transformation that moves ​
    // the reference plane to the ground plane​
    E3DTransformMatrix transformation;
    transformation = ref_plane.GetTransformationTo(ground_plane);

    // apply the transformation to the point cloud​
    EAffineTransformer.ApplyMatrix(transformation, point_cloud);
  }

}
#include <Open_eVision.h>

void PointCloudPlaneLeveling()
{
  //////////////////////////////////////////////////
  // The code shows how to perform plane leveling //
  // on point clouds                              //
  //////////////////////////////////////////////////
  using namespace Euresys::Open_eVision::Easy3D;

  // find the reference plane on the point cloud​
  E3DPlane ref_plane;
  EPointCloud point_cloud;

  // define the ground plane as the plane Z=0​
  E3DPlane ground_plane(E3DPlane::ZPlane());

  // get the transformation that moves ​
  // the reference plane to the ground plane​
  E3DTransformMatrix transformation;
  transformation = ref_plane.GetTransformationTo(ground_plane);

  // apply the transformation to the point cloud​
  EAffineTransformer transformer;
  transformer.ApplyMatrix(transformation, point_cloud);
}
def PointCloudPlaneLeveling():
    ##################################################
    ## The code shows how to perform plane leveling ##
    ## on point clouds                              ##
    ##################################################
    from open_evision import Easy3D
    # find the reference plane on the point cloud
    ref_plane = Easy3D.E3DPlane()
    point_cloud = Easy3D.EPointCloud()

    # define the ground plane as the plane Z=0
    ground_plane = Easy3D.E3DPlane.ZPlane()

    # get the transformation that moves
    # the reference plane to the ground plane
    transformation = ref_plane.GetTransformationTo(ground_plane)

    # apply the transformation to the point cloud
    Easy3D.EAffineTransformer.ApplyMatrix(transformation, point_cloud)