roi.ypoints[i] -= bounds.y; PolygonFiller pf = new PolygonFiller(); pf.setPolygon(roi.xpoints, roi.ypoints, roi.npoints); ImageProcessor mask = pf.getMask(bounds.width, bounds.height);
private void fillPolygon(ImageProcessor ip, Polygon p, boolean internContour) { PolygonRoi proi = new PolygonRoi(p, PolygonRoi.POLYGON); Rectangle r = proi.getBounds(); PolygonFiller pf = new PolygonFiller(); pf.setPolygon(proi.getXCoordinates(), proi.getYCoordinates(), proi.getNCoordinates()); ip.setRoi(r); ImageProcessor objectMask = pf.getMask(r.width, r.height); ip.fill(objectMask); if(!internContour){ ip.drawPolygon(p); } }
roi.ypoints[i] -= bounds.y; PolygonFiller pf = new PolygonFiller(); pf.setPolygon(roi.xpoints, roi.ypoints, roi.npoints); ImageProcessor mask = pf.getMask(bounds.width, bounds.height);
public ImageProcessor getMask() { if (cachedMask!=null && cachedMask.getPixels()!=null && cachedMask.getWidth()==width && cachedMask.getHeight()==height) return cachedMask; PolygonFiller pf = new PolygonFiller(); if (xSpline!=null) pf.setPolygon(toIntR(xSpline), toIntR(ySpline), splinePoints); else if (xpf!=null) pf.setPolygon(toIntR(xpf), toIntR(ypf), nPoints); else pf.setPolygon(xp, yp, nPoints); cachedMask = pf.getMask(width, height); return cachedMask; }
public ImageProcessor getMask() { if (cachedMask!=null && cachedMask.getPixels()!=null && cachedMask.getWidth()==width && cachedMask.getHeight()==height) return cachedMask; PolygonFiller pf = new PolygonFiller(); if (xSpline!=null) pf.setPolygon(toIntR(xSpline), toIntR(ySpline), splinePoints); else if (xpf!=null) pf.setPolygon(toIntR(xpf), toIntR(ypf), nPoints); else pf.setPolygon(xp, yp, nPoints); cachedMask = pf.getMask(width, height); return cachedMask; }
particleCount = 0; wand = new Wand(ip); pf = new PolygonFiller(); if (floodFill) { ImageProcessor ipf = ip.duplicate();
particleCount = 0; wand = new Wand(ip); pf = new PolygonFiller(); if (floodFill) { ImageProcessor ipf = ip.duplicate();