private void fitEllipse(){ if(fittedEllipse==null){ fittedEllipse = new EllipseFitter(); Rectangle r = outerContour.getBounds(); ImagePlus help = NewImage.createByteImage("", r.width+1, r.height+1, 1, NewImage.FILL_WHITE); ByteProcessor ip = (ByteProcessor) help.getProcessor(); ip.setColor(Color.black); Polygon p = new Polygon(outerContour.xpoints, outerContour.ypoints, outerContour.npoints); p.translate(-r.x, -r.y); ip.resetRoi(); ip.setRoi(p); fittedEllipse.fit(ip, null); } }
ef = new EllipseFitter(); ef.fit(ip, this); if (limitToThreshold) {
ef = new EllipseFitter(); ef.fit(ip, this); if (limitToThreshold) {