#include "gror_pre.h"
void GrorPre::voxelGridFilter(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, pcl::PointCloud<pcl::PointXYZ>::Ptr cloudVG, double inlTh)
{
//format for filtering
pcl::PCLPointCloud2::Ptr cloud2(new pcl::PCLPointCloud2());
pcl::PCLPointCloud2::Ptr cloudVG2(new pcl::PCLPointCloud2());
pcl::toPCLPointCloud2(*cloud, *cloud2);
//set up filtering parameters
pcl::VoxelGrid<pcl::PCLPointCloud2> sor;
sor.setInputCloud(cloud2);
sor.setLeafSize(inlTh, inlTh, inlTh);
//filtering process
sor.filter(*cloudVG2);
pcl::fromPCLPointCloud2(*cloudVG2, *cloudVG);
}
void GrorPre::issKeyPointExtration(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, pcl::PointCloud<pcl::PointXYZ>::Ptr ISS, pcl::PointIndicesPtr ISS_Idx, double resolution)
{
double iss_salient_radius_ = 6 * resolution;
double iss_non_max_radius_ = 4 * resolution;
//double iss_non_max_radius_ = 2 * resolution;//for office
//double iss_non_max_radius_ = 9 * resolution;//for railway
double iss_gamma_21_(0.975);
double iss_gamma_32_(0.975);
double iss_min_neighbors_(4);
int iss_threads_(1); //switch to the number of threads in your cpu for acceleration
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>());
pcl::ISSKeypoint3D<pcl::PointXYZ, pcl::PointXYZ> iss_detector;
iss_detector.setSearchMethod(tree);
iss_detector.setSalientRadius(iss_salient_radius_);
iss_detector.setNonMaxRadius(iss_non_max_radius_);
iss_detector.setThreshold21(iss_gamma_21_);
iss_detector.setThreshold32(iss_gamma_32_);
iss_detector.setMinNeighbors(iss_min_neighbors_);
iss_detector.setNumberOfThreads(iss_threads_);
iss_detector.setInputCloud(cloud);
iss_detector.compute(*ISS);
ISS_Idx->indices = iss_detector.getKeypointsIndices()->indices;
ISS_Idx->header = iss_detector.getKeypointsIndices()->header;
}
void GrorPre::fpfhComputation(pcl::PointCloud<pcl::PointXYZ>::Ptr cloud, double resolution, pcl::PointIndicesPtr iss_Idx, pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfh_out)
{
//compute normal
pcl::PointCloud<pcl::Normal>::Ptr normal(new pcl::PointCloud<pcl::Normal>());
pcl::search::KdTree<pcl::PointXYZ>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZ>());
pcl::NormalEstimation<pcl::PointXYZ, pcl::Normal> ne;
ne.setInputCloud(cloud);
ne.setSearchMethod(tree);
ne.setRadiusSearch(3 * resolution);
ne.compute(*normal);
//compute fpfh using normals
pcl::FPFHEstimationOMP<pcl::PointXYZ, pcl::Normal, pcl::FPFHSignature33> fpfh_est;
fpfh_est.setInputCloud(cloud);
fpfh_est.setInputNormals(normal);
fpfh_est.setSearchMethod(tree);
fpfh_est.setRadiusSearch(8 * resolution);
fpfh_est.setNumberOfThreads(16);
fpfh_est.setIndices(iss_Idx);
fpfh_est.compute(*fpfh_out);
}
void GrorPre::correspondenceSearching(pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfhs, pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfht, pcl::Correspondences & corr, int max_corr, std::vector<int>& corr_NOs, std::vector<int>& corr_NOt)
{
int n = std::min(max_corr, (int)fpfht->size()); //maximum number of correspondences to find for each source point
corr.clear();
corr_NOs.assign(fpfhs->size(), 0);
corr_NOt.assign(fpfht->size(), 0);
// Use a KdTree to search for the nearest matches in feature space
pcl::KdTreeFLANN<pcl::FPFHSignature33> treeS;
treeS.setInputCloud(fpfhs);
pcl::KdTreeFLANN<pcl::FPFHSignature33> treeT;
treeT.setInputCloud(fpfht);
for (size_t i = 0; i < fpfhs->size(); i++) {
std::vector<int> corrIdxTmp(n);
std::vector<float> corrDisTmp(n);
//find the best n matches in target fpfh
treeT.nearestKSearch(*fpfhs, i, n, corrIdxTmp, corrDisTmp);
for (size_t j = 0; j < corrIdxTmp.size(); j++) {
bool removeFlag = true;
int searchIdx = corrIdxTmp[j];
std::vector<int> corrIdxTmpT(n);
std::vector<float> corrDisTmpT(n);
treeS.nearestKSearch(*fpfht, searchIdx, n, corrIdxTmpT, corrDisTmpT);
for (size_t k = 0; k < n; k++) {
if (corrIdxTmpT.data()[k] == i) {
removeFlag = false;
break;
}
}
if (removeFlag == false) {
pcl::Correspondence corrTabTmp;
corrTabTmp.index_query = i;
corrTabTmp.index_match = corrIdxTmp[j];
corrTabTmp.distance = corrDisTmp[j];
corr.push_back(corrTabTmp);
corr_NOs[i]++;
corr_NOt[corrIdxTmp[j]]++;
}
}
}
}
void GrorPre::grorPreparation(pcl::PointCloud<pcl::PointXYZ>::Ptr origin_cloudS, pcl::PointCloud<pcl::PointXYZ>::Ptr origin_cloudT,pcl::PointCloud<pcl::PointXYZ>::Ptr cloudS, pcl::PointCloud<pcl::PointXYZ>::Ptr cloudT, pcl::PointCloud<pcl::PointXYZ>::Ptr issS, pcl::PointCloud<pcl::PointXYZ>::Ptr issT, pcl::CorrespondencesPtr corr,double resolution)
{
int max_corr = 5;// neighbor number in descriptor searching
auto t = std::chrono::system_clock::now();
/*=============down sample point cloud by voxel grid filter=================*/
std::cout << "/*voxel grid sampling......" << resolution << std::endl;
GrorPre::voxelGridFilter(origin_cloudS, cloudS, resolution);
GrorPre::voxelGridFilter(origin_cloudT, cloudT, resolution);
auto t1 = std::chrono::system_clock::now();
std::cout << "/*Down!: time consumption of cloud down sample : " << double(std::chrono::duration_cast<std::chrono::milliseconds>(t1 - t).count()) / 1000.0 << std::endl;
std::cout << "/*=================================================*/" << std::endl;
/*=========================extract iss key points===========================*/
std::cout << "/*extracting ISS keypoints......" << std::endl;
pcl::PointIndicesPtr iss_IdxS(new pcl::PointIndices);
pcl::PointIndicesPtr iss_IdxT(new pcl::PointIndices);
GrorPre::issKeyPointExtration(cloudS, issS, iss_IdxS, resolution);
GrorPre::issKeyPointExtration(cloudT, issT, iss_IdxT, resolution);
auto t2 = std::chrono::system_clock::now();
std::cout << "/*Down!: time consumption of iss key point extraction: " << double(std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count()) / 1000.0 << std::endl;
std::cout << "/*=================================================*/" << std::endl;
/*======================fpfh descriptor computation=========================*/
std::cout << "/*fpfh descriptor computation......" << std::endl;
pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfhS(new pcl::PointCloud<pcl::FPFHSignature33>());
pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfhT(new pcl::PointCloud<pcl::FPFHSignature33>());
GrorPre::fpfhComputation(cloudS, resolution, iss_IdxS, fpfhS);
GrorPre::fpfhComputation(cloudT, resolution, iss_IdxT, fpfhT);
auto t3 = std::chrono::system_clock::now();
std::cout << "/*Down!: time consumption of fpfh descriptor computation: " << double(std::chrono::duration_cast<std::chrono::milliseconds>(t3 - t2).count()) / 1000.0 << std::endl;
std::cout << "/*size of issS = " << issS->size() << "; size of issT = " << issT->size() << std::endl;
std::cout << "/*=================================================*/" << std::endl;
/*========================correspondences matching=========================*/
std::cout << "/*matching correspondences..." << std::endl;
std::vector<int> corr_NOS, corr_NOT;
GrorPre::correspondenceSearching(fpfhS, fpfhT, *corr, max_corr, corr_NOS, corr_NOT);
auto t4 = std::chrono::system_clock::now();
std::cout << "/*Down!: time consumption of matching correspondences: " << double(std::chrono::duration_cast<std::chrono::milliseconds>(t4 - t3).count()) / 1000.0 << std::endl;
std::cout << "/*number of correspondences= " << corr->size() << std::endl;
std::cout << "/*=================================================*/" << std::endl;
}
void GrorPre::grorPreparation(pcl::PointCloud<pcl::PointXYZ>::Ptr origin_cloudS, pcl::PointCloud<pcl::PointXYZ>::Ptr origin_cloudT, pcl::PointCloud<pcl::PointXYZ>::Ptr cloudS, pcl::PointCloud<pcl::PointXYZ>::Ptr cloudT, pcl::PointCloud<pcl::PointXYZ>::Ptr issS, pcl::PointCloud<pcl::PointXYZ>::Ptr issT, Eigen::Vector3f ¢erS, Eigen::Vector3f ¢erT, pcl::CorrespondencesPtr corr, double resolution)
{
int max_corr = 5;// neighbor number in descriptor searching
auto t = std::chron
没有合适的资源?快使用搜索试试~ 我知道了~
GROR配准,一种基于对应图可靠性的快速点云配准异常值去除策略
共50个文件
tlog:8个
ipch:6个
vsidx:5个
需积分: 5 2 下载量 54 浏览量
2024-04-03
13:59:43
上传
评论
收藏 403.31MB ZIP 举报
温馨提示
GROR配准,一种基于对应图可靠性的快速点云配准异常值去除策略
资源推荐
资源详情
资源评论
收起资源包目录
GROR.zip (50个子文件)
LearnPoint8
LearnPoint8.sln 1KB
.vs
LearnPoint8
v17
DocumentLayout.json 6KB
fileList.bin 324KB
Browse.VC.db 125.87MB
.suo 40KB
ipch
AutoPCH
b6b0d7abce98253
IA_GROR.ipch 209.56MB
7aa4af7a12a62d60
MAIN.ipch 496.94MB
6be4d9fe53b4cd0b
IA_GROR.ipch 200.06MB
e06bee93d6a950c3
GROR_PRE.ipch 358.31MB
2e5a3f60609c5a36
GROR_COMMON.ipch 35.13MB
a61a0a5e1ed80108
GROR_COMMON.ipch 465.38MB
FileContentIndex
eac29486-42dc-42f9-8840-b8ff74351644.vsidx 14KB
c6c8f945-d160-4a84-b0a8-25fcd5e37322.vsidx 21KB
5159eb5e-4ade-482e-8969-97591c141cc5.vsidx 33KB
9500f270-6409-4c4d-b16b-c8e9b2fe0110.vsidx 19KB
56ab63d3-669f-45d3-9359-d51c21693a5a.vsidx 18KB
x64
Release
LearnPoint8.exe 253KB
LearnPoint8.pdb 33.4MB
LearnPoint8
gror_pre.cpp 11KB
gror_common.h 781B
main.cpp 4KB
x64
Release
vc143.pdb 32.64MB
LearnPoint8.exe.recipe 299B
gror_pre.obj 10.29MB
LearnPoint8.tlog
CL.write.1.tlog 1KB
Cl.items.tlog 234B
link.secondary.1.tlog 272B
CL.command.1.tlog 2KB
link.command.1.tlog 10KB
link.read.1.tlog 26KB
link.write.1.tlog 494B
LearnPoint8.lastbuildstate 160B
CL.read.1.tlog 637KB
LearnPoint8.iobj 19.31MB
LearnPoint8.log 2KB
LearnPoint8.ipdb 60.36MB
main.obj 16.27MB
LearnPoint8.vcxproj.user 168B
gror_pre.h 3KB
LearnPoint8.vcxproj.filters 1KB
ia_gror.hpp 24KB
LearnPoint8.vcxproj 12KB
ia_gror.h 12KB
pcd
bun_zipper2.ply 2.65MB
bun_zipper.ply 2.89MB
pig_view1.pcd 1.71MB
cow01.pcd 3.09MB
cow02.pcd 4.42MB
6_00003.pcd 35.16MB
pig_view2.pcd 1.69MB
共 50 条
- 1
资源评论
jjm2002
- 粉丝: 1088
- 资源: 24
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于opencv+yolov8实现目标追踪及驻留时长统计源码.zip
- 水稻病害基于Yolov8算法优化目标检测识别与AI辅助决策python源码+模型+使用说明.zip
- 海尔618算价表_七海5.20_16.00xlsx(1)(2).xlsx
- WebCrawler.scr
- 【计算机专业毕业设计】大学生就业信息管理系统设计源码.zip
- YOLO 数据集:8种路面缺陷病害检测【包含划分好的数据集、类别class文件、数据可视化脚本】
- JAVA实现Modbus RTU或Modbus TCPIP案例.zip
- 基于YOLOv8的FPS TPS AI自动锁定源码+使用步骤说明.zip
- JAVA实现Modbus RTU或Modbus TCPIP案例.zip
- 基于yolov8+streamlit的火灾检测部署源码+模型.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功