From aba4ee0347d9f8819e35c88af78b090eddbec80d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 11 Jan 2023 09:06:38 +0000 Subject: [PATCH 1/3] Classification: Write to different files --- .../examples/Classification/example_ethz_random_forest.cpp | 2 +- .../examples/Classification/example_opencv_random_forest.cpp | 2 +- Classification/examples/Classification/gis_tutorial_example.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classification/examples/Classification/example_ethz_random_forest.cpp b/Classification/examples/Classification/example_ethz_random_forest.cpp index 64d4688a360..a538faa3014 100644 --- a/Classification/examples/Classification/example_ethz_random_forest.cpp +++ b/Classification/examples/Classification/example_ethz_random_forest.cpp @@ -140,7 +140,7 @@ int main (int argc, char** argv) classifier.save_configuration(fconfig); // Write result - std::ofstream f ("classification.ply"); + std::ofstream f ("classification_ethz_random_forest.ply"); f.precision(18); f << pts; diff --git a/Classification/examples/Classification/example_opencv_random_forest.cpp b/Classification/examples/Classification/example_opencv_random_forest.cpp index 99fa9fb6497..e01ede689e5 100644 --- a/Classification/examples/Classification/example_opencv_random_forest.cpp +++ b/Classification/examples/Classification/example_opencv_random_forest.cpp @@ -128,7 +128,7 @@ int main (int argc, char** argv) } // Write result - std::ofstream f ("classification.ply"); + std::ofstream f ("classification_opencv_random_forest.ply"); f.precision(18); f << pts; diff --git a/Classification/examples/Classification/gis_tutorial_example.cpp b/Classification/examples/Classification/gis_tutorial_example.cpp index 7e214e481f5..7ebc50a1f30 100644 --- a/Classification/examples/Classification/gis_tutorial_example.cpp +++ b/Classification/examples/Classification/gis_tutorial_example.cpp @@ -736,7 +736,7 @@ int main (int argc, char** argv) points.range(label_map)).mean_intersection_over_union() << std::endl; // Save the classified point set - std::ofstream classified_ofile ("classified.ply"); + std::ofstream classified_ofile ("classified_gis_tutorial.ply"); CGAL::IO::set_binary_mode (classified_ofile); classified_ofile << points; classified_ofile.close(); From 6c380590951abda1178e23d1a938c713d233fdc5 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 11 Jan 2023 09:52:04 +0000 Subject: [PATCH 2/3] Add debug ouput --- Classification/examples/Classification/gis_tutorial_example.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Classification/examples/Classification/gis_tutorial_example.cpp b/Classification/examples/Classification/gis_tutorial_example.cpp index 7ebc50a1f30..ae53e07cef9 100644 --- a/Classification/examples/Classification/gis_tutorial_example.cpp +++ b/Classification/examples/Classification/gis_tutorial_example.cpp @@ -657,6 +657,8 @@ int main (int argc, char** argv) for (const std::vector& poly : polylines) ctp.insert_constraint (poly.begin(), poly.end()); + std::cout << "before simplify" << std::endl; + // Simplification algorithm with limit on distance PS::simplify (ctp, PS::Squared_distance_cost(), PS::Stop_above_cost_threshold (16 * spacing * spacing)); From 4e4399b059fb4ada61f31d3e0d43d67c3834f57d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 12 Jan 2023 09:42:18 +0000 Subject: [PATCH 3/3] As the input for fairing may be rather unsmooth around the hole we set the fairing_continuity to 0 --- .../examples/Classification/gis_tutorial_example.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Classification/examples/Classification/gis_tutorial_example.cpp b/Classification/examples/Classification/gis_tutorial_example.cpp index ae53e07cef9..40ce226259b 100644 --- a/Classification/examples/Classification/gis_tutorial_example.cpp +++ b/Classification/examples/Classification/gis_tutorial_example.cpp @@ -474,7 +474,8 @@ int main (int argc, char** argv) for (Mesh::Halfedge_index hi : holes) if (hi != outer_hull) CGAL::Polygon_mesh_processing::triangulate_refine_and_fair_hole - (dtm_mesh, hi, CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator()); + (dtm_mesh, hi, CGAL::Emptyset_iterator(), CGAL::Emptyset_iterator(), + CGAL::parameters::fairing_continuity(0)); // Save DTM with holes filled std::ofstream dtm_filled_ofile ("dtm_filled.ply", std::ios_base::binary); @@ -657,8 +658,6 @@ int main (int argc, char** argv) for (const std::vector& poly : polylines) ctp.insert_constraint (poly.begin(), poly.end()); - std::cout << "before simplify" << std::endl; - // Simplification algorithm with limit on distance PS::simplify (ctp, PS::Squared_distance_cost(), PS::Stop_above_cost_threshold (16 * spacing * spacing)); @@ -738,7 +737,7 @@ int main (int argc, char** argv) points.range(label_map)).mean_intersection_over_union() << std::endl; // Save the classified point set - std::ofstream classified_ofile ("classified_gis_tutorial.ply"); + std::ofstream classified_ofile ("classification_gis_tutorial.ply"); CGAL::IO::set_binary_mode (classified_ofile); classified_ofile << points; classified_ofile.close();