|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RasterSearch
Searching in raster images.
Field Summary | |
---|---|
static int |
ERR_MAE
Error metrics: Mean Absolute Error (average of absolute differences of individual samples). |
static int |
ERR_RMSE
Error metrics: Root Mean Squared Error (average of squared differences of individual samples, square root of that average). |
static int |
MAX_REFERENCE
Maximum number of reference images. |
static int |
ORI_0123
Orientation: original ( 0123 from upper left to lower right corner). |
static int |
ORI_0213
Orientation: mirror of ORI_0123 . |
static int |
ORI_1032
Orientation: mirror of ORI_2031 . |
static int |
ORI_1302
Orientation: 270-degree rotation of ORI_0123 . |
static int |
ORI_2031
Orientation: 90-degree rotation of ORI_0123 . |
static int |
ORI_2301
Orientation: mirror of ORI_1302 . |
static int |
ORI_3120
Orientation: mirror of ORI_3210 . |
static int |
ORI_3210
Orientation: 180-degree rotation of ORI_0123 . |
static int |
ORI_FAIL
Result code for failed search. |
static int[][] |
ORI_INV
Transform matrices from destination space [x,y] to source space [u,v] . |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
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. |
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. |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit, get, set |
Field Detail |
---|
static final int ERR_MAE
static final int ERR_RMSE
static final int ORI_0123
0123
from upper left to lower right corner).
static final int ORI_0213
ORI_0123
.
static final int ORI_2031
ORI_0123
.
static final int ORI_1032
ORI_2031
.
static final int ORI_3210
ORI_0123
.
static final int ORI_3120
ORI_3210
.
static final int ORI_1302
ORI_0123
.
static final int ORI_2301
ORI_1302
.
static final int ORI_FAIL
static final int[][] ORI_INV
[x,y]
to source space [u,v]
.
Code to compute source coordinates:
int x, y, size; // destination coordinates and rectangle size int ori; // orientation ... int[] tr = ORI_INV[ ori ]; int u = x * tr[0] + y * tr[1] + (size-1) * tr[2]; int v = x * tr[3] + y * tr[4] + (size-1) * tr[5];
static final int MAX_REFERENCE
Method Detail |
---|
void setReferencePicture(RasterGraphics g, int id, double scale, int oriMask, boolean pixelTransform)
g
- Read-only raster image (can be null
to reset the slot).id
- Reference image identifier (0
, 1
, .. 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?ORI_0123
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)
oriMask
- Mask of valid orientations to search (1 <<
ORI_0123
, ..).bandMask
- Mask of searched image bands (Red .. 1, Green .. 2, Blue .. 4, ..).metrics
- One of {ERR_MAE
, 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).int findBestRectangle(RasterGraphics f, int x, int y, int width, int height, int ref, double[] result)
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]
.
ORI_FAIL
in case of failure).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |