pcl库实现spin image配准时遇到错误,遇到的错误 无法解析的外部符号
程序员文章站
2022-07-14 19:47:46
...
pcl库实现spin image配准时遇到错误,遇到的错误 无法解析的外部符号 (aaa@qq.comaaa@qq.comaaa@qq.com@aaa@qq.com@aaa@qq.com@aaa@qq.com@@aaa@qq.com@aaa@qq.comaaa@qq.com)
感谢这位老哥的回答,不过回答的有一部分不完善,比如没有初始化
http://www.pclcn.org/bbs/forum.php?mod=viewthread&tid=629&page=1#pid2807
不能直接使用histogram类型,所以转成了,VFHSignature308,不过切记要初始化
scia进行配准,但是pcl::Histogram<153>不能作为scia的特征描述参数(这一点我也不是很清楚为啥)
pcl::SampleConsensusInitialAlignment<pcl::PointXYZ, pcl::PointXYZ, pcl::Histogram<153>> scia;
pcl::SpinImageEstimation<pcl::PointXYZ, pcl::Normal, pcl::Histogram<153> > spin_image_descriptor;
pcl::search::KdTree<pcl::PointXYZ>::Ptr kdtree1(new pcl::search::KdTree<pcl::PointXYZ>());
spin_image_descriptor.setInputCloud(cloud_src_o);
spin_image_descriptor.setInputNormals(normals);
spin_image_descriptor.setSearchMethod(kdtree1);
pcl::PointCloud<pcl::Histogram<153> >::Ptr spin_images(new pcl::PointCloud<pcl::Histogram<153> >);
spin_image_descriptor.setRadiusSearch(8);
spin_image_descriptor.compute(*spin_images);
pcl::PointCloud<pcl::VFHSignature308>::Ptr source_feature(new pcl::PointCloud<pcl::VFHSignature308>);
pcl::PointCloud<pcl::VFHSignature308>::Ptr target_feature(new pcl::PointCloud<pcl::C>);
pcl::VFHSignature308 midpoint1;
pcl::VFHSignature308 midpoint2;
//这里需要先对midpoint1进行初始化
for (int i = 0; i < 308; i++){
midpoint1.histogram[i] = 0;
midpoint2.histogram[i] = 0;
}
for (int j = 0; j<spin_images->size(); ++j)
{
for (int i = 0; i<153; i++)
{
midpoint1.histogram[i] = spin_images->points[j].histogram[i];
}
source_feature->push_back(midpoint1);
}
for (int j = 0; j<spin_images1->size(); ++j)
{
for (int i = 0; i<153; i++)
{
midpoint2.histogram[i] = spin_images1->points[j].histogram[i];
}
target_feature->push_back(midpoint2);
}
之后就可以正常配准了
这里pcl::VFHSignature308替换之前pcl::Histogram<153>
pcl::SampleConsensusInitialAlignment<pcl::PointXYZ, pcl::PointXYZ, pcl::VFHSignature308> scia;
scia.setInputSource(cloud_src_o);
scia.setInputTarget(cloud_tgt_o);
scia.setSourceFeatures(source_feature);
scia.setTargetFeatures(target_feature);
最后放一张配准的图吧,感觉spin image这个配准的效果不是很好啊(不知道是不是哪里参数设置有问题)