Go to the documentation of this file.
21 template<
typename Po
intCloud >
24 if (argc != 6 && argc != 7)
27 printf(
"./normal_estimation [input pointcloud] [output_pointcloud.ply] [number of neighbors] [noise] [curvature] [OPTIONNAL:reference_file]\n");
28 printf(
"Estimated noise (m),\n \t example : 0.0001 \n");
29 printf(
"Min tolerated curvature radius (m) \n \t example for curved objects = 0.1 \n \t for intersecting planes = 10000000000\n");
30 printf(
"It is recommended to scale the objects (for diagonal to be 1) to better parameterize the min tolerated curvature radius\n");
32 std::cout <<
"Examples: \n"
33 << argv[0] <<
" casting.xyz casting.curvature.ply 10 0 0.01 casting.curvature.ref.ply\n"
40 std::cout <<
"\nParameters summary:" << std::endl;
42 for (
int i = 1 ; i<argc; i++)
43 std::cout<<argv[i]<<
" ";
44 std::cout<<std::endl<<std::endl;
48 std::string input_file_path = argv[1];
49 std::string output_file_path = argv[2];
62 using VertexNormalMap =
67 std::cout <<
"use existing vertex-normal map" << std::endl;
72 std::cout <<
"create vertex-normal map" << std::endl;
79 auto pm =
get(boost::vertex_point, cloud);
82 int n_neigh =
static_cast<int>(atoi(argv[3]));
83 float noise =
static_cast<float>(atof(argv[4])/sqrt(3));
84 noise = std::max(noise, 0.000001f);
85 float curvature =
static_cast<float>(atof(argv[5]));
91 std::cout <<
"saving point cloud with normals to " << output_file_path
96 std::string reference_file_path;
98 reference_file_path = argv[6];
100 if(!reference_file_path.empty())
102 std::cout <<
"Comparing output file" << std::endl;
103 std::cout <<
" '" << output_file_path <<
"'" << std::endl;
104 std::cout <<
"with reference file" << std::endl;
105 std::cout <<
" '" << reference_file_path <<
"'" << std::endl;
106 std::cout <<
"..." << std::endl;
111 std::cout <<
"Files are different!" << std::endl;
115 std::cout <<
"Files are identical." << std::endl;
void put_property_map(PropertyT p, const MeshT &, PMapsContainer &pmaps, const typename PMap_traits< PropertyT, MeshT >::pmap_type &pmap)
PMap_traits< PropertyT, MeshT >::pmap_type get_property_map(PropertyT p, const MeshT &, const PMapsContainer &pmaps)
bool has_map(const PMapsContainer &pmaps, const std::string &map_name)
(refer to Property Maps API)
std::map< std::string, boost::any > PMapsContainer
int test_point_cloud_normal_wpca(int argc, const char **argv)
Generic test of Weighted PCA filter.
void compute_weighted_pca(const PointCloud &pointCloud, const PointMap &pointMap, NormalMap &normalMap, int n_neight, float noise, float curvature, const GeometryTraits >)
bool identical_text_based_files(std::string filename_a, std::string filename_b, const std::vector< std::string > &skip=std::vector< std::string >())
void read_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps, bool=false)
Load mesh from file.
void write_mesh(const std::string &filename, FEVV::CGALPointSet &g, PMapsContainer &pmaps)
Write mesh to file.
boost::property_map< FEVV::DataStructures::AIF::AIFMesh, boost::vertex_index_t >::const_type get(const boost::vertex_index_t &, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the vertex index property map of the mesh.
PMap_traits< PropertyT, MeshT >::pmap_type make_property_map(PropertyT, const MeshT &m)
void curvature(FEVV::DataStructures::AIF::AIFMesh *mesh)