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

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

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

Histogram.getPTileThreshold介绍

暂无

代码示例

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

private Number computePercentile(int percentile, Histogram histogram) {
  return histogram.getPTileThreshold(percentile * 0.01)[0];
}

代码示例来源:origin: geotools/geotools

if (histogram != null) {
  final double[] p =
      histogram.getPTileThreshold(
          rasterLayerResponse.getArtifactsFilterPTileThreshold());
  artifactThreshold = (int) p[0];

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

sb.append(stx.getHistogram().getPTileThreshold(percentile / 100.0)[0]);
sb.append("\t");
sb.append(unit);

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

sb.append(stx.getHistogram().getPTileThreshold(percentile / 100.0)[0]);
sb.append("\t");
sb.append(unit);

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

j,
             j + 1,
             histogram.getPTileThreshold(j / 100.0)[0]);
    new Object[]{"Sigma:", stx.getStandardDeviation()},
    new Object[]{"Median:", stx.getMedian()},
    new Object[]{"P75 threshold:", histogram.getPTileThreshold(0.75)[0]},
    new Object[]{"P80 threshold:", histogram.getPTileThreshold(0.80)[0]},
    new Object[]{"P85 threshold:", histogram.getPTileThreshold(0.85)[0]},
    new Object[]{"P90 threshold:", histogram.getPTileThreshold(0.90)[0]},
    new Object[]{"Max error:", getBinSize(histogram)},
};

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

j,
             j + 1,
             histogram.getPTileThreshold(j / 100.0)[0]);
    new Object[]{"Coef Variation:", stx.getCoefficientOfVariation()},
    new Object[]{"ENL:", stx.getEquivalentNumberOfLooks()},
    new Object[]{"P75 threshold:", histogram.getPTileThreshold(0.75)[0]},
    new Object[]{"P80 threshold:", histogram.getPTileThreshold(0.80)[0]},
    new Object[]{"P85 threshold:", histogram.getPTileThreshold(0.85)[0]},
    new Object[]{"P90 threshold:", histogram.getPTileThreshold(0.90)[0]},
    new Object[]{"Max error:", getBinSize(histogram)},
};

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

@Test
public void testPercentiles() throws Exception {
  int[] samples = new int[]{0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9};
  Arrays.sort(samples);
  double p0 = samples[0];
  double p25 = samples[samples.length / 4 - 1];
  double p50 = samples[samples.length / 2 - 1];
  double p75 = samples[3 * samples.length / 4 - 1];
  double p100 = samples[samples.length - 1];
  int[] bins = new int[10];
  for (int sample : samples) {
    bins[sample]++;
  }
  Histogram histogram = new Histogram(new int[]{10}, new double[]{0.0}, new double[]{10.0});
  System.arraycopy(bins, 0, histogram.getBins(0), 0, 10);
  assertEquals(p0, histogram.getPTileThreshold(0.00001)[0], 1E-10);
  assertEquals(p50, histogram.getPTileThreshold(0.50)[0], 1E-10);
  assertEquals(p25, histogram.getPTileThreshold(0.25)[0], 1E-10);
  assertEquals(p75, histogram.getPTileThreshold(0.75)[0], 1E-10);
  assertEquals(p100, histogram.getPTileThreshold(0.99999)[0], 1E-10);
}

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

statistics.put("minimum", histogram.getLowValue(0));
statistics.put("maximum", histogram.getHighValue(0));
statistics.put("median", histogram.getPTileThreshold(0.5)[0]);
statistics.put("average", histogram.getMean()[0]);
statistics.put("sigma", histogram.getStandardDeviation()[0]);
statistics.put("p90", histogram.getPTileThreshold(0.9)[0]);
statistics.put("p95", histogram.getPTileThreshold(0.95)[0]);
statistics.put("pxx_max_error", StatisticsPanel.getBinSize(histogram));
statistics.put("total", histogram.getTotals()[0]);

代码示例来源:origin: tamirhassan/pdfxtk

public static BufferedImage convertToBinary(BufferedImage sourceImg){
  double[][] matrix = {{ 0.3D, 0.59D, 0.11D, 0D }};
  ParameterBlock pb = new ParameterBlock();
  pb.addSource(sourceImg);
  pb.add(matrix);
  PlanarImage src = JAI.create("BandCombine", pb, null);
  // Generate a histogram.
  Histogram histogram = (Histogram)JAI.create("histogram", src).getProperty("histogram");
  // Get a threshold equal to the median.
  double[] threshold = histogram.getPTileThreshold(0.5);
  // Binarize the image.
  PlanarImage dst = JAI.create("binarize", src, new Double(threshold[0]));
  return dst.getAsBufferedImage(); 
}

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

statistics.put("minimum", histogram.getLowValue(0));
statistics.put("maximum", histogram.getHighValue(0));
statistics.put("median", histogram.getPTileThreshold(0.5)[0]);
statistics.put("average", histogram.getMean()[0]);
statistics.put("sigma", histogram.getStandardDeviation()[0]);
statistics.put("p90", histogram.getPTileThreshold(0.9)[0]);
statistics.put("p95", histogram.getPTileThreshold(0.95)[0]);
statistics.put("pxx_max_error", StatisticsPanel.getBinSize(histogram));
statistics.put("total", histogram.getTotals()[0]);

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

