/** * Calculate the sum of the absolute values of a 2D array. * * @param arr * @return the sum absolute values */ public static float sumAbs(float[][] arr) { float sum = 0; for (int i = 0; i < arr.length; i++) sum += sumAbs(arr[i]); return sum; }
protected static FImage normalise(FImage f) { final float mean = FloatArrayStatsUtils.mean(f.pixels); f.subtractInplace(mean); final float sumabs = FloatArrayStatsUtils.sumAbs(f.pixels); return f.divideInplace(sumabs); } }
protected static FImage normalise(FImage f) { final float mean = FloatArrayStatsUtils.mean(f.pixels); f.subtractInplace(mean); final float sumabs = FloatArrayStatsUtils.sumAbs(f.pixels); return f.divideInplace(sumabs); } }