mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-01 17:10:26 +08:00
3D->3D estimation refining: using 3x sqrt(variance) instead of sqrt(9x variance). GUI: added features cloud rendering option. CloudViewer: fixed slow updateCameraTargetPosition()
This commit is contained in:
@@ -52,6 +52,27 @@ public:
|
||||
distanceTravelled(0.0f),
|
||||
type(0)
|
||||
{}
|
||||
|
||||
OdometryInfo copyWithoutData() const
|
||||
{
|
||||
OdometryInfo output;
|
||||
output.lost = lost;
|
||||
output.matches = matches;
|
||||
output.inliers = inliers;
|
||||
output.icpInliersRatio = icpInliersRatio;
|
||||
output.variance = variance;
|
||||
output.features = features;
|
||||
output.localMapSize = localMapSize;
|
||||
output.timeEstimation = timeEstimation;
|
||||
output.timeParticleFiltering = timeParticleFiltering;
|
||||
output.stamp = stamp;
|
||||
output.transform = transform;
|
||||
output.transformFiltered = transformFiltered;
|
||||
output.transformGroundTruth = transformGroundTruth;
|
||||
output.distanceTravelled = distanceTravelled;
|
||||
return output;
|
||||
}
|
||||
|
||||
bool lost;
|
||||
int matches;
|
||||
int inliers;
|
||||
|
||||
@@ -382,7 +382,7 @@ class RTABMAP_EXP Parameters
|
||||
RTABMAP_PARAM(Vis, EstimationType, int, 0, "Motion estimation approach: 0:3D->3D, 1:3D->2D (PnP), 2:2D->2D (Epipolar Geometry)");
|
||||
RTABMAP_PARAM(Vis, ForwardEstOnly, bool, true, "Forward estimation only (A->B). If false, a transformation is also computed in backward direction (B->A), then the two resulting transforms are merged (middle interpolation between the transforms).");
|
||||
RTABMAP_PARAM(Vis, InlierDistance, float, 0.1, "[Vis/EstimationType = 0] Maximum distance for feature correspondences. Used by 3D->3D estimation approach.");
|
||||
RTABMAP_PARAM(Vis, RefineIterations, int, 10, "[Vis/EstimationType = 0] Number of iterations used to refine the transformation found by RANSAC. 0 means that the transformation is not refined.");
|
||||
RTABMAP_PARAM(Vis, RefineIterations, int, 5, "[Vis/EstimationType = 0] Number of iterations used to refine the transformation found by RANSAC. 0 means that the transformation is not refined.");
|
||||
RTABMAP_PARAM(Vis, PnPReprojError, float, 2.0, "[Vis/EstimationType = 1] PnP reprojection error.");
|
||||
RTABMAP_PARAM(Vis, PnPFlags, int, 1, "[Vis/EstimationType = 1] PnP flags: 0=Iterative, 1=EPNP, 2=P3P");
|
||||
#ifdef RTABMAP_OPENCV3
|
||||
|
||||
@@ -1777,7 +1777,6 @@ void DBDriverSqlite3::loadSignaturesQuery(const std::list<int> & ids, std::list<
|
||||
UFATAL("Wrong format of the Data.calibration field (size=%d bytes)", dataSize);
|
||||
}
|
||||
|
||||
UWARN("Set %d models to %d", models.size(), (*iter)->id());
|
||||
(*iter)->sensorData().setCameraModels(models);
|
||||
(*iter)->sensorData().setStereoCameraModel(stereoModel);
|
||||
}
|
||||
|
||||
@@ -335,6 +335,7 @@ Transform OdometryF2M::computeTransform(
|
||||
{
|
||||
info->wordMatches = regInfo.matchesIDs;
|
||||
info->wordInliers = regInfo.inliersIDs;
|
||||
info->localMap = uMultimapToMap(map_->getWords3());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -793,11 +793,14 @@ Transform RegistrationVis::computeTransformationImpl(
|
||||
else if(descriptorsFrom.rows)
|
||||
{
|
||||
//just create fake words
|
||||
UASSERT(int(kptsFrom.size()) == descriptorsFrom.rows);
|
||||
UASSERT(words3From.empty() || kptsFrom.size() == words3From.size());
|
||||
for(unsigned int i=0; i<kptsFrom.size(); ++i)
|
||||
UASSERT(kptsFrom.empty() || int(kptsFrom.size()) == descriptorsFrom.rows);
|
||||
UASSERT(kptsFrom3D.empty() || int(kptsFrom3D.size()) == descriptorsFrom.rows);
|
||||
for(int i=0; i<descriptorsFrom.rows; ++i)
|
||||
{
|
||||
wordsFrom.insert(std::make_pair(i, kptsFrom[i]));
|
||||
if(kptsFrom.size())
|
||||
{
|
||||
wordsFrom.insert(std::make_pair(i, kptsFrom[i]));
|
||||
}
|
||||
wordsDescFrom.insert(std::make_pair(i, descriptorsFrom.row(i)));
|
||||
if(kptsFrom3D.size())
|
||||
{
|
||||
|
||||
@@ -112,9 +112,7 @@ Transform transformFromXYZCorrespondences(
|
||||
|
||||
if (refineIterations>0)
|
||||
{
|
||||
double inlier_distance_threshold_sqr = inlierThreshold * inlierThreshold;
|
||||
double error_threshold = inlierThreshold;
|
||||
double sigma_sqr = refineSigma * refineSigma;
|
||||
int refine_iterations = 0;
|
||||
bool inlier_changed = false, oscillating = false;
|
||||
std::vector<int> new_inliers, prev_inliers = inliers;
|
||||
@@ -143,7 +141,7 @@ Transform transformFromXYZCorrespondences(
|
||||
|
||||
// Estimate the variance and the new threshold
|
||||
double variance = model->computeVariance ();
|
||||
error_threshold = sqrt (std::min (inlier_distance_threshold_sqr, sigma_sqr * variance));
|
||||
error_threshold = std::min (inlierThreshold, refineSigma * sqrt(variance));
|
||||
|
||||
UDEBUG ("RANSAC refineModel: New estimated error threshold: %f (variance=%f) on iteration %d out of %d.",
|
||||
error_threshold, variance, refine_iterations, refineIterations);
|
||||
|
||||
Reference in New Issue
Block a user