53 int main(
int argc,
char *argv[])
74 name =
"MinDistDataPointsFilter";
80 name =
"RandomSamplingDataPointsFilter";
82 std::shared_ptr<PM::DataPointsFilter>
rand_read =
87 name =
"MinDistDataPointsFilter";
93 name =
"RandomSamplingDataPointsFilter";
95 std::shared_ptr<PM::DataPointsFilter>
rand_ref =
100 name =
"KDTreeMatcher";
102 params[
"epsilon"] =
"3.16";
103 std::shared_ptr<PM::Matcher>
kdtree =
108 name =
"TrimmedDistOutlierFilter";
110 std::shared_ptr<PM::OutlierFilter>
trim =
115 name =
"PointToPointErrorMinimizer";
120 name =
"CounterTransformationChecker";
121 params[
"maxIterationCount"] =
"150";
122 std::shared_ptr<PM::TransformationChecker>
maxIter =
126 name =
"DifferentialTransformationChecker";
127 params[
"minDiffRotErr"] =
"0.001";
128 params[
"minDiffTransErr"] =
"0.01";
129 params[
"smoothLength"] =
"4";
130 std::shared_ptr<PM::TransformationChecker>
diff =
136 PM::get().InspectorRegistrar.create(
"NullInspector");
147 std::shared_ptr<PM::Transformation> rigidTrans =
148 PM::get().TransformationRegistrar.create(
"RigidTransformation");
155 icp.referenceDataPointsFilters.push_back(
rand_ref);
159 icp.outlierFilters.push_back(
trim);
163 icp.transformationCheckers.push_back(
maxIter);
164 icp.transformationCheckers.push_back(
diff);
170 icp.transformations.push_back(rigidTrans);
180 ref.save(
"test_ref.vtk");
181 data.save(
"test_data_in.vtk");
183 cout <<
"Final transformation:" << endl <<
T << endl;
192 cerr <<
"Wrong number of arguments, usage " << argv[0] <<
" reference.csv reading.csv" << endl;
193 cerr <<
"Will create 3 vtk files for inspection: ./test_ref.vtk, ./test_data_in.vtk and ./test_data_out.vtk" << endl;
194 cerr << endl <<
"2D Example:" << endl;
195 cerr <<
" " << argv[0] <<
" ../../examples/data/2D_twoBoxes.csv ../../examples/data/2D_oneBox.csv" << endl;
196 cerr << endl <<
"3D Example:" << endl;
197 cerr <<
" " << argv[0] <<
" ../../examples/data/car_cloud400.csv ../../examples/data/car_cloud401.csv" << endl;