diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/include/Parameters.h b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/include/Parameters.h index 0f47d8bb8bd..090ac66f911 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/include/Parameters.h +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/include/Parameters.h @@ -52,7 +52,7 @@ namespace KSR { // Reconstruction. bool use_ground; - FT graphcut_beta; // magic parameter between 0 and 1 + FT graphcut_lambda; // magic parameter between 0 and 1 //std::map external_nodes; // Constructor. @@ -81,7 +81,7 @@ namespace KSR { reorient(false), use_ground(false), // reconstruction - graphcut_beta(FT(1) / FT(2)) + graphcut_lambda(FT(1) / FT(2)) { } }; diff --git a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp index 019ec529797..123c7066af3 100644 --- a/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp +++ b/Kinetic_surface_reconstruction/examples/Kinetic_surface_reconstruction/ksr_parameters.cpp @@ -74,7 +74,7 @@ void parse_terminal(Terminal_parser& parser, Parameters& parameters) { parser.add_val_parameter("-osize", parameters.max_octree_node_size); // Reconstruction. - parser.add_val_parameter("-lambda", parameters.graphcut_beta); + parser.add_val_parameter("-lambda", parameters.graphcut_lambda); parser.add_val_parameter("-ground", parameters.use_ground); // Debug. @@ -146,9 +146,7 @@ int main(const int argc, const char** argv) { std::cout << "maximum_angle " << parameters.maximum_angle << std::endl; std::cout << "min_region_size " << parameters.min_region_size << std::endl; std::cout << "k " << parameters.k_intersections << std::endl; - std::cout << "graphcut_beta " << parameters.graphcut_beta << std::endl; - - std::cout << parameters.regorthogonal << " " << parameters.regsymmetric << std::endl; + std::cout << "graphcut_lambda " << parameters.graphcut_lambda << std::endl; auto param = CGAL::parameters::maximum_distance(parameters.maximum_distance) .maximum_angle(parameters.maximum_angle) @@ -190,27 +188,27 @@ int main(const int argc, const char** argv) { std::map external_nodes; - external_nodes[KSR::KSP::Face_support::ZMIN] = true; - - if (parameters.use_ground) - ksr.reconstruct_with_ground(parameters.graphcut_beta, std::back_inserter(vtx), std::back_inserter(polylist)); + if (parameters.use_ground) { + external_nodes[KSR::KSP::Face_support::ZMIN] = false; + ksr.reconstruct_with_ground(parameters.graphcut_lambda, std::back_inserter(vtx), std::back_inserter(polylist)); + } else - ksr.reconstruct(parameters.graphcut_beta, external_nodes, std::back_inserter(vtx), std::back_inserter(polylist)); + ksr.reconstruct(parameters.graphcut_lambda, external_nodes, std::back_inserter(vtx), std::back_inserter(polylist)); FT after_reconstruction = timer.time(); if (polylist.size() > 0) - CGAL::IO::write_polygon_soup("polylist_" + std::to_string(parameters.graphcut_beta) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist); + CGAL::IO::write_polygon_soup("polylist_" + std::to_string(parameters.graphcut_lambda) + (parameters.use_ground ? "_g" : "_") + ".off", vtx, polylist); timer.stop(); const FT time = static_cast(timer.time()); - std::vector lambdas{0.3, 0.5, 0.7, 0.73, 0.75, 0.77, 0.8, 0.9, 0.95, 0.99}; + std::vector lambdas{0.3, 0.5, 0.6, 0.7, 0.73, 0.75, 0.77, 0.8, 0.9, 0.95, 0.99}; bool non_empty = false; for (FT l : lambdas) { - if (l == parameters.graphcut_beta) + if (l == parameters.graphcut_lambda) continue; vtx.clear(); diff --git a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h index cc8e414f2f8..7df975df13c 100644 --- a/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h +++ b/Kinetic_surface_reconstruction/include/CGAL/Kinetic_surface_reconstruction_3.h @@ -905,9 +905,6 @@ private: std::cout << "outside face" << std::endl; } - if (m_verbose) - std::cout << "polygon regions " << polygon_regions.size() << std::endl; - if (m_debug) KSP_3::internal::dump_polygons(polygon_regions, "faces_by_region-" + std::to_string(lambda) + ".ply"); @@ -1435,11 +1432,7 @@ private: } } } - if (m_verbose) { - for (std::size_t i = 0; i < polygons.size(); i++) - if (!merged[i]) - std::cout << "ghost edge could not be placed" << std::endl; - } + if (outer != 0) polygons[0] = std::move(polygons[outer]); polygons.resize(1); @@ -1897,9 +1890,6 @@ private: for (std::size_t i = 0; i < other_ground.size(); i++) std::move(m_regions[other_ground[i]].second.begin(), m_regions[other_ground[i]].second.end(), std::back_inserter(m_regions[m_ground_polygon_index].second)); - if (m_verbose) - std::cout << "ground polygon " << m_ground_polygon_index << ", merging other polygons" << std::endl; - while (other_ground.size() != 0) { m_regions.erase(m_regions.begin() + other_ground.back()); other_ground.pop_back();