SIFT:尺度不变特征变换
主要步骤:
(1)创建SIFT关键点估计对象,并输入点云;
pcl::SIFTKeypoint<pcl::PointXYZ, pcl::PointWithScale> sift;//创建sift关键点检测对象
pcl::PointCloud<pcl::PointWithScale> result;
sift.setInputCloud(cloud_xyz);//设置输入点云
(2)创建一个空的k-d数对象tree,并传递到SIFT检测对象;
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ> ());
sift.setSearchMethod(tree);
(3)设置参数:搜索尺度范围,限制关键点检测的阈值;
sift.setScales(min_scale, n_octaves, n_scales_per_octave);//指定搜索关键点的尺度范围
sift.setMinimumContrast(min_contrast);//设置限制关键点检测的阈值
(4)将结果转换为点类型。
sift.compute(result);//执行sift关键点检测,保存结果在result
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_temp (new pcl::PointCloud<pcl::PointXYZ>);
copyPointCloud(result, *cloud_temp);
结果: