@Override public PixelsFeature clone() { return (PixelsFeature) super.clone(); } }
@Override public PixelsFeature clone() { return (PixelsFeature) super.clone(); } }
/** * Process this connected component with the given * {@link ConnectedComponentProcessor} and returns a new component * containing the result. * * @param p * The processor to process this component with * @return A new component containing the result. */ public ConnectedComponent process(ConnectedComponentProcessor p) { final ConnectedComponent tmp = clone(); p.process(tmp); return tmp; }
/** * Process this connected component with the given * {@link ConnectedComponentProcessor} and returns a new component * containing the result. * * @param p * The processor to process this component with * @return A new component containing the result. */ public ConnectedComponent process(ConnectedComponentProcessor p) { final ConnectedComponent tmp = clone(); p.process(tmp); return tmp; }
/** * Render a connected component with a given grey level and display it * * @param input * the connected component * @param col * the grey level * @return frame containing the rendered image */ public static JFrame display(final ConnectedComponent input, final float col) { final ConnectedComponent cc = input.clone(); final Rectangle bb = cc.calculateRegularBoundingBox(); // Render the mask, leaving a 10 px border cc.translate(10 - (int) bb.x, 10 - (int) bb.y); final FImage mask = new FImage((int) Math.max(bb.width + 20, 100), (int) Math.max(bb.height + 20, 100)); final BlobRenderer<Float> br = new BlobRenderer<Float>(mask, 1.0F); cc.process(br); return DisplayUtilities.display(mask); }
/** * Render a connected component with a given grey level and display it * * @param input * the connected component * @param col * the grey level * @return frame containing the rendered image */ public static JFrame display(final ConnectedComponent input, final float col) { final ConnectedComponent cc = input.clone(); final Rectangle bb = cc.calculateRegularBoundingBox(); // Render the mask, leaving a 10 px border cc.translate(10 - (int) bb.x, 10 - (int) bb.y); final FImage mask = new FImage((int) Math.max(bb.width + 20, 100), (int) Math.max(bb.height + 20, 100)); final BlobRenderer<Float> br = new BlobRenderer<Float>(mask, 1.0F); cc.process(br); return DisplayUtilities.display(mask); }