diff --git a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinders_parameters.cpp b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinders_parameters.cpp index b3e066f3539..9d7fa56fe80 100644 --- a/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinders_parameters.cpp +++ b/Point_set_shape_detection_3/test/Point_set_shape_detection_3/test_cylinders_parameters.cpp @@ -7,8 +7,8 @@ #include #include -const int rounds = 50; -const int ptsCount = 1000; +const int rounds = 50; // TODO: capitalize constant: NB_ROUNDS +const int ptsCount = 1000; // TODO: capitalize constant NB_POINTS template bool test_cylinder_parameters() { @@ -27,22 +27,25 @@ bool test_cylinder_parameters() { std::size_t success = 0; - for (std::size_t i = 0;i= rounds / 2) - for (std::size_t j = 0;j(bbox)); - } + Efficient_ransac ransac; ransac.add_shape_factory(); @@ -65,15 +68,17 @@ bool test_cylinder_parameters() { Efficient_ransac::Shape_range shapes = ransac.shapes(); + // check: unique shape detected if (shapes.size() != 1) continue; boost::shared_ptr cyl = boost::dynamic_pointer_cast((*shapes.first)); - if (!cyl) + // check: shape detected is a cylinder + if (!cyl) continue; - Vector dir = cyl->axis().to_vector(); + Vector dir = cyl->axis().to_vector(); Point pos = cyl->axis().point(0); // Check radius and alignment with axis.