private void updateGUI ( SimpleImageSequence < T > sequence ) { BufferedImage orig = sequence . getGuiImage ( ) ; Graphics2D g2 = orig . createGraphics ( ) ; // draw tracks with semi-unique colors so you can track individual points with your eyes for ( PointTrack p : tracker . getActiveTracks ( null ) ) { int red = ( int ) ( 2.5 * ( p . featureId % 100 ) ) ; int green = ( int ) ( ( 255.0 / 150.0 ) * ( p . featureId % 150 ) ) ; int blue = ( int ) ( p . featureId % 255 ) ; VisualizeFeatures . drawPoint ( g2 , ( int ) p . x , ( int ) p . y , new Color ( red , green , blue ) ) ; } // draw tracks which have just been spawned green for ( PointTrack p : tracker . getNewTracks ( null ) ) { VisualizeFeatures . drawPoint ( g2 , ( int ) p . x , ( int ) p . y , Color . green ) ; } // tell the GUI to update gui . setImage ( orig ) ; gui . repaint ( ) ; }
Draw tracked features in blue or red if they were just spawned .