BinnedWindowedExtractor implements ImageAnalyser<FImage>, WindowedHistogramExtractor { @Override public Histogram computeHistogram(Rectangle roi) { return computeHistogram((int) roi.x, (int) roi.y, (int) roi.width, (int) roi.height); } BinnedWindowedExtractor(int nbins);  BinnedWindowedExtractor(int nbins, float min, float max); @Override int getNumBins(); void setNbins(int nbins); float getMin(); void setMin(float min); float getMax(); void setMax(float max); @Override void analyseImage(FImage image); int[][] getBinMap(); @Override Histogram computeHistogram(Rectangle roi); @Override Histogram computeHistogram(int x, int y, int w, int h); Histogram computeHistogram(Rectangle roi, FImage weights); Histogram computeHistogram(int x, int y, int w, int h, FImage weights); Histogram computeHistogram(int x, int y, FImage weights, FImage windowWeights); @Override void computeHistogram(Rectangle roi, Histogram histogram); @Override void computeHistogram(int x, int y, int w, int h, Histogram histogram);  }
@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 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); }