question: private static Shape bottomEdge ( BufferedImage image , GeneralPath path , int start ) { int lastj = 0 ; Point2D p1 = path . getCurrentPoint ( ) ; Point2D p2 = null ; Line2D line = new Line2D . Float ( ) ; for ( int i = start ; i < image . getWidth ( ) ; i += sample ) { boolean aPointExistsOnThisLine = false ; for ( int j = image . getHeight ( ) - 1 ; j >= 0 ; j -= sample ) { if ( ( image . getRGB ( i , j ) & 0xff000000 ) != 0 ) { Point2D p = new Point2D . Float ( i , j ) ; aPointExistsOnThisLine = true ; p2 = detectLine ( p1 , p2 , p , line , path ) ; lastj = j ; break ; } } if ( aPointExistsOnThisLine == false ) { break ; } } return rightEdge ( image , path , lastj ) ; }
target:  trace the bottom of the image