Subject: CGAL users discussion list
List archive
- From: Jing Zhao <>
- To:
- Subject: [cgal-discuss] Point set structuring with Cartesian_converter_property_map?
- Date: Mon, 11 Feb 2019 04:23:37 -0600 (CST)
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Fail ; spf=Pass
- Ironport-phdr: 9a23:ZYR/sB2sd3roUDGVsmDT+DRfVm0co7zxezQtwd8ZsewfKfad9pjvdHbS+e9qxAeQG9mDu7Qc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPYAhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmhicJOSA6/m/KhcN/kK1VrQm9pxxm34LYfJ2ZOOZ8c67bYNgURXBBXsFUVyFZBo28bo0PD+UcNulbr4nyvVwOpga5CAWxGe/j1D9FimP00KA5zegtDwXL0Rc5H9IXqnjbsNL1NKILXO2z0aLGwzLDb/ZM1jf87ojFahYhruuXUr1rdcre11MjGB/CjlWVr4HuIjCb1vwVvmSG6+dtUfijhmAkpg1roTWix90gh4jIi48T11vK7z92wJwvKt29UEN7YcCrEJ9XtyyCMYt7TdkuQ2dytykh0bIGvYC0cDIWx5Qgwh7Tc/2Hc46W7RL/TOudPDN1iXZ/dL+xhBu+60utx+zmWsS10VtGti9FncPNtnAJ2RzT8M+HSv5l80u8xDqDyQDe5v1GLE03i6bXNZosz6UplpoKq0jMAij2mEDugK+Makok4vSo6/jgYrj+upCcOJV7igXnPqszm8y/Gvg3MhUVX2iA4um8z73i/UjhQLpQlPE2k6/ZsIrbJcsBvKK5DRVVgc4f7EO0AD6ildgZhnIaN0lteRSdjoGvNUudDur/CKKdglKj2AVrzveOauS4WMiVcSiZyubJZK874ElZnllghetD7o5ZX+lSaMn4XVX84YSBX00JdjesyuOiM+1Tk4YXWGaBGKicYPHLqBmD4ed9f7DQNr9Qgy70Lr0e39CrlWUwyQ0EZO+i2p5FMCnlTMQjGF2QZD/XuvlEEWoOuVNjHuq2zluLWzRXajC5WKduvzw=
Hi guys,
I'm using *CGAL::Point_set_with_structure* together with
*CGAL::Cartesian_converter_property_map* and the compiling process failed.
I'm using Exact_predicates_inexact_constructions_kernel with
Efficient_RANSAC to do plane detection first.
Then I want to send the plane detection result of RANSAC to
Point_set_structuring with Exact_predicates_exact_constructions_kernel.
(Since I need the projection result of structuring to be exact, the
exact_constructions_kernel is required here).
However the compiling process failed. It seems that the constructor of
Cartesian_converter_property_map needs 1 argument while the source code did
not consider this situation?
/My code looks like this:/
// *Kernel type declarations*
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Exact_predicates_exact_constructions_kernel
Exact_kernel;
// *exact construction types*
typedef Exact_kernel::Point_3
epoint;
typedef Exact_kernel::Plane_3
eplane;
typedef Exact_kernel::Vector_3
evector;
// *inexact construction types*
typedef Kernel::Point_3
Point;
typedef Kernel::Plane_3
Plane;
typedef Kernel::Vector_3
Vector;
typedef std::pair<Point, Vector>
Point_with_normal;
typedef std::vector<Point_with_normal>
Pwn_vector;
typedef CGAL::First_of_pair_property_map<Point_with_normal>
Point_map;
typedef CGAL::Second_of_pair_property_map<Point_with_normal>
Normal_map;
// *Efficient RANSAC types*
typedef CGAL::Shape_detection_3::Shape_detection_traits
<Kernel, Pwn_vector, Point_map, Normal_map>
Traits;
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits>
Efficient_ransac;
typedef CGAL::Shape_detection_3::Plane<Traits>
Plane_shape;
typedef CGAL::Shape_detection_3::Plane_map<Traits>
Plane_map;
typedef CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>
Plane_index_map;
// *property map converter*
typedef CGAL::Cartesian_converter_property_map<epoint, Point_map>
IK_to_EK_point_map;
typedef CGAL::Cartesian_converter_property_map<evector, Normal_map>
IK_to_EK_normal_map;
typedef CGAL::Cartesian_converter_property_map<eplane, Plane_map>
IK_to_EK_plane_map;
// *Structuring types*
typedef CGAL::Point_set_with_structure<Exact_kernel> Structure;
// *RANSAC Shape detection*
Efficient_ransac ransac;
ransac.set_input(points);
ransac.add_shape_factory<Plane_shape>();
ransac.detect();
Efficient_ransac::Plane_range planes = ransac.planes();
// *Points with normals.*
Pwn_vector points;
// *Point set structuring*
Structure pss (points,
planes,
0.015, // epsilon for structuring points
CGAL::parameters::point_map (
/*IK_to_EK_point_map(Point_map())*/ ).
normal_map ( /*IK_to_EK_normal_map(Normal_map())* /).
plane_map (/ *IK_to_EK_plane_map(Plane_map())*/ ).
plane_index_map (
CGAL::Shape_detection_3::Point_to_shape_index_map<Traits>(points, planes))
);
/The compiling error message looks like this:/
/usr/local/include/CGAL/structure_point_set.h:253:78: error: no matching
function for call to
‘CGAL::Cartesian_converter_property_map<CGAL::Point_3<CGAL::Epeck>,
CGAL::First_of_pair_property_map<std::pair<CGAL::Point_3<CGAL::Epick>,
CGAL::Vector_3<CGAL::Epick> > > >::Cartesian_converter_property_map()’
PointMap point_map = choose_param(get_param(np,
internal_np::point_map), PointMap());
^~~~~~~~~~
In file included from /usr/local/include/CGAL/IO/read_xyz_points.h:27:0,
from structuring_example.cpp:3:
/usr/local/include/CGAL/property_map.h:550:3: note: candidate:
CGAL::Cartesian_converter_property_map<GeomObject,
Vpm>::Cartesian_converter_property_map(Vpm) [with GeomObject =
CGAL::Point_3<CGAL::Epeck>; Vpm =
CGAL::First_of_pair_property_map<std::pair<CGAL::Point_3<CGAL::Epick>,
CGAL::Vector_3<CGAL::Epick> > >]
Cartesian_converter_property_map(Vpm vpm):vpm(vpm){}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/CGAL/property_map.h:550:3: note: candidate expects 1
argument, 0 provided
From what I know, the constructor of Cartesian_converter_property_map needs
the one property map object as argument as I did in the above code (the
italic bold part). However the source code of structuring seems did not
allow this?
/The source code looks like this:/
230 template <typename PointRange,
231 typename PlaneRange,
232 typename NamedParameters>
233 void init (const PointRange& points,
234 const PlaneRange& planes,
235 double epsilon,
236 const NamedParameters& np)
237 {
238 using boost::choose_param;
239
240 // basic geometric types
241 typedef typename Point_set_processing_3::GetPointMap<PointRange,
NamedParameters>::type PointMap;
242 typedef typename Point_set_processing_3::GetNormalMap<PointRange,
NamedParameters>::type NormalMap;
243 typedef typename Point_set_processing_3::GetPlaneMap<PlaneRange,
NamedParameters>::type PlaneMap;
244 typedef typename
Point_set_processing_3::GetPlaneIndexMap<NamedParameters>::type
PlaneIndexMap;
245
246 CGAL_static_assertion_msg(!(boost::is_same<NormalMap,
247 typename
Point_set_processing_3::GetNormalMap<PointRange,
NamedParameters>::NoMap>::value),
248 "Error: no normal map");
249 CGAL_static_assertion_msg(!(boost::is_same<PlaneIndexMap,
250 typename
Point_set_processing_3::GetPlaneIndexMap<NamedParameters>::NoMap>::value),
251 "Error: no plane index map");
252
253 PointMap point_map = choose_param(get_param(np,
internal_np::point_map), PointMap());
254 NormalMap normal_map = choose_param(get_param(np,
internal_np::normal_map), NormalMap());
255 PlaneMap plane_map = choose_param(get_param(np,
internal_np::plane_map), PlaneMap());
256 PlaneIndexMap index_map = choose_param(get_param(np,
internal_np::plane_index_map), PlaneIndexMap());
257 double attraction_factor = choose_param(get_param(np,
internal_np::attraction_factor), 3.);
I'm really new to CGAL and not sure if what I think is right. Could someone
tell me what to do with this? Should I modify the source code?
Thanks in advance!
Best,
Jing
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- [cgal-discuss] Point set structuring with Cartesian_converter_property_map?, Jing Zhao, 02/11/2019
- <Possible follow-up(s)>
- [cgal-discuss] Point set structuring with Cartesian_converter_property_map?, Jing Zhao, 02/11/2019
Archive powered by MHonArc 2.6.18.