/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( GrayS32 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static float max( InterleavedF32 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( InterleavedS32 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static long max( GrayS64 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( InterleavedS16 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( GrayS16 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static float max( GrayF32 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( GrayS8 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static int max( InterleavedS8 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static long max( InterleavedS64 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static double max( GrayF64 input ) { return max( input.data, input.startIndex, input.height, input.width , input.stride ); }
/** * Returns the maximum element value. * * @param input Input image. Not modified. * @return Maximum pixel value. */ public static double max( InterleavedF64 input ) { return max( input.data, input.startIndex, input.height, input.width*input.numBands , input.stride ); }
if( input instanceof ImageGray) { if (GrayU8.class == input.getClass()) { return ImageStatistics.max((GrayU8) input); } else if (GrayS8.class == input.getClass()) { return ImageStatistics.max((GrayS8) input); } else if (GrayU16.class == input.getClass()) { return ImageStatistics.max((GrayU16) input); } else if (GrayS16.class == input.getClass()) { return ImageStatistics.max((GrayS16) input); } else if (GrayS32.class == input.getClass()) { return ImageStatistics.max((GrayS32) input); } else if (GrayS64.class == input.getClass()) { return ImageStatistics.max((GrayS64) input); } else if (GrayF32.class == input.getClass()) { return ImageStatistics.max((GrayF32) input); } else if (GrayF64.class == input.getClass()) { return ImageStatistics.max((GrayF64) input); } else { throw new IllegalArgumentException("Unknown Image Type"); return ImageStatistics.max((InterleavedU8) input); } else if (InterleavedS8.class == input.getClass()) { return ImageStatistics.max((InterleavedS8) input); } else if (InterleavedU16.class == input.getClass()) { return ImageStatistics.max((InterleavedU16) input); } else if (InterleavedS16.class == input.getClass()) { return ImageStatistics.max((InterleavedS16) input); } else if (InterleavedS32.class == input.getClass()) { return ImageStatistics.max((InterleavedS32) input);
@Override protected void performThresholding(float threshLow, float threshHigh, GrayU8 output) { if( threshLow < 0 || threshLow > 1 || threshHigh < 0 || threshHigh > 1 ) throw new IllegalArgumentException("Relative thresholds must be from 0 to 1, inclusive."); // find the largest intensity value float max = ImageStatistics.max(suppressed); // set the threshold using that threshLow = max*threshLow; threshHigh = max*threshHigh; if( threshLow <= 0f && threshHigh <= 0f ) { // in this pathological case there is no texture in the image. It is probably less harmful to return // nothing than a whole image if( hysteresisPts != null ) hysteresisPts.getContours().clear(); if( output != null ) ImageMiscOps.fill(output,0); } else { super.performThresholding(threshLow, threshHigh, output); } } }
} else if( lengthSide <= 0 ) { throw new IllegalArgumentException("Parameter lengthSide must be more than zero"); } else if(ImageStatistics.max(inputBinary) > 1 ) throw new IllegalArgumentException("A binary image is composed on 0 and 1 pixels. This isn't binary!");
@Override public void setInputImage(GrayF32 image) { enlargedTemplate.reshape(image.width,image.height); fftImage.reshape(image.width,image.height); fftTemplate.reshape(image.width,image.height); fftMult.reshape(image.width,image.height); correlation.reshape(image.width,image.height); normalizedImage.reshape(image.width,image.height); maxValue = ImageStatistics.max(image)+0.0001f;// avoid divide by zero errors mean = ImageStatistics.mean(image); PixelMath.divide(image,maxValue,normalizedImage); PixelMath.minus(normalizedImage,mean/maxValue,normalizedImage); dft.forward(normalizedImage, fftImage); }
PixelMath.sqrt(stdev, stdev); float R = ImageStatistics.max(stdev);