/** * Binarizes the {@linkplain #image}. If the image is multi-bands, then this method first * computes an estimation of its {@linkplain #intensity intensity}. Then, the threshold value is * set halfway between the minimal and maximal values found in the image. * * @return this {@link ImageWorker}. * @see #isBinary * @see #binarize(double) * @see #binarize(int,int) * @see BinarizeDescriptor */ public final ImageWorker binarize() { binarize(Double.NaN); // All post conditions for this method contract. assert isBinary(); return this; }
/** * Returns a {@linkplain ROI Region Of Interest} built from the current {@linkplain * #getRenderedImage image}. If the image is multi-bands, then this method first computes an * estimation of its {@linkplain #intensity intensity}. Next, this method {@linkplain * #binarize() binarize} the image and constructs a {@link ROI} from the result. * * @return The image as a region of interest. * @see #getRenderedImage * @see #getPlanarImage * @see #getRenderedOperation */ public final ROI getImageAsROI() { binarize(); return new ROI(getRenderedImage()); }
/** Returns a {@link ROI} object based on the input {@link RenderedImage} representing ROI */ public static ROI scaleROI(RenderedImage roiRaster, Rectangle bounds) { if (roiRaster == null) { return null; } int x = bounds.x; int y = bounds.y; int w = bounds.width; int h = bounds.height; // Scale factors for input data final double scaleX = w / (1.0 * roiRaster.getWidth()); final double scaleY = h / (1.0 * roiRaster.getHeight()); AffineTransform tr = AffineTransform.getScaleInstance(scaleX, scaleY); // Translation Factors final int transX = x; final int transY = y; tr.concatenate(AffineTransform.getTranslateInstance(transX, transY)); // Log the Scale/Translate operation if (!tr.isIdentity()) { LOGGER.fine("Scaling ROI"); } // Input Mask is scaled to the image size, rescaled to Bytes and then used as ROI return new ImageWorker(roiRaster).affine(tr, null, null).binarize(1).getImageAsROI(); }
binarize(); tileCacheEnabled(true); final LookupTable table;
/** * Binarizes the {@linkplain #image}. If the image is multi-bands, then * this method first computes an estimation of its * {@linkplain #intensity intensity}. Then, the threshold value is set * halfway between the minimal and maximal values found in the image. * * @return this {@link ImageWorker}. * * @see #isBinary * @see #binarize(double) * @see #binarize(int,int) * @see BinarizeDescriptor */ public final ImageWorker binarize() { binarize(Double.NaN); // All post conditions for this method contract. assert isBinary(); return this; }
/** * Binarizes the {@linkplain #image}. If the image is multi-bands, then * this method first computes an estimation of its * {@linkplain #intensity intensity}. Then, the threshold value is set * halfway between the minimal and maximal values found in the image. * * @return this {@link ImageWorker}. * * @see #isBinary * @see #binarize(double) * @see #binarize(int,int) * @see BinarizeDescriptor */ public final ImageWorker binarize() { binarize(Double.NaN); // All post conditions for this method contract. assert isBinary(); return this; }
/** * Returns a {@linkplain ROI Region Of Interest} built from the current * {@linkplain #getRenderedImage image}. If the image is multi-bands, then this method first * computes an estimation of its {@linkplain #intensity intensity}. Next, this method * {@linkplain #binarize() binarize} the image and constructs a {@link ROI} from the result. * * @return The image as a region of interest. * * @see #getRenderedImage * @see #getPlanarImage * @see #getRenderedOperation */ public final ROI getImageAsROI() { binarize(); return new ROI(getRenderedImage()); }
/** * Returns a {@linkplain ROI Region Of Interest} built from the current * {@linkplain #getRenderedImage image}. If the image is multi-bands, then this method first * computes an estimation of its {@linkplain #intensity intensity}. Next, this method * {@linkplain #binarize() binarize} the image and constructs a {@link ROI} from the result. * * @see #getRenderedImage * @see #getPlanarImage * @see #getRenderedOperation */ public final ROI getImageAsROI() { binarize(); return new ROI(getRenderedImage()); }
ImageWorker w = new ImageWorker(image) .setROI(new ROI(new ImageWorker(image).binarize(0).getRenderedImage()));
if (!isBinary()) binarize();
binarize(); tileCacheEnabled(true); final LookupTableJAI table;
binarize(); tileCacheEnabled(true); final LookupTableJAI table;
luImage = BandCombineDescriptor.create(luImage, matrix, hints); if (transparentBand != null) { luImage = fork(luImage).binarize(254) .forceComponentColorModel().retainFirstBand().getPlanarImage(); luImage = MultiplyDescriptor.create(transparentBand, luImage, hints);