@Override public void analyseImage(I image) { flooded = floodFill((Image<?, ?>) image, startPixel, threshold); }
if (accept(image, n, initial, threshold) && output.pixels[n.y][n.x] != 1) { while (w > 0 && accept(image, new Pixel(w - 1, n.y), initial, threshold)) w--; while (e < image.getWidth() - 1 && accept(image, new Pixel(e + 1, n.y), initial, threshold)) e++; if (north >= 0 && accept(image, new Pixel(i, north), initial, threshold) && output.pixels[north][i] != 1) queue.add(new Pixel(i, north)); if (south < image.getHeight() && accept(image, new Pixel(i, south), initial, threshold) && output.pixels[south][i] != 1) queue.add(new Pixel(i, south));
@Override public void analyseImage(I image) { flooded = floodFill((Image<?, ?>) image, startPixel, threshold); }
if (accept(image, n, initial, threshold) && output.pixels[n.y][n.x] != 1) { while (w > 0 && accept(image, new Pixel(w - 1, n.y), initial, threshold)) w--; while (e < image.getWidth() - 1 && accept(image, new Pixel(e + 1, n.y), initial, threshold)) e++; if (north >= 0 && accept(image, new Pixel(i, north), initial, threshold) && output.pixels[north][i] != 1) queue.add(new Pixel(i, north)); if (south < image.getHeight() && accept(image, new Pixel(i, south), initial, threshold) && output.pixels[south][i] != 1) queue.add(new Pixel(i, south));
/** * Flood-fill an image from the given starting pixel position with the given * threshold. * * @param <T> * The pixel type of the image * @param image * the image * @param startx * the x-coordinate of the start pixel * @param starty * the y-coordinate of the start pixel * @param threshold * the threshold for determining with a pixel should be filled * @return a binary @link{FImage} with filled pixels from the input set to 1 */ public static <T> FImage floodFill(Image<T, ?> image, int startx, int starty, float threshold) { return floodFill(image, new Pixel(startx, starty), threshold); }
/** * Flood-fill an image from the given starting pixel position with the given * threshold. * * @param <T> * The pixel type of the image * @param image * the image * @param startx * the x-coordinate of the start pixel * @param starty * the y-coordinate of the start pixel * @param threshold * the threshold for determining with a pixel should be filled * @return a binary @link{FImage} with filled pixels from the input set to 1 */ public static <T> FImage floodFill(Image<T, ?> image, int startx, int starty, float threshold) { return floodFill(image, new Pixel(startx, starty), threshold); }
void execute() throws IOException { FImage mask = FloodFill.floodFill(input, px, py, thresh); if (maskoutput != null) ImageUtilities.write(mask, maskoutput.getName().substring(maskoutput.getName().lastIndexOf(".") + 1), maskoutput); if (feature != null) { FeatureVector fv = featureOp.execute(input, mask); if (binary) IOUtils.writeBinary(output, fv); else IOUtils.writeASCII(output, fv); } }
void execute() throws IOException { FImage mask = FloodFill.floodFill(input, px, py, thresh); if (maskoutput != null) ImageUtilities.write(mask, maskoutput.getName().substring(maskoutput.getName().lastIndexOf(".") + 1), maskoutput); if (feature != null) { FeatureVector fv = featureOp.execute(input, mask); if (binary) IOUtils.writeBinary(output, fv); else IOUtils.writeASCII(output, fv); } }
double execute() { FImage mask1 = FloodFill.floodFill(im1, px1, py1, thresh1); FImage mask2 = FloodFill.floodFill(im2, px2, py2, thresh2); FeatureVector fv1 = featureOp.execute(im1, mask1); FeatureVector fv2 = featureOp.execute(im2, mask2); if (compare == FeatureComparison.EQUALS) { if (Arrays.equals(fv1.asDoubleVector(), fv2.asDoubleVector())) return 1; return 0; } else { return getComp(fv1, compare).compare(fv1, fv2); } }
double execute() { FImage mask1 = FloodFill.floodFill(im1, px1, py1, thresh1); FImage mask2 = FloodFill.floodFill(im2, px2, py2, thresh2); FeatureVector fv1 = featureOp.execute(im1, mask1); FeatureVector fv2 = featureOp.execute(im2, mask2); if (compare == FeatureComparison.EQUALS) { if (Arrays.equals(fv1.asDoubleVector(), fv2.asDoubleVector())) return 1; return 0; } else { return getComp(fv1, compare).compare(fv1, fv2); } }