cgal - 访问点集特征并将其写入点云
问题描述
我使用 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))
解决方案
推荐阅读
- python - 如何从 url 获取可选参数并使用它们来解析模型中的对象?
- javascript - 如何在 AndroidManifest 中修改 Activity 意图,使其运行我的 App.js 而不是 activity_main.xml
- go - Websocket拨号器维护websocket连接
- java - Android Studio Emulator 在 Windows 上崩溃 已过时且存在严重的性能问题
- python - 如何从python中的df绘制置信区间
- memory - 页面错误处理程序处理读取和写入访问请求的方式有何不同?
- python - 如何将绘图图保存为 jpg
- python - Pandas DF 从长到宽
- python - 无法导入 win32crypt
- amazon-web-services - ec2 弹性推理不可及