首页 > 解决方案 > 访问点集特征并将其写入点云

问题描述

我使用 cgal python 绑定编写了一个循环,将点特征写入点云。虽然它有效,但它不可避免地相当慢,我认为部分原因是 python 循环和我访问特征对象的方式。

我想知道是否有一种更快的方法我不知道使用 python 绑定将功能写入点集?否则(请原谅我的无知) - 有人可以演示访问和编写该功能的 C++ 等价物吗?

我的python代码的精简版如下(现实写了很多特性):

# opening and gen of features
points = Point_set_3(incloud)
features = Feature_set()
generator = Point_set_feature_generator(points, 5)
features.begin_parallel_additions()
generator.generate_point_based_features(features)
generator.generate_normal_based_features(features, points.normal_map())
features.end_parallel_additions()

# add the feat attribute idx to point set
dp = points.add_float_map("distance_to_plane_0")

# where 16 is the index of the distance to plain feature        
for i, p in enumerate(points.indices()):
    dp.set(p, features.get(16).value(i))

标签: cgalpoint-clouds

解决方案


推荐阅读