private void apply_filter_twice(KpmImage dst, KpmImage src) { KpmImage tmp = new KpmImage(src.getWidth(), src.getHeight()); apply_filter(tmp, src); apply_filter(dst, tmp); }
/** * Compute the difference image. * * d = im1 - im2 */ public void difference_image_binomial(KpmImage im1, KpmImage im2) { // Compute diff double[] p0 = (double[])this.getBuffer(); double[] p1 = (double[])im1.getBuffer(); double[] p2 = (double[])im2.getBuffer(); for (int i = im1.getWidth() * im1.getHeight() - 1; i >= 0; i--) { p0[i] = p1[i] - p2[i]; } return; }
/** * Sample a receptor given (x,y,octave,scale) and a pyramid. */ private double SampleReceptor(GaussianScaleSpacePyramid pyramid, double x, double y, int octave, int scale) { // Get the correct image from the pyramid KpmImage image = pyramid.get(octave, scale); double a = 1.0f / (1 << octave); double b = 0.5f * a - 0.5f; return(image.bilinearInterpolation(ClipScalar(x * a + b, 0, image.getWidth() - 2), ClipScalar(y * a + b, 0, image.getHeight() - 2))); }
private void apply_filter(KpmImage dst, KpmImage src) { binomial_4th_order( (double[])dst.getBuffer(), this.mTemp_f32_1, (double[])src.getBuffer(), src.getWidth(), src.getHeight()); }