gpt4 book ai didi

c++ - 在 pcl 注册方法中获取不被对应距离拒绝的内点。

转载 作者:太空狗 更新时间:2023-10-29 20:40:25 26 4
gpt4 key购买 nike

我正在使用 iterative closest pointpcl 实现。我希望能够使用我使用的任何注册方法中的内点。

registration 类可以在调用对齐函数时输出对齐的云:

icp_.align(outcloud, guess);

PCLBase 类具有以下功能:

indices = icp_.getIndices();

不幸的是,getIndices 只返回整个云的索引。我在云上进行了测试,被距离对应拒绝的异常值(或内点)似乎无法检索?

我已经检查过,云中有应该被拒绝的点,见下图:

enter image description here

最佳答案

基于 D.J.Duff 的回答,这是一种获得相应点的方法,尽管它涉及违反类(class)。这个继承自 IterativeClosestPointNonLinear 类,可以作为替代。对于我的用例,我只是将它放在我想使用 IterativeClosestPointNonLinear 并能够访问 correspondences_ 成员的任何地方。类似的方法可用于任何其他注册界面。

/** \brief This is a mock class with the sole purpose of accessing a protected member of a class it inherits from.
*
* Some of the relevant documentation for correspondences: http://docs.pointclouds.org/trunk/correspondence_8h_source.html#l00092
*/
template <typename PointSource, typename PointTarget, typename Scalar = float>
class IterativeClosestPointNonLinear_Exposed : public pcl::IterativeClosestPointNonLinear<PointSource, PointTarget, Scalar> {
public:
pcl::CorrespondencesPtr getCorrespondencesPtr() {
for (uint32_t i = 0; i < this->correspondences_->size(); i++) {
pcl::Correspondence currentCorrespondence = (*this->correspondences_)[i];
std::cout << "Index of the source point: " << currentCorrespondence.index_query << std::endl;
std::cout << "Index of the matching target point: " << currentCorrespondence.index_match << std::endl;
std::cout << "Distance between the corresponding points: " << currentCorrespondence.distance << std::endl;
std::cout << "Weight of the confidence in the correspondence: " << currentCorrespondence.weight << std::endl;
}
return this->correspondences_;
}
};

下面是通过这种方式得到的两个点云之间的对应点之间绘制的一些线。值得注意的是,两点之间的 pcl::Correspondence.distance 值似乎并不总是严格小于注册方法的 maxCorrespondenceDistance 的值,因此您可能必须检查距离以确保您只获得所需的通信。

Point correspondences between two clouds.

关于c++ - 在 pcl 注册方法中获取不被对应距离拒绝的内点。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24237760/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com