viper.comparison.distances
Interface Distance

All Known Subinterfaces:
AttrDistance, MeasureDistance
All Known Implementing Classes:
Distances.HelperAttrDistance, viper.comparison.distances.Distances.HelperDistance, Distances.HelperMeasureDistance

public interface Distance

Like Filterable, Distances are a way of associating distance with data. Don't implement this directly - instead use MeasureDistance or AttrDistance


Field Summary
static int BALANCED
          A balanced distance metric gives the same result if compared target to candidate or candidate to target.
static int CAND_V_TARGS
          For framewise comparison, this type compares one candidate to all targets.
static int OVERALL_MEAN
          This metric is meant to be averaged over all frames or media files.
static int OVERALL_SUM
          Like number of pixels detected, this type of metric is meant to be summed over all frames or source files.
static int TARG_V_CANDS
          The reverse of cand v targs, this type indicates one target against all candidates composed.
 
Method Summary
 java.lang.Number getDistance(Measurable.Difference D)
          Gets the distance using cached distance data.
 java.lang.String getExplanation()
          An explanatory message, like "Pixels matched", or "Localized Object Count Recall".
 int getType()
          Get what type of metric this is, per the list of static int types.
 boolean isDistance()
          Determines if this is a distance or a similarity quotient.
 java.lang.String toString()
          Get the EPF name of the metric.
 

Field Detail

OVERALL_SUM

public static final int OVERALL_SUM
Like number of pixels detected, this type of metric is meant to be summed over all frames or source files.

See Also:
Constant Field Values

OVERALL_MEAN

public static final int OVERALL_MEAN
This metric is meant to be averaged over all frames or media files.

See Also:
Constant Field Values

CAND_V_TARGS

public static final int CAND_V_TARGS
For framewise comparison, this type compares one candidate to all targets. These types are averaged over all frames and candidates.

See Also:
Constant Field Values

TARG_V_CANDS

public static final int TARG_V_CANDS
The reverse of cand v targs, this type indicates one target against all candidates composed.

See Also:
Constant Field Values

BALANCED

public static final int BALANCED
A balanced distance metric gives the same result if compared target to candidate or candidate to target.

See Also:
Constant Field Values
Method Detail

getExplanation

public java.lang.String getExplanation()
An explanatory message, like "Pixels matched", or "Localized Object Count Recall".

Returns:
this distance's explanatory message

getType

public int getType()
Get what type of metric this is, per the list of static int types.

Returns:
one of BALANCED, CAND_V_TARGS, etc.

toString

public java.lang.String toString()
Get the EPF name of the metric.

Returns:

getDistance

public java.lang.Number getDistance(Measurable.Difference D)
Gets the distance using cached distance data. Has two major benefits: possible consolidation of IgnoredValueExceptions and savings on recomputing, for example, the area of polygons. Calling getDistance (alpha, beta, blackout, ignore) should have the same effect as getDistance (alpha.getDifference (beta, blackout, ignore))

Parameters:
D - the distance of the difference
Returns:
the distance

isDistance

public boolean isDistance()
Determines if this is a distance or a similarity quotient. Similarity quotients are better the larger they are, but distances should be minimized.

Returns:
true when 0 indicates a perfect match, and distance varies proportionally to difference