Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Remove outliers from points in which each point has a property (weight) associated with it?
Chronological Thread
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Remove outliers from points in which each point has a property (weight) associated with it?
- Date: Tue, 21 Jun 2016 19:23:28 +0200
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:lTxNeRf7D7xoDnuP+cTazzrSlGMj4u6mDksu8pMizoh2WeGdxc68YB7h7PlgxGXEQZ/co6odzbGH6+a4ASdfvt6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLHqvcWLKFoXzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IAu3GePEzQrVcSTgnKGso/9bDtB/ZTALJ6GFPfH8Rl08COAXP5QrmX5r3+g/9rOt6xGHaEsDxSL0oQyWM5qx3TwX5yW1PYyU993vWjdA2iaZzrxeophg5yInRNtLGfMFid7/QKItJDVFKWdxcAnRM
- Organization: GeometryFactory
Something like the following (not tested) should be working:
typedef std::pair<Point,Info> Pair;
std::vector< Pair > points_and_info;
std::vector< Pair >::iterator it =
CGAL::remove_outliers(points_and_info.begin(),
points_and_info.end(),
CGAL::First_of_pair_property_map<Pair>(),
nb_neighbors,
removed_percentage);
// to remove points
points_and_info.resize(std::distance(points_and_info.begin(),it));
HTH,
Sebastien.
On 06/21/2016 02:21 AM, shan23 wrote:
Hi,
I'm trying to use Point Set Processing package to pre-process a set of 2D
points, which have a property (weight) associated with them. Specifically,
I'd like to remove outliers from the input point set using the
*CGAL::remove_outliers* function.
What I can't figure out, is how to "tag" each point with its associated
weight, so after the outliers are removed, the remaining points have their
original weights associated with them. To be clear, I (currently) am not
looking to influence the removal of outliers using the weights of the points
- what I want is to ensure that the points output by *CGAL::remove_outliers*
have their original weights associated with them.
I'm guessing I'd have to use a property map to specify that the input is a
pair of type <Point_2, size_t>, but to do so, it appears to me that I'd have
to use the following property maps : *CGAL::First_of_pair_property_map* and
*CGAL::Second_of_pair_property_map*. But the function
*CGAL::remove_outliers* takes only a property map which is "is a model of
ReadablePropertyMap with value type Point_3<Kernel>." I looked in the
source code (include/CGAL/remove_outliers.h), where the only use of the
property map is to "get" the vertex, and not any associated property as
well.
I'm not well-versed in the use of property maps - is what I'm trying to do
(which doesn't seem very unreasonable to me, as points often may have
associated properties) possible using the existing API of
*CGAL::remove_outliers*? If its possible, could you please give an example?
Please let me know if additional details are needed!
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Remove-outliers-from-points-in-which-each-point-has-a-property-weight-associated-with-it-tp4662005.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Remove outliers from points in which each point has a property (weight) associated with it?, shan23, 06/21/2016
- Re: [cgal-discuss] Remove outliers from points in which each point has a property (weight) associated with it?, Sebastien Loriot (GeometryFactory), 06/21/2016
Archive powered by MHonArc 2.6.18.