Java Array Absolute Value absolulteValue(float[][] image)

Here you can find the source of absolulteValue(float[][] image)

Description

Returns an image where all of the values have been absolute valued

License

Open Source License

Parameter

Parameter Description
image the input image

Return

all values absolute valued

Declaration

public static float[][] absolulteValue(float[][] image) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from w w w.  j av  a  2s. co  m
     * Returns an image where all of the values have been absolute valued
     * @param image the input image
     * @return all values absolute valued
     */
    public static float[][] absolulteValue(float[][] image) {
        float[][] out_float_mat = new float[image.length][image[0].length];
        for (int i = 0; i < image.length; i++) {
            for (int j = 0; j < image[0].length; j++) {
                out_float_mat[i][j] = Math.abs(image[i][j]);
            }
        }
        return out_float_mat;
    }
}

Related

  1. absMax(double[] arr)
  2. absMax(double[] data)
  3. absMax(double[] vector)
  4. absMean(double[] arr)
  5. absMean(double[] x)