public class SimpleBlockStrategy extends Object implements SpatialBinningStrategy
SpatialBinningStrategythat extracts histograms from a number of equally-sized, non-overlapping within the sample region and concatenates them together. Each sub-histogram is L2 normalised.
|Constructor and Description|
Construct with the given number of blocks in both the x and y directions.
Construct with the given number of blocks in the x and y directions.
|Modifier and Type||Method and Description|
Extract a histogram describing image content in the given region using the given
public SimpleBlockStrategy(int numBlocks)
numBlocks- number of blocks in each direction
public SimpleBlockStrategy(int numBlocksX, int numBlocksY)
numBlocksX- number of blocks in the x directions
numBlocksY- number of blocks in the y directions
public Histogram extract(WindowedHistogramExtractor binnedData, Rectangle region, Histogram output)
WindowedHistogramExtractorto 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
SpatialBinningStrategys should use the following style
for maximum efficiency:
Histogram h = null;
for (Rectangle region : lots_of_regions)
h = strategy.extract(binnedData, region, h);