final Point p1 = new Point(); p1.x=(int) x; //x co-ordinate where the user touches on the screen p1.y=(int) y; //y co-ordinate where the user touches on the screen FloodFill f= new FloodFill(); f.floodFill(bmp,pt,targetColor,replacementColor);
@Override public void analyseImage(I image) { flooded = floodFill((Image<?, ?>) image, startPixel, threshold); }
@Override public void analyseImage(I image) { flooded = floodFill((Image<?, ?>) image, startPixel, 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); }
/** * 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); } }
protected Void doInBackground(Void... params) { FloodFill f= new FloodFill(); f.floodFill(bmp,pt,targetColor,replacementColor); return null;
protected Void doInBackground(Void... params) { FloodFill f= new FloodFill(); f.floodFill(bmp,pt,targetColor,replacementColor); return null;
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); } }