|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.testing.SampleRasterSearch
public class SampleRasterSearch
Sample raster-search implementation. Uses only luminance search, one pixel pisition accuracy and RMSE.
Field Summary | |
---|---|
protected int |
actBandMask
Actual band mask. |
protected double |
actMaxO
Actual maximum value of additive coefficient o . |
protected double |
actMaxS
Actual maximum value of multiplication coefficient s . |
protected int |
actMaxX
Actual maximum X coordinate of a search (can be 0 for unbounded search). |
protected int |
actMaxY
Actual maximum Y coordinate of a search (can be 0 for unbounded search). |
protected int |
actMetrics
Actual metrics. |
protected double |
actMinO
Actual minimum value of additive coefficient o . |
protected double |
actMinS
Actual minimum value of multiplication coefficient s . |
protected int |
actMinX
Actual minimum X coordinate of a search. |
protected int |
actMinY
Actual minimum Y coordinate of a search. |
protected int |
actOriMask
Actual orientation mask. |
protected double |
actPrecision
Actual position accuracy. |
protected int |
actRelX
Actual maximum X displacement for relative search (should be 0 for absolute search). |
protected int |
actRelY
Actual maximum Y displacement for relative search (can be 0 for absolute search). |
protected static java.lang.String |
CATEGORY
Object category. |
protected HDRImage[] |
refs
Reference pictures. |
static RegPiece |
reg
Static registration instance for this class. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
static java.lang.String |
USE_GRAY
|
protected boolean |
useGray
Use only gray (luminance) component of the images? |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.RasterSearch |
---|
ERR_MAE, ERR_RMSE, MAX_REFERENCE, ORI_0123, ORI_0213, ORI_1032, ORI_1302, ORI_2031, ORI_2301, ORI_3120, ORI_3210, ORI_FAIL, ORI_INV |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
SampleRasterSearch()
|
Method Summary | |
---|---|
int |
findBestRectangle(RasterGraphics f,
int x,
int y,
int width,
int height,
int ref,
double[] result)
Searches for the most similar rectangle in one of predefined reference images. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
void |
setReferencePicture(RasterGraphics g,
int id,
double scale,
int oriMask,
boolean pixelTransform)
Sets reference image. |
void |
setSearchParameters(int oriMask,
int bandMask,
int metrics,
double precision,
int absMinX,
int absMaxX,
int absMinY,
int absMaxY,
int relX,
int relY,
double minMul,
double maxMul,
double minAdd,
double maxAdd)
Sets parameters for subsequent searches. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, init, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Field Detail |
---|
protected boolean useGray
protected int actOriMask
protected int actBandMask
protected int actMetrics
protected double actPrecision
protected int actMinX
protected int actMaxX
0
for unbounded search).
protected int actMinY
protected int actMaxY
0
for unbounded search).
protected int actRelX
0
for absolute search).
protected int actRelY
0
for absolute search).
protected double actMinS
s
.
Must be set to 1.0
if no pixel transform is allowed).
protected double actMaxS
s
.
Must be set to 1.0
if no pixel transform is allowed).
protected double actMinO
o
.
protected double actMaxO
o
.
protected HDRImage[] refs
public static final java.lang.String USE_GRAY
protected static final java.lang.String TEMPLATE_NAME
protected static final java.lang.String CATEGORY
public static final RegPiece reg
Constructor Detail |
---|
public SampleRasterSearch()
Method Detail |
---|
public void setReferencePicture(RasterGraphics g, int id, double scale, int oriMask, boolean pixelTransform)
setReferencePicture
in interface RasterSearch
g
- Read-only raster image (can be null
to reset the slot).id
- Reference image identifier (0
, 1
, .. RasterSearch.MAX_REFERENCE
-1
).scale
- Scale to be used in precomputing.oriMask
- Mask of orientations used in future search commands (non-mandatory,
use 0
if not known).pixelTransform
- Will a linear pixel transform be used?RasterSearch.ORI_0123
public void setSearchParameters(int oriMask, int bandMask, int metrics, double precision, int absMinX, int absMaxX, int absMinY, int absMaxY, int relX, int relY, double minMul, double maxMul, double minAdd, double maxAdd)
setSearchParameters
in interface RasterSearch
oriMask
- Mask of valid orientations to search (1 <<
RasterSearch.ORI_0123
, ..).bandMask
- Mask of searched image bands (Red .. 1, Green .. 2, Blue .. 4, ..).metrics
- One of {RasterSearch.ERR_MAE
, RasterSearch.ERR_RMSE
}.precision
- Sub-pixel precision of result coordinates (should be power of 1/2
).absMinX
- Lower bound for X-coordinate of absolute search.absMaxX
- Upper bound for X-coordinate of absolute search (can be 0
for unbounded search).absMinY
- Lower bound for Y-coordinate of absolute search.absMaxY
- Upper bound for Y-coordinate of absolute search (can be 0
for unbounded search).relX
- X-amplitude of relative search (must be 0
for absolute search).relY
- Y-amplitude of relative search.minMul
- Minimum pixel-value multiplier (should be 1
if no multiplication is allowed).maxMul
- Maximum pixel-value multiplier (should be 1
if no multiplication is allowed).minAdd
- Minimum additive coefficient (should be 0
if no addition is allowed).maxAdd
- Maximum additive coefficient (should be 0
if no addition is allowed).public int findBestRectangle(RasterGraphics f, int x, int y, int width, int height, int ref, double[] result)
findBestRectangle
in interface RasterSearch
f
- Raster image containing the sought rectangle.x
- Origin of the sought rectangle.y
- Origin of the sought rectangle.width
- Width of the sought rectangle.height
- Height of the sought rectangle.ref
- Reference image to be scanned.result
- Pre-allocated result array double[5]
,
will hold coordinates, coefficients and error measure [x,y,mul,add,err]
.
RasterSearch.ORI_FAIL
in case of failure).public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
null
.public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |