18 const std::multimap<double, mrpt::tfest::TMatchingPair>& sorted,
24 if (sorted.empty())
return;
26 const double largestError = sorted.rbegin()->first;
27 const double threshold = largestError * ratio;
29 for (
auto it = sorted.rbegin(); it != sorted.rend(); ++it)
31 const double err = it->first;
33 if (err < threshold && out.
paired_pt2pt.size() >= 3)
break;
47 const double ratio = 0.25;
48 std::multimap<double, mrpt::tfest::TMatchingPair> sortedOut;
55 const auto pt_g = relPose.composePoint(p.pt_local);
56 const auto& pl = p.pl_global.plane;
58 const auto plNormal = pl.getNormalVector();
60 ASSERT_NEAR_(plNormal.norm(), 1.0, 1e-4);
63 const double d = pl.evaluatePoint(pt_g);
65 const mrpt::math::TPoint3D c = pt_g - (plNormal * d);
67 mrpt::tfest::TMatchingPair new_p;
73 new_p.local = p.pt_local;
75 sortedOut.insert({std::abs(d), new_p});
86 const auto pt_g = relPose.composePoint(p.pt_local);
87 const auto& ln = p.ln_global;
89 const mrpt::math::TPoint3D c = ln.closestPointTo(pt_g);
90 const double d = (c - pt_g).norm();
92 mrpt::tfest::TMatchingPair new_p;
98 new_p.local = p.pt_local;
100 sortedOut.insert({std::abs(d), new_p});
std::optional< mrpt::poses::CPose3D > guessRelativePose
static void append_from_sorted(const std::multimap< double, mrpt::tfest::TMatchingPair > &sorted, Pairings &out, const double ratio)
MatchedPointLineList paired_pt2ln
Pairings pt2ln_pl_to_pt2pt(const Pairings &in, const SolverContext &sc)
mrpt::tfest::TMatchingPairList paired_pt2pt
MatchedPointPlaneList paired_pt2pl