protected void createEdge ( String src , String dst , FastQueue < AssociatedPair > pairs , FastQueue < AssociatedIndex > matches ) { // Fitting Essential/Fundamental works when the scene is not planar and not pure rotation int countF = 0 ; if ( ransac3D . process ( pairs . toList ( ) ) ) { countF = ransac3D . getMatchSet ( ) . size ( ) ; } // Fitting homography will work when all or part of the scene is planar or motion is pure rotation int countH = 0 ; if ( ransacH . process ( pairs . toList ( ) ) ) { countH = ransacH . getMatchSet ( ) . size ( ) ; } // fail if not enough features are remaining after RANSAC if ( Math . max ( countF , countH ) < minimumInliers ) return ; // The idea here is that if the number features for F is greater than H then it's a 3D scene. // If they are similar then it might be a plane boolean is3D = countF > countH * ratio3D ; PairwiseImageGraph2 . Motion edge = graph . edges . grow ( ) ; edge . is3D = is3D ; edge . countF = countF ; edge . countH = countH ; edge . index = graph . edges . size - 1 ; edge . src = graph . lookupNode ( src ) ; edge . dst = graph . lookupNode ( dst ) ; edge . src . connections . add ( edge ) ; edge . dst . connections . add ( edge ) ; if ( is3D ) { saveInlierMatches ( ransac3D , matches , edge ) ; edge . F . set ( ransac3D . getModelParameters ( ) ) ; } else { saveInlierMatches ( ransacH , matches , edge ) ; Homography2D_F64 H = ransacH . getModelParameters ( ) ; ConvertDMatrixStruct . convert ( H , edge . F ) ; } }
Connects two views together if they meet a minimal set of geometric requirements . Determines if there is strong evidence that there is 3D information present and not just a homography