解释pcl::PointCloud<PointType>::Ptr& model
时间: 2024-05-30 17:14:13 浏览: 15
pcl::PointCloud<PointType>::Ptr 是 PCL(Point Cloud Library)中一个指向点云(point cloud)数据结构对象的指针,其中 PointType 表示点云中每个点的数据类型,.Ptr 表示该指针指向点云对象的智能指针类型。智能指针可以自动跟踪点云对象的引用计数,实现自动内存管理,避免内存泄漏等问题。
相关问题
void find_match_shot(pcl::PointCloud<pcl::BINARY>::Ptr shot1, pcl::PointCloud<pcl::BINARY>::Ptr shot2, pcl::CorrespondencesPtr model_scene_corrs)写法有问题吗
这段代码中存在问题,因为pcl::BINARY并不是PCL库中的数据类型。如果您想使用PCL的SHOT描述符来计算两个点云之间的相似性,可以使用以下代码:
```
pcl::PointCloud<pcl::SHOT352>::Ptr shot1(new pcl::PointCloud<pcl::SHOT352>());
pcl::PointCloud<pcl::SHOT352>::Ptr shot2(new pcl::PointCloud<pcl::SHOT352>());
pcl::registration::CorrespondenceEstimation<pcl::SHOT352, pcl::SHOT352> est;
est.setInputSource(shot1);
est.setInputTarget(shot2);
est.determineCorrespondences(*model_scene_corrs);
```
这段代码将创建两个PointCloud对象,分别用于存储两个点云的SHOT描述符。然后,使用pcl::registration::CorrespondenceEstimation类计算两个点云之间的对应关系。
find_match_shot(pcl::PointCloud<pcl::BINARY>::Ptr shot1, pcl::PointCloud<pcl::BINARY>::Ptr shot2, pcl::CorrespondencesPtr model_scene_corrs)BINARY不是pcl的成员
你是对的,感谢指出!正确的写法应该是 `pcl::BINARY` 而不是 `pcl::PointCloud<pcl::BINARY>`,`pcl::BINARY` 是 PCL 中提供的一种二进制描述子类型。因此,函数签名应该修改为:
```
void find_match_shot(pcl::PointCloud<pcl::BINARY>::Ptr shot1, pcl::PointCloud<pcl::BINARY>::Ptr shot2, pcl::CorrespondencesPtr model_scene_corrs)
```
感谢你的指正,我会注意更加准确的表达。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)