26 main(
int narg,
char **argv)
29 std::string input_original;
30 std::string input_degraded;
32 std::string output_file_path =
"cmdm.output.obj";
34 std::chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
38 std::string reader = std::string(argv[1]);
39 input_original = reader;
40 std::string reader2 = std::string(argv[2]);
41 input_degraded = reader2;
45 std::cout <<
"Use of " << argv[0] <<
" is :\n";
46 std::cout <<
"\t" << argv[0]
47 <<
" path/to/original_mesh path/to/degraded_mesh" << std::endl;
49 <<
" will compute the CMDM value between the degraded mesh and "
67 auto pm_degrad =
get(boost::vertex_point, m_degraded);
68 auto pm_original =
get(boost::vertex_point, m_original);
71 FaceNormalMap fnm_degrad;
74 std::cout <<
"use existing face-normal map for degraded mesh" << std::endl;
79 std::cout <<
"create face-normal map for degraded mesh" << std::endl;
86 FaceNormalMap fnm_original;
89 std::cout <<
"use existing face-normal map for original mesh" << std::endl;
94 std::cout <<
"create face-normal map for original mesh" << std::endl;
105 std::cout <<
"use existing color maps for original and degraded meshes"
111 "CMDM needs 2 meshes with diffuse colors.\nUse MSDM2 Plugin for "
112 "meshes having geometry characteristics only."
119 vertex_cmdm_map cmdm_pmap_deg, cmdm_pmap_orig;
124 boost::any_cast< vertex_cmdm_map >(pmaps_bag_degraded.at(
"v:cmdm"));
129 FEVV::make_vertex_property_map< FEVV::MeshSurface, double >(m_degraded);
130 pmaps_bag_degraded[
"v:cmdm"] = cmdm_pmap_deg;
136 boost::any_cast< vertex_cmdm_map >(pmaps_bag_original.at(
"v:cmdm"));
141 FEVV::make_vertex_property_map< FEVV::MeshSurface, double >(m_original);
142 pmaps_bag_original[
"v:cmdm"] = cmdm_pmap_orig;
146 double cmdm_1_2, cmdm_2_1, cmdm;
172 cmdm = (cmdm_1_2 + cmdm_2_1) / 2.;
174 std::cout <<
"Calculated CMDM = " << cmdm << std::endl;
177 using VertexColorMap =
180 VertexColorMap v_cm =
183 double max_cmdm_1_2, min_cmdm_1_2;
199 std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
200 double time = std::chrono::duration_cast< std::chrono::microseconds > (end - begin).count() / 1000000.0;
201 std::cout << time <<
" sec elapsed " << std::endl;