private Detection lookupDetection ( long found , int gridIndex ) { for ( int i = 0 ; i < detections . size ( ) ; i ++ ) { Detection d = detections . get ( i ) ; if ( d . id == found ) { return d ; } } Detection d = detections . grow ( ) ; d . reset ( ) ; d . id = found ; d . gridIndex = gridIndex ; return d ; }
Looks up a detection given the fiducial ID number . If not seen before the gridIndex is saved and a new instance returned .