#include <CGAL/Simple_cartesian.h>
#include <CGAL/IO/read_points.h>
#include <CGAL/IO/write_points.h>
#include <CGAL/property_map.h>
#include <CGAL/Aff_transformation_3.h>
#include <CGAL/pointmatcher/register_point_sets.h>
#include <CGAL/OpenGR/compute_registration_transformation.h>
#include <fstream>
#include <iostream>
#include <utility>
#include <vector>
typedef K::Point_3 Point_3;
typedef K::Vector_3 Vector_3;
typedef std::pair<Point_3, Vector_3> Pwn;
int main(int argc, const char** argv)
{
std::vector<Pwn> pwns1, pwns2;
.normal_map (Normal_map())))
{
std::cerr << "Error: cannot read file " << fname1 << std::endl;
return EXIT_FAILURE;
}
CGAL::parameters::point_map(Point_map())
.normal_map(Normal_map())))
{
std::cerr << "Error: cannot read file " << fname2 << std::endl;
return EXIT_FAILURE;
}
std::cerr << "Computing registration transformation using OpenGR Super4PCS.." << std::endl;
K::Aff_transformation_3 res =
std::get<0>(
(pwns1, pwns2,
params::point_map(Point_map()).normal_map(Normal_map()),
params::point_map(Point_map()).normal_map(Normal_map())));
std::cerr << "Computing registration transformation using PointMatcher ICP, "
<< "taking transformation computed by OpenGR Super4PCS as initial transformation.." << std::endl;
(pwns1, pwns2,
params::point_map(Point_map()).normal_map(Normal_map()),
params::point_map(Point_map()).normal_map(Normal_map()).transformation(res));
CGAL::parameters::point_map(Point_map())
.normal_map(Normal_map())))
{
return EXIT_FAILURE;
}
std::cerr << "Transformed version of " << fname2
<< " written to pwn2_aligned.ply.\n";
return EXIT_SUCCESS;
}