int countFeaturesWith3D ( View v ) { int count = 0 ; for ( int i = 0 ; i < v . connections . size ( ) ; i ++ ) { Motion m = v . connections . get ( i ) ; boolean isSrc = m . viewSrc == v ; for ( int j = 0 ; j < m . associated . size ( ) ; j ++ ) { AssociatedIndex a = m . associated . get ( j ) ; if ( isSrc ) { count += m . viewDst . features3D [ a . dst ] != null ? 1 : 0 ; } else { count += m . viewSrc . features3D [ a . src ] != null ? 1 : 0 ; } } } return count ; }
Count how many 3D features are in view .