|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectviper.comparison.distances.AttrMeasure
Associates distance and metric with a specific type of attribute for a specific descriptor to Object Analysis type evaluation.
| Constructor Summary | |
AttrMeasure(Distance metric,
double tol)
Constructs a new measure with the given metric and localization threshold, with the default statistic and statistic tolerance. |
|
AttrMeasure(java.lang.String attr)
Gets the default measure for the attribute. |
|
AttrMeasure(java.lang.String attr,
java.util.StringTokenizer st)
Constructs a new measure by parsing the measure in text/epf format. |
|
| Method Summary | |
FrameSpan |
calculateDistancesAndThresh(Attribute target,
FrameSpan targetSpan,
Attribute candidate,
FrameSpan candSpan,
CanonicalFileDescriptor cfd,
DistanceHolder dh)
Calculate the distances between the two attributes using this attribute measure. |
double |
distanceAgainst(Measurable.Difference D)
Compares attributes or framespans by the metric this is set to use. |
double |
distanceAgainstDynamic(Attribute target,
FrameSpan gSpan,
Attribute candidate,
FrameSpan fSpan,
CanonicalFileDescriptor cfd)
compares two dynamic attributes |
boolean |
equals(java.lang.Object o)
Tests to see if this is the same kind of measure as the parameter. |
DistanceHolder |
getDistances()
Gets the current distances. |
Distance |
getMetric()
Gets the metric. |
double[] |
getStatistics()
Gets the current statistics |
double |
getStatThreshold()
Gets the threshold to apply on the given statstic to count as successfuly statisticked. |
int |
getStatType()
Gets the statistic type associated with the measure, e.g. |
double |
getTolerance()
Gets the localization tolerance. |
int |
hashCode()
Computes a hashcode on the metric, statistic, and thresholds. |
boolean |
isValidFor(java.lang.String attr)
Tests that this measure is valid for a given attribute. |
static boolean |
isValidMeasure(java.lang.String attr,
AttrMeasure meas)
Tests to see if the given measure is valid for the given attribute type. |
static boolean |
isValidTolerance(double value)
Tests to see if the tolerance is a valid number. |
void |
setMetric(Distance M)
Sets the metric. |
void |
setTolerance(double tol)
Sets the localization tolerance. |
boolean |
thresh(double value)
Determines if the given distance value is less than the current tolerance. |
java.lang.String |
toString()
Prints out the metric and threshold, without the brackets. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AttrMeasure(Distance metric,
double tol)
metric - the metrictol - the localization thresholdpublic AttrMeasure(java.lang.String attr)
attr - the attribute type
java.lang.IllegalStateException - if the default metric is null
public AttrMeasure(java.lang.String attr,
java.util.StringTokenizer st)
throws ImproperMetricException
[ metric threshold ].
attr - the attribute to apply tost - the text to parse
ImproperMetricException - if there is a parsing
error or a metric is not found| Method Detail |
public int getStatType()
Distances.MEDIAN.
public double getStatThreshold()
public boolean equals(java.lang.Object o)
o - the measure to test against
public int hashCode()
public java.lang.String toString()
(INFINITY)
metric threshold
public final void setTolerance(double tol)
tol - the new localization tolerancepublic final double getTolerance()
public final void setMetric(Distance M)
M - the new metricpublic final Distance getMetric()
public boolean thresh(double value)
value - the distance value (or score)
public FrameSpan calculateDistancesAndThresh(Attribute target,
FrameSpan targetSpan,
Attribute candidate,
FrameSpan candSpan,
CanonicalFileDescriptor cfd,
DistanceHolder dh)
throws MethodNotSupportedException
target - the target attributetargetSpan - the framespan of the target attribute's
descriptorcandidate - the candidate attributecandSpan - the framespan of the candidate attribute's
parent descriptorcfd - information about the media filedh - this will hold the computed distance information
MethodNotSupportedException - if there is an error
in the data types or in the metric
public double distanceAgainst(Measurable.Difference D)
throws MethodNotSupportedException
D - the difference comparison
Distance.getDistance(viper.descriptors.attributes.Measurable.Difference)method.
MethodNotSupportedExceptionpublic DistanceHolder getDistances()
calculateDistancesAndThresh(Attribute, FrameSpan, Attribute, FrameSpan, CanonicalFileDescriptor, DistanceHolder).public double[] getStatistics()
calculateDistancesAndThresh(Attribute, FrameSpan, Attribute, FrameSpan, CanonicalFileDescriptor, DistanceHolder).
public double distanceAgainstDynamic(Attribute target,
FrameSpan gSpan,
Attribute candidate,
FrameSpan fSpan,
CanonicalFileDescriptor cfd)
throws MethodNotSupportedException
target - the target attributegSpan - the target attribute spancandidate - the candidate attributefSpan - the candidate spancfd - the source media description
MethodNotSupportedExceptionpublic boolean isValidFor(java.lang.String attr)
attr - the attribute type to see if this metric is valid for
true if this measure is defined for the specified
attribute type
public static boolean isValidMeasure(java.lang.String attr,
AttrMeasure meas)
attr - the attribute typemeas - the measure
true when the measure
workspublic static boolean isValidTolerance(double value)
value - the tolerance
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||