Package net.sourceforge.jiu.color.data

Examples of net.sourceforge.jiu.color.data.Histogram1D


    for (int channelIndex = 0; channelIndex < in.getNumChannels(); channelIndex++)
    {
      Histogram1DCreator hc = new Histogram1DCreator();
      hc.setImage(in, channelIndex);
      hc.process();
      Histogram1D hist = hc.getHistogram();

      int min = 0;
      while (hist.getEntry(min) == 0)
      {
        min++;
      }
      int maxSample = in.getMaxSample(channelIndex);
      int max = maxSample;
      while (hist.getEntry(max) == 0)
      {
        max--;
      }
      int[] data = new int[maxSample + 1];
      int usedInterval = max - min + 1;
View Full Code Here


    for (int channelIndex = 0; channelIndex < in.getNumChannels(); channelIndex++)
    {
      Histogram1DCreator hc = new Histogram1DCreator();
      hc.setImage(in, channelIndex);
      hc.process();
      Histogram1D hist = hc.getHistogram();

      final int MAX_SAMPLE = in.getMaxSample(channelIndex);
      int[] data = new int[MAX_SAMPLE + 1];
      int NUM_PIXELS = in.getWidth() * in.getHeight();
      long sum = 0;
      for (int i = 0; i < data.length; i++)
      {
        sum += hist.getEntry(i);
        long result = sum * MAX_SAMPLE / NUM_PIXELS;
        if (result > (long)Integer.MAX_VALUE)
        {
          throw new IllegalStateException("Result does not fit into an int.");
        }
View Full Code Here

      try
      {
        Histogram1DCreator hc = new Histogram1DCreator();
        hc.setImage((RGBIntegerImage)image);
        hc.process();
        Histogram1D hist = hc.getHistogram();
        return new Integer(hist.getNumUsedEntries());
      }
      catch (Exception e)
      {
        return null;
      }
View Full Code Here

TOP

Related Classes of net.sourceforge.jiu.color.data.Histogram1D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.