public class SATWindowedExtractor extends Object implements WindowedHistogramExtractor
WindowedHistogramExtractor with the primary
purpose of of producing efficient access to histograms of arbitrary windows
of the image.
This implementation is based on a stack of SummedAreaTables, with one
SummedAreaTable per histogram bin. Obviously this is quite memory
intensive, so should probably only be used with small numbers of bins.
However, the advantage over a BinnedWindowedExtractor is that the
histogram extraction is an O(1) operation, and it is thus very quick for
evaluating many windows.
| Modifier and Type | Field and Description |
|---|---|
protected int |
nbins |
protected SummedAreaTable[] |
sats |
| Modifier | Constructor and Description |
|---|---|
|
SATWindowedExtractor(FImage[] magnitudeMaps)
Construct with the given spatial histogram magnitude maps.
|
protected |
SATWindowedExtractor(int nbins)
Protected constructor for subclasses to use if they don't wan't to
compute the SATs at construction time
|
| Modifier and Type | Method and Description |
|---|---|
Histogram |
computeHistogram(int x,
int y,
int w,
int h)
Compute the histogram for the given window.
|
void |
computeHistogram(int x,
int y,
int w,
int h,
Histogram hist)
Compute the histogram for the given window, storing the output in the
given
Histogram object, which must have the same length as given
by WindowedHistogramExtractor.getNumBins(). |
Histogram |
computeHistogram(Rectangle roi)
Compute the histogram for the given window.
|
void |
computeHistogram(Rectangle roi,
Histogram histogram)
Compute the histogram for the given window, storing the output in the
given
Histogram object, which must have the same length as given
by WindowedHistogramExtractor.getNumBins(). |
protected void |
computeSATs(FImage[] magnitudeMaps) |
int |
getNumBins()
Get the number of bins
|
protected final SummedAreaTable[] sats
protected final int nbins
protected SATWindowedExtractor(int nbins)
nbins - the number of histogram bins.public SATWindowedExtractor(FImage[] magnitudeMaps)
magnitudeMaps - array of images, one per bin, with each pixel set to the
histogram magnitude at that binprotected void computeSATs(FImage[] magnitudeMaps)
public int getNumBins()
WindowedHistogramExtractorgetNumBins in interface WindowedHistogramExtractorpublic Histogram computeHistogram(Rectangle roi)
WindowedHistogramExtractorcomputeHistogram in interface WindowedHistogramExtractorroi - the windowpublic Histogram computeHistogram(int x, int y, int w, int h)
WindowedHistogramExtractorcomputeHistogram in interface WindowedHistogramExtractorx - The x-coordinate of the top-left of the windowy - The y-coordinate of the top-left of the windoww - The width of the windowh - The height of the windowpublic void computeHistogram(int x, int y, int w, int h, Histogram hist)
WindowedHistogramExtractorHistogram object, which must have the same length as given
by WindowedHistogramExtractor.getNumBins().computeHistogram in interface WindowedHistogramExtractorx - The x-coordinate of the top-left of the windowy - The y-coordinate of the top-left of the windoww - The width of the windowh - The height of the windowhist - the histogram to write topublic void computeHistogram(Rectangle roi, Histogram histogram)
WindowedHistogramExtractorHistogram object, which must have the same length as given
by WindowedHistogramExtractor.getNumBins().computeHistogram in interface WindowedHistogramExtractorroi - the windowhistogram - the histogram to write to