diva.sketch.recognition
Class VotingSceneRecognizer

java.lang.Object
  extended by diva.sketch.recognition.VotingSceneRecognizer
All Implemented Interfaces:
SceneRecognizer

public class VotingSceneRecognizer
extends Object
implements SceneRecognizer

A composite recognizer which allows multiple sub-recognizers to vote on interpretations of a given scene. This recognizer basically utilizes the same heuristics as VotingStrokeRecognizer, but applies to scene elements instead of strokes for high-level recognition.

Version:
$Revision: 1.6 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)
See Also:
VotingStrokeRecognizer

Field Summary
static int ALL_VOTES
          A constant which says that votes are not filtered by the "n-highest" rule.
 
Constructor Summary
VotingSceneRecognizer(SceneRecognizer[] children)
          Construct a voting recognizer with the following child recognizers.
 
Method Summary
 List children()
          Return the children as a list.
 void clearBuffer()
          Clear the buffer after every stroke finishes by setting every entry in the buffer to NO_DELTA.
 double getMinConfidence()
          Return the minimum confidence value which is necessary for a type to get considered in the vote.
 int getNHighest()
          Return the "n-highest" value, which says that the n-highest classifications will get passed on when the child recognizers vote.
 SceneDeltaSet sessionCompleted(StrokeElement[] session, Scene db)
          Pass the event to the child recognizers, tally the vote, clear the buffer, and return the consensus.
 void setMinConfidence(double val)
          Set the minimum confidence classifications that will get passed on when the child recognizers vote.
 void setNHighest(int n)
          Set the "n-highest" value, which says that the n-highest classifications will get passed on when the child recognizers vote.
 SceneDeltaSet strokeCompleted(StrokeElement s, Scene db)
          Pass the event to the child recognizers, tally the vote, clear the buffer, and return the consensus.
 SceneDeltaSet strokeModified(StrokeElement s, Scene db)
          Pass the event to the child recognizers, tally the vote, and return the consensus.
 SceneDeltaSet strokeStarted(StrokeElement s, Scene db)
          Pass the event to the child recognizers, tally the vote, and return the consensus.
protected  SceneDeltaSet vote()
          Tally all of the votes of the sub-recognizers and emit them all into a recognition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL_VOTES

public static int ALL_VOTES
A constant which says that votes are not filtered by the "n-highest" rule.

See Also:
setNHighest(int)
Constructor Detail

VotingSceneRecognizer

public VotingSceneRecognizer(SceneRecognizer[] children)
Construct a voting recognizer with the following child recognizers.

Method Detail

clearBuffer

public void clearBuffer()
Clear the buffer after every stroke finishes by setting every entry in the buffer to NO_DELTA.


children

public List children()
Return the children as a list.


getMinConfidence

public double getMinConfidence()
Return the minimum confidence value which is necessary for a type to get considered in the vote.


getNHighest

public int getNHighest()
Return the "n-highest" value, which says that the n-highest classifications will get passed on when the child recognizers vote.


setMinConfidence

public void setMinConfidence(double val)
Set the minimum confidence classifications that will get passed on when the child recognizers vote. The default value is 0, meaning that classifications are not filtered.


setNHighest

public void setNHighest(int n)
Set the "n-highest" value, which says that the n-highest classifications will get passed on when the child recognizers vote. The default value is ALL_VOTES, which means that all votes are passed on. The value N must be greater than or equal to zero.


sessionCompleted

public SceneDeltaSet sessionCompleted(StrokeElement[] session,
                                      Scene db)
Pass the event to the child recognizers, tally the vote, clear the buffer, and return the consensus.

Specified by:
sessionCompleted in interface SceneRecognizer

strokeCompleted

public SceneDeltaSet strokeCompleted(StrokeElement s,
                                     Scene db)
Pass the event to the child recognizers, tally the vote, clear the buffer, and return the consensus.

Specified by:
strokeCompleted in interface SceneRecognizer

strokeModified

public SceneDeltaSet strokeModified(StrokeElement s,
                                    Scene db)
Pass the event to the child recognizers, tally the vote, and return the consensus.

Specified by:
strokeModified in interface SceneRecognizer

strokeStarted

public SceneDeltaSet strokeStarted(StrokeElement s,
                                   Scene db)
Pass the event to the child recognizers, tally the vote, and return the consensus.

Specified by:
strokeStarted in interface SceneRecognizer

vote

protected SceneDeltaSet vote()
Tally all of the votes of the sub-recognizers and emit them all into a recognition. Subclasses can override this method to change the voting behavior/strategy. Return NO_DELTA if the vote comes up empty. This method implements the N-highest and min-confidence heuristics, described in the getNHighest() and getMinConfidence() method descriptions.

See Also:
getNHighest(), getMinConfidence()


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.