public static String inlierPercent ( VisualOdometry alg ) { if ( ! ( alg instanceof AccessPointTracks3D ) ) return "" ; AccessPointTracks3D access = ( AccessPointTracks3D ) alg ; int count = 0 ; int N = access . getAllTracks ( ) . size ( ) ; for ( int i = 0 ; i < N ; i ++ ) { if ( access . isInlier ( i ) ) count ++ ; } return String . format ( "%%%5.3f" , 100.0 * count / N ) ; }
If the algorithm implements AccessPointTracks3D then count the number of inlier features and return a string .