Fix tests from shape detection

This commit is contained in:
Simon Giraudot 2017-08-03 09:02:51 +02:00
parent 82100d5c07
commit b0f636530b
2 changed files with 71 additions and 9 deletions

View File

@ -160,13 +160,28 @@ int main()
check_ransac_size (ransac, 2);
std::vector<Plane> before = get_ransac_planes(ransac);
CGAL::regularize_planes (ransac, true, false, false, false, 5.);
// Test regularization
typename Efficient_ransac::Plane_range planes = ransac.planes();
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
true, false, false, false, 5.);
std::vector<Plane> after = get_ransac_planes(ransac);
std::cerr << " * Nothing should change now..." << std::endl;
check_planes_unchanged (before, after);
CGAL::regularize_planes (ransac, true, false, false, false, 15.);
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
true, false, false, false, 15.);
after = get_ransac_planes(ransac);
std::cerr << " * Something should change now..." << std::endl;
@ -192,13 +207,27 @@ int main()
check_ransac_size (ransac, 2);
std::vector<Plane> before = get_ransac_planes(ransac);
CGAL::regularize_planes (ransac, false, true, false, true, 5.);
typename Efficient_ransac::Plane_range planes = ransac.planes();
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
false, true, false, true, 5.);
std::vector<Plane> after = get_ransac_planes(ransac);
std::cerr << " * Nothing should change now..." << std::endl;
check_planes_unchanged (before, after);
CGAL::regularize_planes (ransac, false, true, false, true, 15.);
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
false, true, false, true, 15.);
after = get_ransac_planes(ransac);
std::cerr << " * Something should change now..." << std::endl;
@ -223,13 +252,27 @@ int main()
check_ransac_size (ransac, 2);
std::vector<Plane> before = get_ransac_planes(ransac);
CGAL::regularize_planes (ransac, true, false, true, false, 5., 0.1);
typename Efficient_ransac::Plane_range planes = ransac.planes();
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
true, false, true, false, 5., 0.1);
std::vector<Plane> after = get_ransac_planes(ransac);
std::cerr << " * Nothing should change now..." << std::endl;
check_planes_unchanged (before, after);
CGAL::regularize_planes (ransac, true, false, true, false, 5., 0.3);
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
true, false, true, false, 5., 0.3);
after = get_ransac_planes(ransac);
std::cerr << " * Something should change now..." << std::endl;
@ -259,13 +302,26 @@ int main()
check_ransac_size (ransac, 2);
std::vector<Plane> before = get_ransac_planes(ransac);
CGAL::regularize_planes (ransac, false, false, false, true, 5., 0.01, Vector(1., 0., 0.));
typename Efficient_ransac::Plane_range planes = ransac.planes();
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
false, false, false, true, 5., 0.01, Vector(1., 0., 0.));
std::vector<Plane> after = get_ransac_planes(ransac);
std::cerr << " * Nothing should change now..." << std::endl;
check_planes_unchanged (before, after);
CGAL::regularize_planes (ransac, false, false, false, true, 15., 0.01, Vector(1., 0., 0.));
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
false, false, false, true, 15., 0.01, Vector(1., 0., 0.));
after = get_ransac_planes(ransac);
std::cerr << " * Something should change now..." << std::endl;

View File

@ -128,7 +128,13 @@ bool test_scene() {
}
// Test regularization
CGAL::regularize_planes (ransac, true, true, true, true,
typename Efficient_ransac::Plane_range planes = ransac.planes();
CGAL::regularize_planes (points,
Point_map(),
planes,
CGAL::Shape_detection_3::Plane_map<Traits>(),
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes),
true, true, true, true,
(FT)50., (FT)0.01);
Point_index_range pts = ransac.indices_of_unassigned_points();