mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-10 11:59:50 +08:00
flaky pnp test
This commit is contained in:
@@ -200,18 +200,21 @@ static Transform computeRegistrationRobust(
|
|||||||
RegistrationInfo * infoOut = nullptr)
|
RegistrationInfo * infoOut = nullptr)
|
||||||
{
|
{
|
||||||
const int estimationType = std::atoi(params.at(Parameters::kVisEstimationType()).c_str());
|
const int estimationType = std::atoi(params.at(Parameters::kVisEstimationType()).c_str());
|
||||||
const int maxAttempts = estimationType == 2 ? 50 : 1;
|
// Epipolar (type=2) is the most RANSAC-sensitive so it gets the biggest
|
||||||
|
// attempt budget; PnP (type=1) also uses RANSAC internally via
|
||||||
|
// cv::solvePnPRansac and has been observed to fail one-shot on CI's
|
||||||
|
// Ubuntu OpenCV build, so retry it too. F2F (type=0) is largely
|
||||||
|
// deterministic but cheap, so we still seed and retry a few times for
|
||||||
|
// uniformity.
|
||||||
|
const int maxAttempts = estimationType == 2 ? 50 : 10;
|
||||||
Transform result;
|
Transform result;
|
||||||
RegistrationInfo info;
|
RegistrationInfo info;
|
||||||
for(int attempt = 0; attempt < maxAttempts; ++attempt)
|
for(int attempt = 0; attempt < maxAttempts; ++attempt)
|
||||||
{
|
{
|
||||||
if(estimationType == 2)
|
cv::theRNG() = cv::RNG(static_cast<uint64_t>(0x9e3779b97f4a7c15ULL) ^
|
||||||
{
|
static_cast<uint64_t>(attempt + 1));
|
||||||
cv::theRNG() = cv::RNG(static_cast<uint64_t>(0x9e3779b97f4a7c15ULL) ^
|
|
||||||
static_cast<uint64_t>(attempt + 1));
|
|
||||||
}
|
|
||||||
result = computeRegistration(fromData, toData, params, &info);
|
result = computeRegistration(fromData, toData, params, &info);
|
||||||
if(!result.isNull() || estimationType != 2)
|
if(!result.isNull())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user