private void cyclicConsistency ( ) { for ( int i = 0 ; i < detector . getNumberOfSets ( ) ; i ++ ) { FastQueue < Point2D_F64 > obs0 = featsLeft0 . location [ i ] ; FastQueue < Point2D_F64 > obs1 = featsRight0 . location [ i ] ; FastQueue < Point2D_F64 > obs2 = featsLeft1 . location [ i ] ; FastQueue < Point2D_F64 > obs3 = featsRight1 . location [ i ] ; SetMatches matches = setMatches [ i ] ; if ( matches . match0to1 . size != matches . match0to2 . size ) throw new RuntimeException ( "Failed sanity check" ) ; for ( int j = 0 ; j < matches . match0to1 . size ; j ++ ) { int indexIn1 = matches . match0to1 . data [ j ] ; int indexIn2 = matches . match0to2 . data [ j ] ; if ( indexIn1 < 0 || indexIn2 < 0 ) continue ; int indexIn3a = matches . match1to3 . data [ indexIn1 ] ; int indexIn3b = matches . match2to3 . data [ indexIn2 ] ; if ( indexIn3a < 0 || indexIn3b < 0 ) continue ; // consistent association to new right camera image if ( indexIn3a == indexIn3b ) { QuadView v = quadViews . grow ( ) ; v . v0 = obs0 . get ( j ) ; v . v1 = obs1 . get ( indexIn1 ) ; v . v2 = obs2 . get ( indexIn2 ) ; v . v3 = obs3 . get ( indexIn3a ) ; } } } }
Create a list of features which have a consistent cycle of matches 0 - > 1 - > 3 and 0 - > 2 - > 3