void markSeenAsFalse ( FastQueue < ChessboardCorner > corners0 , FastQueue < ChessboardCorner > corners1 ) { nn . setPoints ( corners1 . toList ( ) , false ) ; // radius of the blob in the intensity image is 2*kernelRadius int radius = detector . shiRadius * 2 + 1 ; for ( int i = 0 ; i < corners0 . size ; i ++ ) { ChessboardCorner c0 = corners0 . get ( i ) ; nnSearch . findNearest ( c0 , radius , 5 , nnResults ) ; // TODO does it ever find multiple matches? // Could make this smarter by looking at the orientation too for ( int j = 0 ; j < nnResults . size ; j ++ ) { ChessboardCorner c1 = nnResults . get ( j ) . point ; // if the current one wasn't first then none of its children can be first if ( ! c0 . first ) { c1 . first = false ; } else if ( c1 . intensity < c0 . intensity ) { // keeping the one with the best intensity score seems to help. Formally test this idea c1 . first = false ; } else { c0 . first = false ; } } } }
Finds corners in list 1 which match corners in list 0 . If the feature in list 0 has already been seen then the feature in list 1 will be marked as seen . Otherwise the feature which is the most intense is marked as first .