stxMap.put(SIGMA, summaryStxOp.getStandardDeviation());
stxMap.put(TOTAL, histogram.getTotals()[0]);
stxMap.put(MEDIAN, histogram.getPTileThreshold(0.5)[0]);
for (int percentile : percentiles) {
  stxMap.put(getPercentileName(percentile), computePercentile(percentile, histogram));

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

statistics.put("minimum", histogram.getLowValue(0));
statistics.put("maximum", histogram.getHighValue(0));
statistics.put("median", histogram.getPTileThreshold(0.5)[0]);
statistics.put("average", histogram.getMean()[0]);
statistics.put("sigma", histogram.getStandardDeviation()[0]);
statistics.put("p90_threshold", histogram.getPTileThreshold(0.9)[0]);
statistics.put("p95_threshold", histogram.getPTileThreshold(0.95)[0]);
statistics.put("total", histogram.getTotals()[0]);
csvStatisticsWriter.addToOutput(dataProvider.getRasterDataNode().getName(), regionIds[i], statistics);

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

statistics.put("minimum", histogram.getLowValue(0));
statistics.put("maximum", histogram.getHighValue(0));
statistics.put("median", histogram.getPTileThreshold(0.5)[0]);
statistics.put("average", histogram.getMean()[0]);
statistics.put("sigma", histogram.getStandardDeviation()[0]);
statistics.put("p90_threshold", histogram.getPTileThreshold(0.9)[0]);
statistics.put("p95_threshold", histogram.getPTileThreshold(0.95)[0]);
statistics.put("total", histogram.getTotals()[0]);
csvStatisticsWriter.addToOutput(dataProvider.getRasterDataNode().getName(), regionIds[i], statistics);

代码示例来源:origin: org.geotools/gt-imagemosaic

final Histogram histogram = Utils.getHistogram(histogramPath);
if (histogram != null) {
  final double[]p = histogram.getPTileThreshold(artifactsFilterPTileThreshold);
  artifactThreshold = (int)p[0];

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

@Test
public void testCreateStxForNullBands() throws Exception {
  final Band testBand1 = createTestBand(ProductData.TYPE_FLOAT64, 10, 10, -100);
  final Band testBand2 = null;
  Stx stx = new StxFactory().withHistogramBinCount(524288).create(null, new RasterDataNode[]{testBand1, testBand2}, ProgressMonitor.NULL);
  assertEquals(100, stx.getMinimum(), 1E-3);
  assertEquals(199, stx.getMaximum(), 1E-3);
  assertEquals(149.5, stx.getMean(), 1E-3);
  assertEquals(149.5, stx.getMedian(), 1E-3);
  assertEquals(189, stx.getHistogram().getPTileThreshold(0.9)[0], 1E-3);
  assertEquals(149, stx.getHistogram().getPTileThreshold(0.5)[0], 1E-3);
  assertEquals(109, stx.getHistogram().getPTileThreshold(0.1)[0], 1E-3);
}

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

@Test
public void testCreateStxForMultipleBands() throws Exception {
  final Band testBand1 = createTestBand(ProductData.TYPE_FLOAT64, 10, 10, -100);
  final Band testBand2 = createTestBand(ProductData.TYPE_FLOAT64, 10, 10, -200);
  Stx stx = new StxFactory().withHistogramBinCount(2097152).create(null, new RasterDataNode[]{testBand1, testBand2}, ProgressMonitor.NULL);
  assertEquals(100, stx.getMinimum(), 1E-3);
  assertEquals(299, stx.getMaximum(), 1E-3);
  assertEquals(199.5, stx.getMean(), 1E-3);
  assertEquals(199.5, stx.getMedian(), 1E-3);
  assertEquals(279, stx.getHistogram().getPTileThreshold(0.9)[0], 1E-3);
  assertEquals(199, stx.getHistogram().getPTileThreshold(0.5)[0], 1E-3);
  assertEquals(119, stx.getHistogram().getPTileThreshold(0.1)[0], 1E-3);
}

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

@Test
public void testCreateStxForMultipleBandsAndRoiMask() throws Exception {
  final Band testBand1 = createTestBand(ProductData.TYPE_FLOAT64, 10, 10, -100);
  final Band testBand2 = createTestBand(ProductData.TYPE_FLOAT64, 10, 10, -200);
  final Mask roiMask = testBand1.getProduct().addMask("validMask", "X < 5", "testValidMask", Color.gray, Double.NaN);
  final Mask roiMask2 = testBand2.getProduct().addMask("validMask", "X < 5", "testValidMask", Color.gray, Double.NaN);
  Stx stx = new StxFactory()
      .withHistogramBinCount(2097152)
      .create(new Mask[]{roiMask, roiMask2}, new RasterDataNode[]{testBand1, testBand2}, ProgressMonitor.NULL);
  assertEquals(100, stx.getMinimum(), 1E-3);
  assertEquals(294, stx.getMaximum(), 1E-3);
  assertEquals(197, stx.getMean(), 1E-3);
  assertEquals(274, stx.getHistogram().getPTileThreshold(0.9)[0], 1E-3);
  assertEquals(194, stx.getHistogram().getPTileThreshold(0.5)[0], 1E-3);
  assertEquals(114, stx.getHistogram().getPTileThreshold(0.1)[0], 1E-3);
}

相关文章