public class QuadtreeSampler extends Object implements Iterable<Rectangle>
QuadtreeSampler
provides an easy way of extracting sample patches
from an image or other domain in both spatial and scale directions. The
sampling regions returned by the sampler form a quadtree. At the first level
there is a single sample region covering the entire region; at the second
level, there are 4 non-overlapping sample regions, and so on.Constructor and Description |
---|
QuadtreeSampler(Rectangle r,
int nLevels)
Construct the sampler with the given parameters
|
Modifier and Type | Method and Description |
---|---|
List<Rectangle> |
allRectangles()
Get all the sampling regions
|
Iterator<Rectangle> |
iterator() |
Iterator<RectangleSampler> |
levelIterator()
Create an iterator over each of the levels in the pyramid.
|
List<List<Rectangle>> |
levelRectangles()
Get all the sampling regions grouped by level
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public QuadtreeSampler(Rectangle r, int nLevels)
r
- the size of the initial sample region on the first levelnLevels
- the number of levels to sample overpublic List<List<Rectangle>> levelRectangles()
public List<Rectangle> allRectangles()
public Iterator<RectangleSampler> levelIterator()
RectangleSampler
that describes the individual
rectangles on a level.