Beispiel #1
0
 float[] smooth(float[] a, int n) {
   FloatProcessor fp = new FloatProcessor(n, 1);
   for (int i = 0; i < n; i++) fp.setf(i, 0, a[i]);
   GaussianBlur gb = new GaussianBlur();
   gb.blur1Direction(fp, 2.0, 0.01, true, 0);
   for (int i = 0; i < n; i++) a[i] = fp.getf(i, 0);
   return a;
 }
Beispiel #2
0
 int[] smooth(int[] a, int n) {
   FloatProcessor fp = new FloatProcessor(n, 1);
   for (int i = 0; i < n; i++) fp.putPixelValue(i, 0, a[i]);
   GaussianBlur gb = new GaussianBlur();
   gb.blur1Direction(fp, 2.0, 0.01, true, 0);
   for (int i = 0; i < n; i++) a[i] = (int) Math.round(fp.getPixelValue(i, 0));
   return a;
 }