diva.sketch.recognition
Interface Scene

All Known Implementing Classes:
BasicScene

public interface Scene

A scene database that keeps track of multiple interpretations of a set of strokes. Groups of strokes are stored hierarchically, and these also have multiple interpretations. There are also choice elements that represent a mutually exclusive choice between objects of the same type that use the same type. Using this data structure, a client can view all of the interpretations of the scene and perform efficient operations to filter interpretations.

Version:
$Revision: 1.16 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu)

Method Summary
 CompositeElement addComposite(TypedData data, double confidence, SceneElement[] children, String[] names)
          Add a new composite element to the database and return it.
 StrokeElement addStroke(TimedStroke stroke)
          Add a new stroke element to the database.
 List choices()
          Return a list of all of the choices contained in the scene.
 void confirm(CompositeElement elt, boolean makeChoices)
          Accept the given interpretation of the set of strokes that the given element covers as the correct interpretation of those strokes.
 List elementsOfType(Type type, CompositeElement elt)
          Find the elements in the scene with the given type that do not contradict the given element, and return them as a list.
 boolean isConsistent(SceneElement e1, SceneElement e2)
          Return whether or not the two elements are consistent, that is, whether the leaf nodes that they span are strictly disjoint.
 boolean isCoveringAll(SceneElement elt)
          Return whether or not this element covers all of the leaves.
 void removeElement(SceneElement elt)
          Remove an element from the database.
 List roots()
          Return a list of every root node in the database, i.e.
 List strokes()
          Return a list the stroke elements of the scene in the order that they were added to the database.
 

Method Detail

addComposite

CompositeElement addComposite(TypedData data,
                              double confidence,
                              SceneElement[] children,
                              String[] names)
Add a new composite element to the database and return it. This element will appear in the roots() iterator until it is added as a child of another composite node, or until it is removed from the database. This method will return null if a pre-existing choice node is used, in which case no node was actually added to the database.

Parameters:
data - The typed data associated with the composite.
confidence - The confidence of recognition, between 0 and 1.
children - The children of this element in the tree.
names - The names of the children.

addStroke

StrokeElement addStroke(TimedStroke stroke)
Add a new stroke element to the database. This element will appear in the strokes() iterator until it is removed from the database.


choices

List choices()
Return a list of all of the choices contained in the scene. This list will only have choice elements that contain more than one choice.


confirm

void confirm(CompositeElement elt,
             boolean makeChoices)
Accept the given interpretation of the set of strokes that the given element covers as the correct interpretation of those strokes. This implies that all elements in the scene that contradict this interpretation are incorrect interpretations, so these interpretations are removed.

Parameters:
elt - The interpretation to confirm
makeChoices - Whether or not to confirm the existing choice nodes at or under elt.

elementsOfType

List elementsOfType(Type type,
                    CompositeElement elt)
Find the elements in the scene with the given type that do not contradict the given element, and return them as a list. (FIXME- ordered by relevance?)

Parameters:
type - The type of elements that will be returned.
element - The elements that the returned set must be consistent with, or null if it doesn't matter.
Returns:
A list of scene elements that match the query.
See Also:
isConsistent(SceneElement, SceneElement)

isCoveringAll

boolean isCoveringAll(SceneElement elt)
Return whether or not this element covers all of the leaves. An element covers a leaf if the leaf is a descendent of the element.


isConsistent

boolean isConsistent(SceneElement e1,
                     SceneElement e2)
Return whether or not the two elements are consistent, that is, whether the leaf nodes that they span are strictly disjoint.


removeElement

void removeElement(SceneElement elt)
Remove an element from the database. This will also trigger the removal of every element that depends on the given element.


roots

List roots()
Return a list of every root node in the database, i.e. all top-level scene interpretations, from high to low confidence. This iterator may contain composite elements or choice elements; it will not contain strokes.


strokes

List strokes()
Return a list the stroke elements of the scene in the order that they were added to the database.



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