-
Notifications
You must be signed in to change notification settings - Fork 907
OptimizerG2O::optimizeBA(): should we track edge outliers instead of 3D point outliers? #1652
Copy link
Copy link
Open
Description
I think here we should track 2D edge outliers instead of 3D points. Only when the 3D points with all 2D references as outliers would be reset to its original position. optimizeBA() would return not a list of 3D points outliers, but a corresponding list of 2D outliers (matching the wordReferences map instead)
rtabmap/corelib/src/optimizer/OptimizerG2O.cpp
Lines 1962 to 2000 in b47c409
| if((*iter)->level() == 0 && (*iter)->chi2() > (*iter)->robustKernel()->delta()) | |
| { | |
| (*iter)->setLevel(1); | |
| ++outliersCount; | |
| double d = 0.0; | |
| #ifdef RTABMAP_ORB_SLAM | |
| if(dynamic_cast<g2o::EdgeStereoSE3ProjectXYZ*>(*iter) != 0) | |
| { | |
| d = ((g2o::EdgeStereoSE3ProjectXYZ*)(*iter))->measurement()[0]-((g2o::EdgeStereoSE3ProjectXYZ*)(*iter))->measurement()[2]; | |
| } | |
| //UDEBUG("Ignoring edge (%d<->%d) d=%f var=%f kernel=%f chi2=%f", (*iter)->vertex(0)->id()-stepVertexId, (*iter)->vertex(1)->id(), d, 1.0/((g2o::EdgeStereoSE3ProjectXYZ*)(*iter))->information()(0,0), (*iter)->robustKernel()->delta(), (*iter)->chi2()); | |
| #else | |
| if(dynamic_cast<g2o::EdgeProjectP2SC*>(*iter) != 0) | |
| { | |
| d = ((g2o::EdgeProjectP2SC*)(*iter))->measurement()[0]-((g2o::EdgeProjectP2SC*)(*iter))->measurement()[2]; | |
| } | |
| //UDEBUG("Ignoring edge (%d<->%d) d=%f var=%f kernel=%f chi2=%f", (*iter)->vertex(0)->id()-stepVertexId, (*iter)->vertex(1)->id(), d, 1.0/((g2o::EdgeProjectP2SC*)(*iter))->information()(0,0), (*iter)->robustKernel()->delta(), (*iter)->chi2()); | |
| #endif | |
| cv::Point3f pt3d; | |
| if((*iter)->vertex(0)->id() > negVertexOffset) | |
| { | |
| pt3d = points3DMap.at(negVertexOffset - (*iter)->vertex(0)->id()); | |
| } | |
| else | |
| { | |
| pt3d = points3DMap.at((*iter)->vertex(0)->id()-stepVertexId); | |
| } | |
| ((g2o::VertexSBAPointXYZ*)(*iter)->vertex(0))->setEstimate(Eigen::Vector3d(pt3d.x, pt3d.y, pt3d.z)); | |
| if(outliers) | |
| { | |
| outliers->insert((*iter)->vertex(0)->id()-stepVertexId); | |
| } | |
| if(d < 5.0) | |
| { | |
| outliersCountFar++; | |
| } | |
| } |
Ref: http://official-rtab-map-forum.206.s1.nabble.com/RTAB-Map-and-COLMAP-tp9344p11536.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels