viper.comparison
Class CompFilter

java.lang.Object
  extended byviper.comparison.CompFilter

public abstract class CompFilter
extends java.lang.Object

Classes that implement this take in a CompMatrix and upgrade all comparisons that meet a certain criterion.


Field Summary
static CompFilter[] filterSelect
          Maps from matching type level numbers to function objects.
static int MULTIPLE
          This method of MultiMatching operates even and oddly stepping through options and trying to find a nice way of combining the candidates and targets to get the most general set of aggregate descriptors.
static java.lang.String[] name
          Names of the matching types, e.g.
static int NONE
          Don't do any match filtering.
static int SINGLE_GREEDY
          Match filtering 1 to 1, adding in a linear fashion.
static int SINGLE_OPTIMUM
          Match filtering 1 to 1, checking all possible permutation matrices.
 
Constructor Summary
CompFilter()
           
 
Method Summary
abstract  viper.comparison.Surreal filter(CompMatrix matrix, EvaluationParameters.ScopeRules scope)
          Runs the match filter on the set of comparisons.
static int getCroppingType(java.lang.String S)
          Gets the Cropping Type identified by the given string.
static java.lang.String matchFilterTitle(int filterType)
          Get the name of the matching type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Don't do any match filtering.

See Also:
Constant Field Values

SINGLE_GREEDY

public static final int SINGLE_GREEDY
Match filtering 1 to 1, adding in a linear fashion. Basically, go through and grabs the first best one for each row.

See Also:
CompMatrix.removeDuplicates(int), Constant Field Values

SINGLE_OPTIMUM

public static final int SINGLE_OPTIMUM
Match filtering 1 to 1, checking all possible permutation matrices.

See Also:
CompMatrix.removeDuplicates(int), Constant Field Values

MULTIPLE

public static final int MULTIPLE
This method of MultiMatching operates even and oddly stepping through options and trying to find a nice way of combining the candidates and targets to get the most general set of aggregate descriptors. That is, if the target says there are two columns, and the candidates say there are two rows, they will all merge to non-contiguous shapes that mark the basic area. The figure below shows this case:
 
 
          Target           Candidate
       +----------+     +----+  +---+
       | T1       |     | C1 |  |C2 |
       +----------+     |    |  |   |
                        |    |  |   |
       +----------+     |    |  |   |
       | T2       |     |    |  |   |
       +----------+     +----+  +---+
  
    
    	            Candidates   
               |  C1  |  C2  | C1+C2 |
      T  ------+------+------+-------+
      a    T1  | 0.62 | 0.58 |  0.47 |
      r  ------+------+------+-------+
      g    T2  | 0.62 | 0.58 |  0.47 |
      e  ------+------+------+-------+
      t  T1+T2 | 0.47 | 0.44 |  0.19 |
      s  ------+------+------+-------+
    (Distances are 1 - Dice Coefficient)
 
  
 

See Also:
Constant Field Values

name

public static final java.lang.String[] name
Names of the matching types, e.g. Single Optimum or Multiple.


filterSelect

public static final CompFilter[] filterSelect
Maps from matching type level numbers to function objects.

Constructor Detail

CompFilter

public CompFilter()
Method Detail

matchFilterTitle

public static final java.lang.String matchFilterTitle(int filterType)
Get the name of the matching type.

Parameters:
filterType - the level number for the matching type
Returns:
the name

getCroppingType

public static final int getCroppingType(java.lang.String S)
Gets the Cropping Type identified by the given string.

Parameters:
S - one of SINGLE-GREEDY, SINGLE-BEST, MULTIPLE or NONE
Returns:
the constant associated with the type name
Throws:
java.lang.IllegalArgumentException - if it isn't a recognized cropping type

filter

public abstract viper.comparison.Surreal filter(CompMatrix matrix,
                                                EvaluationParameters.ScopeRules scope)
Runs the match filter on the set of comparisons.

Parameters:
matrix - the comparisons to filter
scope - the rules and measurements to use
Returns:
the distance score