/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayS8 input , GrayS8 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayS16 input , GrayS16 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedS8 input , InterleavedS8 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedS32 input , InterleavedS32 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayS32 input , GrayS32 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedF64 input , InterleavedF64 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedS16 input , InterleavedS16 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayF32 input , GrayF32 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedF32 input , InterleavedF32 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayF64 input , GrayF64 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs(GrayS64 input , GrayS64 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
/** * Sets each pixel in the output image to be the absolute value of the input image. * Both the input and output image can be the same instance. * * @param input The input image. Not modified. * @param output Where the absolute value image is written to. Modified. */ public static void abs( InterleavedS64 input , InterleavedS64 output ) { InputSanityCheck.checkSameShape(input,output); int columns = input.width*input.numBands; abs(input.data,input.startIndex,input.stride, output.data,output.startIndex,output.stride, input.height,columns); }
PixelMath.abs((GrayS8) input, (GrayS8) output); } else if (GrayS16.class == input.getClass()) { PixelMath.abs((GrayS16) input, (GrayS16) output); } else if (GrayS32.class == input.getClass()) { PixelMath.abs((GrayS32) input, (GrayS32) output); } else if (GrayS64.class == input.getClass()) { PixelMath.abs((GrayS64) input, (GrayS64) output); } else if (GrayF32.class == input.getClass()) { PixelMath.abs((GrayF32) input, (GrayF32) output); } else if (GrayF64.class == input.getClass()) { PixelMath.abs((GrayF64) input, (GrayF64) output); PixelMath.abs((InterleavedS8) input, (InterleavedS8) output); } else if (InterleavedS16.class == input.getClass()) { PixelMath.abs((InterleavedS16) input, (InterleavedS16) output); } else if (InterleavedS32.class == input.getClass()) { PixelMath.abs((InterleavedS32) input, (InterleavedS32) output); } else if (InterleavedS64.class == input.getClass()) { PixelMath.abs((InterleavedS64) input, (InterleavedS64) output); } else if (InterleavedF32.class == input.getClass()) { PixelMath.abs((InterleavedF32) input, (InterleavedF32) output); } else if (InterleavedF64.class == input.getClass()) { PixelMath.abs((InterleavedF64) input, (InterleavedF64) output);
private double computeEdgeMSE(GrayF32 imageInv) { GrayF32 edge = new GrayF32(imageInv.width,imageInv.height); LaplacianEdge.process(image,edge); PixelMath.abs(edge,edge); float max = ImageStatistics.maxAbs(edge); PixelMath.divide(edge,max,edge); float total = ImageStatistics.sum(edge); double error = 0; for( int y = 0; y < image.height; y++ ) { for( int x = 0; x < image.width; x++ ) { double w = edge.get(x,y)/total; double e = (image.get(x,y)-imageInv.get(x,y)); error += (e*e)*w; } } return error; }