public class CornerFE extends Object implements FeatureExtractor
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_THRESH_DOT
The default dot product value for determining whether two
vectors form a corner.
|
static double |
DEFAULT_THRESH_MAG_RATIO
The default threshold ratio of a segment length to the entire
path length of the stroke.
|
static double |
DEFAULT_THRESH_RELAXED_DOT
If the dot product of two vectors is greater than
DEFAULT_THRESH_DOT but less than this parameter
(DEFAULT_THRESH_RELAXED_DOT), we identify this to be a likely
corner, and more checkings are performed on the two vectors to
verify.
|
static String |
PROPERTY_KEY
The key to access the cached corner property.
|
Constructor and Description |
---|
CornerFE()
Create a CornerFE with default parameters.
|
CornerFE(double magThresh,
double dotThresh,
double dotRelaxThresh)
Create a CornerFE with the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
double |
apply(TimedStroke s)
Return the number of corners in the specified stroke.
|
static int[] |
cornerIndices(TimedStroke s)
Return the indices where the corners occur in the given stroke.
|
static int[] |
cornerIndices(TimedStroke s,
double threshMagRatio,
double threshDot,
double threshRelaxedDot)
Return the indices where the corners occur in the given stroke.
|
String |
getName()
Return the name of this feature extractor.
|
static int |
numCorners(TimedStroke s)
Return the number of corners in the given stroke.
|
static int |
numCorners(TimedStroke s,
double threshMagRatio,
double threshDot,
double threshRelaxedDot)
Return the number of corners in the given stroke.
|
void |
setDotThreshold(double val)
Set the dot product threshold for determining whether two
vectors form a corner.
|
void |
setMagRatioThreshold(double val)
Set the magnitude ratio threshold.
|
void |
setRelaxedDotThreshold(double val)
If the dot product of two vectors is greater than _threshDot
but less than this parameter (_threshRelaxedDot), we identify
this to be a likely corner, and more checkings are performed on
the two vectors to verify.
|
public static final String PROPERTY_KEY
public static final double DEFAULT_THRESH_MAG_RATIO
public static final double DEFAULT_THRESH_DOT
public static final double DEFAULT_THRESH_RELAXED_DOT
public CornerFE()
public CornerFE(double magThresh, double dotThresh, double dotRelaxThresh)
public double apply(TimedStroke s)
First check to see if this feature already exists in the stroke's property table (access using PROPERTY_KEY). If so, return that value (cast to double). Otherwise call numCorners to compute and cache the result in the table.
apply
in interface FeatureExtractor
public static final int[] cornerIndices(TimedStroke s)
public static final int[] cornerIndices(TimedStroke s, double threshMagRatio, double threshDot, double threshRelaxedDot)
public String getName()
getName
in interface FeatureExtractor
public static final int numCorners(TimedStroke s)
public static final int numCorners(TimedStroke s, double threshMagRatio, double threshDot, double threshRelaxedDot)
public void setDotThreshold(double val)
public void setMagRatioThreshold(double val)
public void setRelaxedDotThreshold(double val)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.