【问题标题】:PCL feature matching failurePCL 特征匹配失败
【发布时间】:2018-12-19 05:32:48
【问题描述】:

我试图通过更改许多参数来匹配我测试的两个点云之间的特征,但它总是会产生错误的匹配。我正在计算 SIFT 特征的 PFH 特征描述符。

感谢您的建议。

下面是我使用的代码

// load the both point clouds
pcl::io::loadPCDFile("Tee.pcd", *cloud_1);
pcl::PLYReader Reader;
Reader.read("tee.ply", *cloud_2);
//pcl::io::loadPCDFile("Tee.pcd", *cloud_2);

    // Create the filtering object
pcl::PassThrough<pcl::PointXYZRGB> pass;
pass.setInputCloud(cloud_2);
pass.setFilterFieldName("z");
pass.setFilterLimits(0.0, 1.0);
//pass.setFilterLimitsNegative (true);
pass.filter(*cloud_2_filtered);


// Downsample the cloud
const float voxel_grid_leaf_size = 0.009f;
downsample(cloud_1, voxel_grid_leaf_size, downsampledCloud_1);
std::cout << "First cloud: downsampled " << std::endl;
const float voxel_grid_leaf_size2 = 0.003f;
downsample(cloud_2_filtered, voxel_grid_leaf_size2, downsampledCloud_2);
std::cout << "second cloud: downsampled " << std::endl;

// Compute surface normals
const float normal_radius = 0.03;
compute_surface_normals(downsampledCloud_1, normal_radius, normalsFromCloud_1);
compute_surface_normals(downsampledCloud_2, normal_radius, normalsFromCloud_2);
std::cout << "second cloud: normals computed " << std::endl;
// Compute keypoints
const float min_scale = 0.01;
const int nr_octaves = 3;
const int nr_octaves_per_scale = 6;
const float min_contrast = 1.0;
detect_keypoints(cloud_1, min_scale, nr_octaves, nr_octaves_per_scale, min_contrast, keypointsFromCloud_1);
std::cout << "first cloud: keypoints computed " << std::endl;
//const float min_scale1 = 0.1;
detect_keypoints(cloud_2_filtered, min_scale, nr_octaves, nr_octaves_per_scale, min_contrast, keypointsFromCloud_2);
std::cout << "second cloud: keypoints computed " << std::endl;
//visualize_keypoints(cloud_2, keypointsFromCloud_2);

// Compute PFH features
const float feature_radius = 0.08;
compute_PFH_features_at_keypoints(downsampledCloud_1, normalsFromCloud_1, keypointsFromCloud_1, feature_radius, descriptors1);
std::cout << "first cloud: descriptor computed " << std::endl;
compute_PFH_features_at_keypoints(downsampledCloud_2, normalsFromCloud_2, keypointsFromCloud_2, feature_radius, descriptors2);
std::cout << "second cloud: descriptor computed " << std::endl;

// Find feature correspondences
std::vector<int> correspondences;
std::vector<float> correspondence_scores;
find_feature_correspondences(descriptors1, descriptors2, correspondences, correspondence_scores);

// Print out ( number of keypoints / number of points )
std::cout << "First cloud: Found " << keypointsFromCloud_1->size() << " keypoints "
    << "out of " << downsampledCloud_1->size() << " total points." << std::endl;
std::cout << "Second cloud: Found " << keypointsFromCloud_2->size() << " keypoints "
    << "out of " << downsampledCloud_2->size() << " total points." << std::endl;

// Visualize the two point clouds and their feature correspondences
visualize_correspondences(cloud_1, keypointsFromCloud_1, cloud_2_filtered, keypointsFromCloud_2, correspondences, correspondence_scores);

生成的图像如图所示:

【问题讨论】:

    标签: point-cloud-library


    【解决方案1】:

    数据和预处理

    您似乎正在尝试将仅包含对象的点云与对象位于场景内的点云进行匹配。

    为了获得一致且稳健的结果,请事先从场景中提取所有对象,并尝试将引用与所有检测到的对象进行匹配并选择最佳匹配。

    描述符

    我使用 SHOT 描述符而不是 PFH 获得了更好的结果。

    Here您可以阅读 PCL 的作者关于Object Recognition的更多信息,他们描述和解释了整个对象识别管道。

    【讨论】:

    • 感谢您提供的信息。我会尝试拍摄方法。我的目标是估计物体的 3D 姿势,有没有更好的方法来找到它?
    • 是否需要事先从场景中提取所有对象?如果我实时使用它可能无法提取对象
    • 根据我的经验,SHOT 特征是姿势估计中最稳健、最一致的特征。事先从场景中提取所有对象对于获得良好结果至关重要。您可以通过先对输入云进行下采样来加快提取速度,一旦有了对象实例,就可以使用原始分辨率进行姿态估计。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-26
    • 2016-06-19
    • 2017-07-23
    • 2018-04-27
    • 2019-12-22
    • 1970-01-01
    • 2019-08-08
    相关资源
    最近更新 更多