code: public static void fitCannyEdges( GrayF32 input ) {
  
  		BufferedImage displayImage = new BufferedImage(input.width,input.height,BufferedImage.TYPE_INT_RGB);
  
  		// Finds edges inside the image
  		CannyEdge<GrayF32,GrayF32> canny =
  				FactoryEdgeDetectors.canny(2, true, true, GrayF32.class, GrayF32.class);
  
  		canny.process(input,0.1f,0.3f,null);
  		List<EdgeContour> contours = canny.getContours();
  
  		Graphics2D g2 = displayImage.createGraphics();
  		g2.setStroke(new BasicStroke(2));
  
  		// used to select colors for each line
  		Random rand = new Random(234);
  
  		for( EdgeContour e : contours ) {
  			g2.setColor(new Color(rand.nextInt()));
  
  			for(EdgeSegment s : e.segments ) {
  				// fit line segments to the point sequence.  Note that loop is false
  				List<PointIndex_I32> vertexes = ShapeFittingOps.fitPolygon(s.points,false, minSide,cornerPenalty);
  
  				VisualizeShapes.drawPolygon(vertexes, false, g2);
  			}
  		}
  
  		gui.addImage(displayImage, "Canny Trace");
  	}
docs: Fits a sequence of line-segments into a sequence of points found using the Canny edge detector.  In this case
  the points are not connected in a loop. The canny detector produces a more complex tree and the fitted
  points can be a bit noisy compared to the others.