public class QuadtreeStrategy extends Object implements SpatialBinningStrategy
SpatialBinningStrategy
that extracts histograms from regions
defined by a fixed depth quadtree overlayed over the sampling region and
concatenates them together.Constructor and Description |
---|
QuadtreeStrategy(int nlevels)
Construct with the given quadtree depth
|
Modifier and Type | Method and Description |
---|---|
Histogram |
extract(WindowedHistogramExtractor binnedData,
Rectangle region,
Histogram output)
Extract a histogram describing image content in the given region using
the given
WindowedHistogramExtractor to extract (sub) histograms
from which to build the output. |
public QuadtreeStrategy(int nlevels)
nlevels
- quadtree depthpublic Histogram extract(WindowedHistogramExtractor binnedData, Rectangle region, Histogram output)
SpatialBinningStrategy
WindowedHistogramExtractor
to extract (sub) histograms
from which to build the output.
For efficiency, this method allows the output histogram to be specified
as an input. This means that implementors of this interface can attempt
to fill the output histogram rather than creating a new instance
(although care should be taken to ensure that the porivded output
histogram is the correct size and not null
).
Users of SpatialBinningStrategy
s should use the following style
for maximum efficiency:
Histogram h = null;
...
for (Rectangle region : lots_of_regions)
h = strategy.extract(binnedData, region, h);
extract
in interface SpatialBinningStrategy
binnedData
- the WindowedHistogramExtractor
to extract
sub-histograms fromregion
- the region to extract fromoutput
- the output histogram to fill (can be null)output
)