Q
- The image pixel typeT
- the image typepublic class ProjectionProcessor<Q,T extends Image<Q,T>> extends Object implements AccumulatingImageCombiner<T,T>
Modifier and Type | Field and Description |
---|---|
protected Jama.Matrix |
currentMatrix |
protected List<T> |
images |
protected int |
maxc |
protected int |
maxr |
protected int |
minc |
protected int |
minr |
protected List<Rectangle> |
projectedRectangles |
protected List<Shape> |
projectedShapes |
protected List<Jama.Matrix> |
transforms |
protected List<Jama.Matrix> |
transformsInverted |
protected boolean |
unset |
Constructor and Description |
---|
ProjectionProcessor()
Construct a projection processor starting with an identity matrix for any
images processed (i.e., don't do anything)
|
Modifier and Type | Method and Description |
---|---|
void |
accumulate(T image)
Prepare an image to be transformed using the current matrix.
|
T |
combine()
Combine the accumulated images and produce the output.
|
protected Shape[][] |
getCurrentShapes()
Get the current shapes as an array for efficient access, first entry for
each shape is its rectangle, second entry is the shape
|
Jama.Matrix |
getMatrix() |
protected boolean |
isInside(int shapeIndex,
Shape[][] projectRectangleShapes,
Point2d realPoint) |
T |
performBlendedProjection(int windowMinC,
int windowMaxC,
int windowMinR,
int windowMaxR,
Q backgroundColour)
Perform blended projection but only request data for pixels within the
windowed range provided.
|
T |
performProjection()
Using all the images currently processed, perform the projection on each
image and draw every pixel with valid data.
|
T |
performProjection(boolean keepOriginalWindow,
Q backgroundColour)
Perform projection specifying the background colour (i.e.
|
T |
performProjection(int windowMinC,
int windowMaxC,
int windowMinR,
int windowMaxR)
Perform projection but only request data for pixels within the windowed
range provided.
|
T |
performProjection(int windowMinC,
int windowMaxC,
int windowMinR,
int windowMaxR,
Q backgroundColour)
Perform projection but only request data for pixels within the windowed
range provided.
|
T |
performProjection(int windowMinC,
int windowMinR,
T output)
Perform projection but only request data for pixels within the windowed
range provided.
|
T |
performProjection(Q backgroundColour)
Perform projection specifying the background colour (i.e.
|
static <Q,T extends Image<Q,T>> |
project(T image,
Jama.Matrix matrix)
Utility function, project one image with one matrix.
|
static <Q,T extends Image<Q,T>> |
project(T image,
Jama.Matrix matrix,
Q backgroundColour)
Utility function, project one image with one matrix.
|
void |
setMatrix(Jama.Matrix matrix)
Set the matrix, any images processed from this point forward will be
projected using this matrix
|
protected int minc
protected int minr
protected int maxc
protected int maxr
protected boolean unset
protected List<Jama.Matrix> transforms
protected List<Jama.Matrix> transformsInverted
protected List<Shape> projectedShapes
protected List<Rectangle> projectedRectangles
protected Jama.Matrix currentMatrix
public ProjectionProcessor()
public void setMatrix(Jama.Matrix matrix)
matrix
- a 3x3 matrix representing a 2d transformpublic void accumulate(T image)
performProjection()
knows what range of pixels
to drawaccumulate
in interface AccumulatingImageCombiner<T extends Image<Q,T>,T extends Image<Q,T>>
image
- to be transformedpublic T performProjection()
public T performProjection(Q backgroundColour)
backgroundColour
- the background colourpublic T performProjection(boolean keepOriginalWindow, Q backgroundColour)
keepOriginalWindow
- whether to keep the original image's windowbackgroundColour
- the background colourpublic T performProjection(int windowMinC, int windowMaxC, int windowMinR, int windowMaxR)
windowMinC
- left XwindowMaxC
- right XwindowMinR
- top YwindowMaxR
- bottom Ypublic T performProjection(int windowMinC, int windowMaxC, int windowMinR, int windowMaxR, Q backgroundColour)
windowMinC
- left XwindowMaxC
- right XwindowMinR
- top YwindowMaxR
- bottom YbackgroundColour
- background colour of pixels with no dataprotected Shape[][] getCurrentShapes()
protected boolean isInside(int shapeIndex, Shape[][] projectRectangleShapes, Point2d realPoint)
public T performProjection(int windowMinC, int windowMinR, T output)
windowMinC
- left XwindowMinR
- top Youtput
- the target image in which to projectpublic T performBlendedProjection(int windowMinC, int windowMaxC, int windowMinR, int windowMaxR, Q backgroundColour)
windowMinC
- left XwindowMaxC
- right XwindowMinR
- top YwindowMaxR
- bottom YbackgroundColour
- background colour of pixels with no datapublic Jama.Matrix getMatrix()
public static <Q,T extends Image<Q,T>> T project(T image, Jama.Matrix matrix)
Q
- the image pixel typeT
- image typeimage
- the image to projectmatrix
- the matrix to project againstpublic static <Q,T extends Image<Q,T>> T project(T image, Jama.Matrix matrix, Q backgroundColour)
Q
- the image pixel typeT
- image typeimage
- the image to projectmatrix
- the matrix to project againstbackgroundColour
- The colour of pixels with no data