code: public static <T extends ImageGray<T>>
  	BinaryEllipseDetector<T> ellipse(@Nullable ConfigEllipseDetector config , Class<T> imageType )
  	{
  		if( config == null )
  			config = new ConfigEllipseDetector();
  
  		config.checkValidity();
  
  		BinaryEllipseDetectorPixel detector = new BinaryEllipseDetectorPixel(config.contourRule);
  		detector.setMaxDistanceFromEllipse(config.maxDistanceFromEllipse);
  		detector.setMaximumContour(config.maximumContour);
  		detector.setMinimumContour(config.minimumContour);
  		detector.setMinimumMinorAxis(config.minimumMinorAxis);
  		detector.setInternalContour(config.processInternal);
  		detector.setMaxMajorToMinorRatio(config.maxMajorToMinorRatio);
  
  		SnapToEllipseEdge<T> refine = new SnapToEllipseEdge<>(config.numSampleContour, config.refineRadialSamples, imageType);
  		refine.setConvergenceTol(config.convergenceTol);
  		refine.setMaxIterations(config.maxIterations);
  
  		if( config.maxIterations <= 0 || config.numSampleContour <= 0 ) {
  			refine = null;
  		}
  
  		EdgeIntensityEllipse<T> check = new EdgeIntensityEllipse<>(
  				config.checkRadialDistance,
  				config.numSampleContour,
  				config.minimumEdgeIntensity, imageType);
  
  		return new BinaryEllipseDetector<>(detector, refine, check, imageType);
  	}
docs: Creates an ellipse detector which will detect all ellipses in the image initially using a binary image and
  then refine the estimate using a subpixel algorithm in the gray scale image.
  
  @param config Configuration for ellipse detector.  null == default
  @param imageType Input image type
  @return Detecto