braddodson / pointmatcher.net

Implementation of ICP in C#
Apache License 2.0
27 stars 57 forks source link

how to initialize? #6

Open Ademord opened 3 years ago

Ademord commented 3 years ago

silly question from my side: given:

DataPoints reading = ...; // initialize your point cloud reading here
DataPoints reference = ...; // initialize your reference point cloud here
EuclideanTransform initialTransform = ...; // your initial guess at the transform from reading to reference
ICP icp = new ICP();
icp.ReadingDataPointsFilters = new RandomSamplingDataPointsFilter(prob: 0.1f);
icp.ReferenceDataPointsFilters = new SamplingSurfaceNormalDataPointsFilter(SamplingMethod.RandomSampling, ratio: 0.2f);
icp.OutlierFilter = new TrimmedDistOutlierFilter(ratio: 0.5f);
var transform = icp.Compute(reading, reference, initialTransform);

how do i initialize the point cloud, initialize the reference point and the initialTransform? I have a camera in unity and want to run ICP every time a new frame shows up