javax.media.jai.Histogram.getBinLowValue()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中javax.media.jai.Histogram.getBinLowValue()方法的一些代码示例,展示了Histogram.getBinLowValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.getBinLowValue()方法的具体详情如下:
包路径:javax.media.jai.Histogram
类名称:Histogram
方法名:getBinLowValue

Histogram.getBinLowValue介绍

暂无

代码示例

代码示例来源:origin: bcdev/beam

static double getMeanOfBin(Histogram histogram, int bandIndex, int binIndex) {
    final double binLowValue = histogram.getBinLowValue(bandIndex, binIndex);
    final double binMaxValue = histogram.getBinLowValue(bandIndex, binIndex + 1);
    return (binLowValue + binMaxValue) / 2;
  }
}

代码示例来源:origin: bcdev/beam

/**
 * Gets the (inclusive) minimum value of the histogram bin given by the bin index.
 * <p/>
 * The value returned is in units of the image samples,
 * {@link #getHistogramScaling() histogram scaling} is already applied
 *
 * @param binIndex The bin index.
 * @return The (inclusive) minimum value of the bin given by the bin index.
 */
public double getHistogramBinMinimum(int binIndex) {
  double value = histogram.getBinLowValue(0, binIndex);
  return histogramScaling.scaleInverse(value);
}

代码示例来源:origin: bcdev/beam

static double computeMedian(Histogram histogram, long sampleCount) {
  boolean isEven = sampleCount % 2 == 0;
  double halfSampleCount = sampleCount / 2.0;
  final int bandIndex = 0;
  int[] bins = histogram.getBins(bandIndex);
  long currentSampleCount = 0;
  int lastConsideredBinIndex = 0;
  for (int i = 0, binsLength = bins.length; i < binsLength; i++) {
    currentSampleCount += bins[i];
    if (currentSampleCount > halfSampleCount) {
      if (isEven) {
        double binValue = getMeanOfBin(histogram, bandIndex, i);
        double lastBinValue = getMeanOfBin(histogram, bandIndex, lastConsideredBinIndex);
        return (lastBinValue + binValue) / 2;
      } else {
        final double binLowValue = histogram.getBinLowValue(bandIndex, i);
        final double binMaxValue = histogram.getBinLowValue(bandIndex, i + 1);
        final double previousSampleCount = currentSampleCount - bins[i];
        double weight = (halfSampleCount - previousSampleCount) / (currentSampleCount - previousSampleCount);
        return binLowValue * (1 - weight) + binMaxValue * weight;
      }
    }
    if (bins[i] > 0) {
      lastConsideredBinIndex = i;
    }
  }
  return Double.NaN;
}

代码示例来源:origin: bcdev/beam

/**
 * Gets the (exclusive) maximum value of the histogram bin given by the bin index.
 * <p/>
 * The value returned is in units of the image samples,
 * {@link #getHistogramScaling() histogram scaling} is already applied
 *
 * @param binIndex The bin index.
 * @return The (exclusive) maximum value of the bin given by the bin index.
 */
public double getHistogramBinMaximum(int binIndex) {
  double value = binIndex < histogram.getNumBins(0) ? histogram.getBinLowValue(0, binIndex + 1) : histogram.getHighValue(0);
  return histogramScaling.scaleInverse(value);
}

代码示例来源:origin: senbox-org/snap-desktop

int[] bins = histogram.getBins(0);
for (int j = 0; j < bins.length; j++) {
  histogramSeries.add(histogram.getBinLowValue(0, j),
            histogram.getBinLowValue(0, j),
            j < bins.length - 1 ? histogram.getBinLowValue(0, j + 1) : histogram.getHighValue(0),
            bins[j]);

代码示例来源:origin: bcdev/beam

int[] bins = histogram.getBins(0);
for (int j = 0; j < bins.length; j++) {
  histogramSeries.add(histogram.getBinLowValue(0, j),
            histogram.getBinLowValue(0, j),
            j < bins.length - 1 ? histogram.getBinLowValue(0, j + 1) : histogram.getHighValue(0),
            bins[j]);

代码示例来源:origin: senbox-org/snap-desktop

private void setStx(Stx stx) {
  if (stx != null) {
    HistogramPanelModel.HistogramConfig config = createHistogramConfig();
    if (config == null) {
      return;
    }
    if (!model.hasStx(config)) {
      model.setStx(config, stx);
    }
    dataset = new XIntervalSeriesCollection();
    final int[] binCounts = stx.getHistogramBins();
    final RasterDataNode raster = getRaster();
    final XIntervalSeries series = new XIntervalSeries(raster.getName());
    final Histogram histogram = stx.getHistogram();
    for (int i = 0; i < binCounts.length; i++) {
      final double xMin = histogram.getBinLowValue(0, i);
      final double xMax = i < binCounts.length - 1 ?
          histogram.getBinLowValue(0, i + 1) : histogram.getHighValue(0);
      series.add(xMin, xMin, xMax, binCounts[i]);
    }
    dataset.addSeries(series);
  }
  handleStxChange();
}

代码示例来源:origin: bcdev/beam

private void setStx(Stx stx) {
  if (stx != null) {
    HistogramPanelModel.HistogramConfig config = createHistogramConfig();
    if (config == null) {
      return;
    }
    if (!model.hasStx(config)) {
      model.setStx(config, stx);
    }
    dataset = new XIntervalSeriesCollection();
    final int[] binCounts = stx.getHistogramBins();
    final RasterDataNode raster = getRaster();
    final XIntervalSeries series = new XIntervalSeries(raster.getName());
    final Histogram histogram = stx.getHistogram();
    for (int i = 0; i < binCounts.length; i++) {
      final double xMin = histogram.getBinLowValue(0, i);
      final double xMax = i < binCounts.length - 1 ?
          histogram.getBinLowValue(0, i + 1) : histogram.getHighValue(0);
      series.add(xMin, xMin, xMax, binCounts[i]);
    }
    dataset.addSeries(series);
  }
  handleStxChange();
}

相关文章