39 #include "boost/filesystem.hpp"
54 int main(
int argc,
char *argv[])
75 name =
"MinDistDataPointsFilter";
81 name =
"RandomSamplingDataPointsFilter";
83 std::shared_ptr<PM::DataPointsFilter>
rand_read =
88 name =
"MinDistDataPointsFilter";
94 name =
"RandomSamplingDataPointsFilter";
96 std::shared_ptr<PM::DataPointsFilter>
rand_ref =
101 name =
"KDTreeMatcher";
103 params[
"epsilon"] =
"3.16";
104 std::shared_ptr<PM::Matcher>
kdtree =
109 name =
"TrimmedDistOutlierFilter";
111 std::shared_ptr<PM::OutlierFilter>
trim =
116 name =
"PointToPointErrorMinimizer";
121 name =
"CounterTransformationChecker";
122 params[
"maxIterationCount"] =
"150";
123 std::shared_ptr<PM::TransformationChecker>
maxIter =
127 name =
"DifferentialTransformationChecker";
128 params[
"minDiffRotErr"] =
"0.001";
129 params[
"minDiffTransErr"] =
"0.01";
130 params[
"smoothLength"] =
"4";
131 std::shared_ptr<PM::TransformationChecker>
diff =
137 PM::get().InspectorRegistrar.create(
"NullInspector");
148 std::shared_ptr<PM::Transformation> rigidTrans =
149 PM::get().TransformationRegistrar.create(
"RigidTransformation");
156 icp.referenceDataPointsFilters.push_back(
rand_ref);
160 icp.outlierFilters.push_back(
trim);
164 icp.transformationCheckers.push_back(
maxIter);
165 icp.transformationCheckers.push_back(
diff);
171 icp.transformations.push_back(rigidTrans);
181 ref.save(
"test_ref.vtk");
182 data.save(
"test_data_in.vtk");
184 cout <<
"Final transformation:" << endl <<
T << endl;
193 cerr <<
"Wrong number of arguments, usage " << argv[0] <<
" reference.csv reading.csv" << endl;
194 cerr <<
"Will create 3 vtk files for inspection: ./test_ref.vtk, ./test_data_in.vtk and ./test_data_out.vtk" << endl;
195 cerr << endl <<
"2D Example:" << endl;
196 cerr <<
" " << argv[0] <<
" ../../examples/data/2D_twoBoxes.csv ../../examples/data/2D_oneBox.csv" << endl;
197 cerr << endl <<
"3D Example:" << endl;
198 cerr <<
" " << argv[0] <<
" ../../examples/data/car_cloud400.csv ../../examples/data/car_cloud401.csv" << endl;