code: public boolean process(EllipseRotated_F64 input, EllipseRotated_F64 refined) {
  
  		refined.set(input);
  		previous.set(input);
  
  		for (int iteration = 0; iteration < maxIterations; iteration++) {
  			refined.set(previous);
  			computePointsAndWeights(refined);
  
  			if( fitter.process(samplePts.toList(),weights.data) ) {
  				// Get the results in local coordinates
  				UtilEllipse_F64.convert(fitter.getEllipse(),refined);
  				// convert back into image coordinates
  				double scale = previous.a;
  				refined.center.x = refined.center.x*scale + previous.center.x;
  				refined.center.y = refined.center.y*scale + previous.center.y;
  				refined.a *= scale;
  				refined.b *= scale;
  			} else {
  				return false;
  			}
  
  			// stop once the change between two iterations is insignificant
  			if( change(previous,refined) <= convergenceTol) {
  				return true;
  			} else {
  				previous.set(refined);
  			}
  		}
  		return true;
  	}
docs: Refines provided list by snapping it to edges found in the image
  
  @param input (Output) Close approximation of the ellipse in the image
  @param refined (Output) Storage for refined estimate.  Can be same instance as input
  @return True if a refined estimate could be found, false if it failed