/** * Test that the global histogram produced with {@link HistogramAnalyser} matches the one produced * with {@link BinnedWindowedExtractor}. */ @Test public void testFullHistogram() { final Histogram hist1 = HistogramAnalyser.getHistogram(image, analyser.nbins); final Histogram hist2 = analyser.computeHistogram(0, 0, image.width, image.height); assertArrayEquals(hist1.values, hist2.values, 0.0001); }
/** * Test that the windowed histogram produced with {@link HistogramAnalyser} matches the one * produced with {@link BinnedWindowedExtractor}. */ @Test public void testWindowedHistogram() { final Rectangle roi = new Rectangle(50, 10, 100, 100); final Histogram hist1 = HistogramAnalyser.getHistogram(image.extractROI(roi), analyser.nbins); final Histogram hist2 = analyser.computeHistogram(roi); assertArrayEquals(hist1.values, hist2.values, 0.0001); }