PCL 为所有函数实例化新的点类型

编程入门 行业动态 更新时间:2024-10-28 12:23:43
本文介绍了PCL 为所有函数实例化新的点类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在下面声明了一个新的点类型.但是,我需要它与所有可用的 PCL 功能一起使用.例如分割、体素网格等.在 PCL_INSTANTIATE 调用中包含所有实现标头是一种痛苦.无论如何都要对所有主要功能执行此操作吗?例如,为分割库中的所有函数编译我的点类型?

I have declared a new point type as such below. However, I need it to work with all available PCL functions. Such as segmentation, voxel grid etc. It is a pain to include all the implementation headers do the PCL_INSTANTIATE call. Is there anyway to do this for all major functions? For example, compile my point type for all functions in the segmentation library?

#define PCL_NO_PRECOMPILE #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/impl/instantiate.hpp> #include <pcl/kdtree/kdtree.h> #include <pcl/kdtree/kdtree_flann.h> #include <pcl/kdtree/impl/kdtree_flann.hpp> #include <pcl/search/impl/kdtree.hpp> #include <pcl/octree/octree_search.h> #include <pcl/octree/impl/octree_search.hpp> #include <pcl/segmentation/sac_segmentation.h> #include <pcl/segmentation/impl/sac_segmentation.hpp> struct FeaturePoint { PCL_ADD_POINT4D; PCL_ADD_RGB; PCL_ADD_NORMAL4D; static const int DESCRIPTOR_SIZE = 128; float descriptor[DESCRIPTOR_SIZE]; FeaturePoint() {} FeaturePoint(const FeaturePoint& input) { this->x = input.x; this->y = input.y; this->z = input.z; this->rgb = input.rgb; this->normal_x = input.normal_x; this->normal_y = input.normal_y; this->normal_z = input.normal_z; for(int i = 0; i < DESCRIPTOR_SIZE; ++i) { this->descriptor[i] = input.descriptor[i]; } // Ugly, as I was lazy } EIGEN_MAKE_ALIGNED_OPERATOR_NEW; } EIGEN_ALIGN16; POINT_CLOUD_REGISTER_POINT_STRUCT (FeaturePoint, (float, x, x) (float, y, y) (float, z, z) (float, rgb, rgb) (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) (float, descriptor, descriptor) ); PCL_INSTANTIATE(KdTree, FeaturePoint); PCL_INSTANTIATE(KdTreeFLANN, FeaturePoint); PCL_INSTANTIATE(OctreePointCloudSearch, FeatureP

推荐答案

这行不通!!

代替使用

PCL_INSTANTIATE(function,template);

试试

PCL_INSTANTIATE_PointCloud(template);

希望能帮到你.我花了 2 天时间寻找这个解决方案.

I hope it helps. I was 2 day looking for this solution.

更多推荐

PCL 为所有函数实例化新的点类型

本文发布于:2023-07-28 00:09:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225556.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   实例   类型   PCL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!