using System;
using System.Reflection;
using System.Collections.Generic;
namespace MR.DotNet.Sample
{
internal class Program
{
{
Console.WriteLine($"Number of samples: {icp.GetNumSamples()}");
Console.WriteLine($"Number of active pairs: {numActivePairs}");
if ( numActivePairs > 0 )
{
Console.WriteLine($"RMS point-to-point distance: {p2ptMetric} ± {p2ptInaccuracy}");
Console.WriteLine($"RMS point-to-plane distance: {p2plMetric} ± {p2plInaccuracy}");
}
}
static void Main(string[] args)
{
if (args.Length < 3)
{
Console.WriteLine("Usage: {0} INPUT1 INPUT2 [INPUTS...] OUTPUT", Assembly.GetExecutingAssembly().GetName().Name);
return;
}
try
{
int inputNum = args.Length - 1;
List<MeshOrPointsXf> inputs = new List<MeshOrPointsXf>(inputNum);
for (int i = 0; i < inputNum; ++i)
{
inputs.Add(obj);
maxBBox = bbox;
}
samplingParams.samplingVoxelSize = maxBBox.
Diagonal() * 0.03f;
PrintStats(icp);
Console.WriteLine("Calculating transformations...");
PrintStats(icp);
for (int i = 0; i < inputNum; ++i)
{
var xf = xfs[i];
for (int j = 0; j < inputs[i].obj.Points.Count; j++)
output.
AddPoint( xf.Apply( inputs[i].obj.Points[j]) );
}
}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e.Message);
}
}
}
}
affine transformation: y = A*x + b, where A in VxV, and b in V
Definition MRDotNet/MRAffineXf.h:8
Box given by its min- and max- corners.
Definition MRBox3.h:8
bool Valid()
true if the box contains at least one point
float Volume()
computes the volume of this box
float Diagonal()
computes length from min to max
Definition MRDotNet/MRMultiwayICP.h:28
int GetNumActivePairs()
computes the number of active point pairs
float GetMeanSqDistToPoint()
computes root-mean-square deviation between points
List< AffineXf3f^> CalculateTransformations()
void SetParams(ICPProperties^ props)
tune algorithm params before run calculateTransformations()
bool UpdateAllPointPairs()
float GetMeanSqDistToPlane()
computes root-mean-square deviation from points to target planes
represents a point cloud
Definition MRDotNet/MRPointCloud.h:7
static PointCloud FromAnySupportedFormat(System::String^ path)
loads point cloud from file of any supported format
void AddPoint(Vector3f^ point)
adds a point
static void ToAnySupportedFormat(PointCloud^ mesh, System::String^ path)
saves point cloud to file of any supported format
property Box3f BoundingBox
Definition MRDotNet/MRMeshOrPoints.h:16
Definition MRDotNet/MRICP.h:55
holds together mesh/point cloud and its transformation
Definition MRDotNet/MRMeshOrPoints.h:21
MeshOrPoints obj
Definition MRDotNet/MRMeshOrPoints.h:22
Parameters that are used for sampling of the MultiwayICP objects.
Definition MRDotNet/MRMultiwayICP.h:9