本文整理了Java中javax.media.jai.Histogram.<init>()
方法的一些代码示例,展示了Histogram.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Histogram.<init>()
方法的具体详情如下:
包路径:javax.media.jai.Histogram
类名称:Histogram
方法名:<init>
暂无
代码示例来源:origin: bcdev/beam
private static Stx arbitraryStx() {
return new Stx(10, 20, 15, 2, true, true, new Histogram(10, 10, 20, 1), 12);
}
}
代码示例来源:origin: senbox-org/snap-desktop
private static Stx arbitraryStx() {
return new Stx(10, 20, 15, 2, 0, 0, true, true, new Histogram(10, 10, 20, 1), 12);
}
}
代码示例来源:origin: bcdev/beam
@Test(expected = IllegalArgumentException.class)
public void testConstructorMinIsNan() throws Exception {
new Stx(Double.NaN, 1.0, Double.NaN, Double.NaN, false, false, new Histogram(256, -1, 1, 1), 0);
}
代码示例来源:origin: bcdev/beam
private static Histogram createHistogram(Stx[] stxs) {
Histogram histogram = new Histogram(stxs[0].getHistogramBinCount(), 0, 256, stxs.length);
for (int i = 0; i < stxs.length; i++) {
System.arraycopy(stxs[i].getHistogramBins(), 0, histogram.getBins(i), 0, stxs[0].getHistogramBinCount());
}
return histogram;
}
代码示例来源:origin: bcdev/beam
@Test(expected = IllegalArgumentException.class)
public void testConstructorResolutionLevelIsInvalid() throws Exception {
new Stx(0.0, 1.0, Double.NaN, Double.NaN, false, false, new Histogram(256, -1, 1, 1), -2);
}
代码示例来源:origin: bcdev/beam
@Test(expected = IllegalArgumentException.class)
public void testConstructorMaxIsNan() throws Exception {
new Stx(0.0, Double.NaN, Double.NaN, Double.NaN, false, false, new Histogram(256, -1, 1, 1), 0);
}
代码示例来源:origin: bcdev/beam
static Histogram createHistogram(int binCount, double minimum, double maximum, boolean logHistogram, boolean intHistogram) {
Scaling histogramScaling = Stx.getHistogramScaling(logHistogram);
if (intHistogram) {
maximum += 1.0;
} else if (maximum == minimum) {
if (maximum < Double.MAX_VALUE) {
maximum = Math.nextUp(maximum);
} else {
minimum = Math.nextAfter(minimum, Double.NEGATIVE_INFINITY);
}
}
return new Histogram(binCount,
histogramScaling.scale(minimum),
histogramScaling.scale(maximum),
1);
}
代码示例来源:origin: locationtech/geowave
new javax.media.jai.Histogram(numBins, lowValue, highValue);
for (int b = 0; b < numBands; b++) {
代码示例来源:origin: bcdev/beam
private void copyStx(RasterDataNode sourceRaster, RasterDataNode targetRaster) {
final Stx sourceStx = sourceRaster.getStx();
final Histogram sourceHistogram = sourceStx.getHistogram();
final Histogram targetHistogram = new Histogram(sourceStx.getHistogramBinCount(),
sourceHistogram.getLowValue(0),
sourceHistogram.getHighValue(0),
1);
System.arraycopy(sourceHistogram.getBins(0), 0, targetHistogram.getBins(0), 0, sourceStx.getHistogramBinCount());
final Stx targetStx = new Stx(sourceStx.getMinimum(),
sourceStx.getMaximum(),
sourceStx.getMean(),
sourceStx.getStandardDeviation(),
sourceStx.isLogHistogram(),
sourceStx.isIntHistogram(),
targetHistogram,
sourceStx.getResolutionLevel());
targetRaster.setStx(targetStx);
}
代码示例来源: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: bcdev/beam
Histogram histogram = new Histogram(numBins, lowValue, highValue);
sourceImage.setProperty("histogram", histogram); // Specify the histogram
代码示例来源:origin: bcdev/beam
@Test
public void testConstructor() throws Exception {
final Histogram histogram = new Histogram(256, -1, 1, 1);
final Stx stx = new Stx(-1.0, 1.0, Double.NaN, Double.NaN, false, false, histogram, 0);
assertEquals(-1.0, stx.getMinimum(), 1E-10);
assertEquals(1.0, stx.getMaximum(), 1E-10);
assertEquals(Double.NaN, stx.getMean(), 1E-10);
assertEquals(Double.NaN, stx.getStandardDeviation(), 1E-10);
assertEquals(Double.NaN, stx.getMean(), 1E-10);
assertEquals(Double.NaN, stx.getMedian(), 1E-10);
assertEquals(false, stx.isIntHistogram());
assertEquals(false, stx.isLogHistogram());
assertSame(histogram, stx.getHistogram());
assertSame(0, stx.getResolutionLevel());
}
内容来源于网络,如有侵权,请联系作者删除!