Tabnine Logo
GImageStatistics.histogram
Code IndexAdd Tabnine to your IDE (free)

How to use
histogram
method
in
boofcv.alg.misc.GImageStatistics

Best Java code snippets using boofcv.alg.misc.GImageStatistics.histogram (Showing top 3 results out of 315)

origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Computes the variance based threshold using a modified Otsu method from an input image. Internally it uses
 * {@link #computeOtsu2(int[], int, int)} and {@link boofcv.alg.misc.GImageStatistics#histogram(ImageGray, double, int[])}
 * </p>
 *
 * @param input Input gray-scale image
 * @param minValue The minimum value of a pixel in the image.  (inclusive)
 * @param maxValue The maximum value of a pixel in the image.  (inclusive)
 * @return Selected threshold.
 */
public static int computeOtsu2(ImageGray input , int minValue , int maxValue ) {
  int range = 1+maxValue - minValue;
  int histogram[] = new int[ range ];
  GImageStatistics.histogram(input,minValue,histogram);
  // Total number of pixels
  int total = input.width*input.height;
  return computeOtsu2(histogram,range,total)+minValue;
}
origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Computes the variance based threshold using Otsu's method from an input image. Internally it uses
 * {@link #computeOtsu(int[], int, int)} and {@link boofcv.alg.misc.GImageStatistics#histogram(ImageGray, double, int[])}
 * </p>
 *
 * @param input Input gray-scale image
 * @param minValue The minimum value of a pixel in the image.  (inclusive)
 * @param maxValue The maximum value of a pixel in the image.  (inclusive)
 * @return Selected threshold.
 */
public static double computeOtsu(ImageGray input , double minValue , double maxValue ) {
  int range = (int)(1+maxValue - minValue);
  int histogram[] = new int[ range ];
  GImageStatistics.histogram(input,minValue,histogram);
  // Total number of pixels
  int total = input.width*input.height;
  return computeOtsu(histogram,range,total)+minValue;
}
origin: org.boofcv/boofcv-ip

/**
 * <p>
 * Computes a threshold which maximizes the entropy between the foreground and background regions.  See
 * {@link #computeEntropy(int[], int, int)} for more details.
 * </p>
 *
 * @see boofcv.alg.misc.GImageStatistics#histogram(ImageGray, double, int[])
 *
 * @param input Input gray-scale image
 * @param minValue The minimum value of a pixel in the image.  (inclusive)
 * @param maxValue The maximum value of a pixel in the image.  (inclusive)
 * @return Selected threshold.
 */
public static double computeEntropy(ImageGray input , double minValue , double maxValue ) {
  int range = (int)(1 + maxValue - minValue);
  int histogram[] = new int[ range ];
  GImageStatistics.histogram(input,minValue,histogram);
  // Total number of pixels
  int total = input.width*input.height;
  return computeEntropy(histogram, range, total)+minValue;
}
boofcv.alg.miscGImageStatisticshistogram

Javadoc

Computes the histogram of intensity values for the image. For floating point images it is rounded to the nearest integer using "(int)value".

Popular methods of GImageStatistics

  • maxAbs
    Returns the absolute value of the element with the largest absolute value, across all bands
  • max
    Returns the maximum pixel value across all bands.
  • mean
    Returns the mean pixel intensity value.
  • min
    Returns the minimum pixel value across all bands
  • sum
    Returns the sum of all the pixels in the image across all bands.

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now