public static enum TemplateMatcher.Mode extends Enum<TemplateMatcher.Mode>
Enum Constant and Description |
---|
CORRELATION
Compute the score at a point as the summed product between the image
and the template with the top-left at the point given.
|
CORRELATION_COEFFICIENT
Compute the score at a point as the summed product between the mean-centered image patch
and the mean-centered template with the top-left at the point given.
|
NORM_CORRELATION
Compute the normalised score at a point as the summed product between the image
and the template with the top-left at the point given.
|
NORM_CORRELATION_COEFFICIENT
Compute the normalised score at a point as the summed product between the mean-centered image patch
and the mean-centered template with the top-left at the point given.
|
NORM_SUM_SQUARED_DIFFERENCE
Compute the normalised score at a point as the sum-squared difference between the image
and the template with the top-left at the given point.
|
SUM_SQUARED_DIFFERENCE
Compute the score at a point as the sum-squared difference between the image
and the template with the top-left at the given point.
|
Modifier and Type | Method and Description |
---|---|
protected abstract float |
computeMatchScore(FImage image,
FImage template,
int x,
int y,
Object workingSpace)
Compute the matching score between the image and template, with the top-left of the
template at (x, y) in the image.
|
abstract float |
computeMatchScore(float[][] img,
int x,
int y,
float[][] template,
int templateX,
int templateY,
int templateWidth,
int templateHeight)
Compute the matching score between the image and template, with the top-left of the
template at (x, y) in the image.
|
protected FImage |
prepareTemplate(FImage template)
Prepare the template if necessary.
|
protected Object |
prepareWorkingSpace(FImage template)
Prepare an object to hold the working space required by the
mode during score computation.
|
abstract boolean |
scoresAscending()
Are the scores ascending (i.e.
|
static TemplateMatcher.Mode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TemplateMatcher.Mode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TemplateMatcher.Mode SUM_SQUARED_DIFFERENCE
TemplateMatcher
will account for the offset to the centre of the template internally.public static final TemplateMatcher.Mode NORM_SUM_SQUARED_DIFFERENCE
TemplateMatcher
will account for the offset to the centre of the template internally.public static final TemplateMatcher.Mode CORRELATION
TemplateMatcher
will account for the offset to the centre of the template internally.public static final TemplateMatcher.Mode NORM_CORRELATION
TemplateMatcher
will account for the offset to the centre of the template internally.public static final TemplateMatcher.Mode CORRELATION_COEFFICIENT
TemplateMatcher
will account for the offset to the centre of the template internally.public static final TemplateMatcher.Mode NORM_CORRELATION_COEFFICIENT
TemplateMatcher
will account for the offset to the centre of the template internally.public static TemplateMatcher.Mode[] values()
for (TemplateMatcher.Mode c : TemplateMatcher.Mode.values()) System.out.println(c);
public static TemplateMatcher.Mode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullprotected abstract float computeMatchScore(FImage image, FImage template, int x, int y, Object workingSpace)
image
- The image.template
- The template.x
- The x-ordinate top-left of the template in the imagey
- The y-ordinate top-left of the template in the imageworkingSpace
- The working space created by #prepareWorkingSpace()public abstract float computeMatchScore(float[][] img, int x, int y, float[][] template, int templateX, int templateY, int templateWidth, int templateHeight)
img
- the image datax
- the x-ordinate of the top-left of the templatey
- the y-ordinate of the top-left of the templatetemplate
- the template datatemplateX
- the top-left x-ordinate of the template in the template datatemplateY
- the top-left y-ordinate of the template in the template datatemplateWidth
- the width of the template in the template datatemplateHeight
- the height of the template in the template datapublic abstract boolean scoresAscending()
protected FImage prepareTemplate(FImage template)
template
- the template imageprotected Object prepareWorkingSpace(FImage template)
template
- the templatecomputeMatchScore(FImage, FImage, int, int, Object)
method.