edu.mit.sketch.ddg
Class ObjectDescription

java.lang.Object
  |
  +--edu.mit.sketch.ddg.ObjectDescription

public class ObjectDescription
extends Object

ObjectDescription is a representation of an object in the sketch as a set of primitives, subobjects and a constraints between them. Several parameters can be turned on and off. The object description will be constructed accordingly. If those parameters are changed, right now the object description does not preserve all the information, so you need to construct the object description again with the new parameters.

ObjectDescription.java Created: Sat Nov 20 19:43:00 2001


Field Summary
static boolean FIND_SUBOBJECTS
          Print the confidence and the relevance of the constraint, when printing out the constraint graph
static double LOW_CONFIDENCE_THRESHOLD
          Threshold for removing constraints with low confidence.
static boolean PRINT_DETAILS
          Print the confidence and the relevance of the constraint, when printing out the constraint graph
static boolean RATE_BY_RELEVANCE
          Some constraints are more relevant then others.
static boolean REMOVE_EXCLUSIVE
          Some constraints are exclusive in human perception (example: the lines either "meet" or "connect").
static boolean REMOVE_LOW_CONFIDENCE
          Remove constraints based on thresholding just on confidence.
static boolean REMOVE_REDUNDANT
          Remove constraints that can be geometrically derived from others because they are redundant.
static boolean REMOVE_UNCERTAIN
          Remove constraints based on thresholding on a combination of confidence and relevance of a constraint (confidence*relevance).
static double UNCERTAIN_THRESHOLD
          Threshold of uncertainty (confidence*relevance)
 
Constructor Summary
ObjectDescription(String name)
          Constructs an empty object description
ObjectDescription(Vector strokes, String name)
          Constructs the object description from and example drawn by the user.
 
Method Summary
 Vector constraints()
          Return the list of constraints for this object
 Constraint getConstraint(String name)
          Returns a certain constraint (given by name)
 String name()
          Name of the object
 Vector primitives()
          Return the list of primitives for this object
 HashMap primToGeomParts()
          Returns the correspondence of primitives to geom parts from the user example stroke that this description was based on
 void print()
          Print the description of the object.
 void recordSubobjects(Vector objects)
          Find in this object and record subobjects from a given list (of ObjectDescriptions).
 void removeExclusiveConstraints()
          Remove constraints that are perceptually exclusive.
 void removeLowConfidenceConstraints()
          Remove constraints that are below the LOW_CONFIDENCE_THRESHOLD in confidence
 void removeRedundantConstraints()
          Remove constraints that are redundant (derivable from others).
 void removeUncertainConstraints()
          Remove constraints that are below the UNCERTAIN_THRESHOLD in combined confidence and relevance
 Vector subobjectPrimitiveMappingAll(ObjectDescription target)
          Find ALL mapping between the primitives of this object and the primitives of the target template object, assuming that the target object is a subobject (Example: find a rectangle in the symbol for the house).
 Vector subobjects()
          Return the list of subobjects for this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RATE_BY_RELEVANCE

public static boolean RATE_BY_RELEVANCE
Some constraints are more relevant then others. Rate them. If set to false, all the constraints are rated to be 100% relevant

REMOVE_UNCERTAIN

public static boolean REMOVE_UNCERTAIN
Remove constraints based on thresholding on a combination of confidence and relevance of a constraint (confidence*relevance).

REMOVE_LOW_CONFIDENCE

public static boolean REMOVE_LOW_CONFIDENCE
Remove constraints based on thresholding just on confidence.

LOW_CONFIDENCE_THRESHOLD

public static double LOW_CONFIDENCE_THRESHOLD
Threshold for removing constraints with low confidence.

UNCERTAIN_THRESHOLD

public static double UNCERTAIN_THRESHOLD
Threshold of uncertainty (confidence*relevance)

REMOVE_EXCLUSIVE

public static boolean REMOVE_EXCLUSIVE
Some constraints are exclusive in human perception (example: the lines either "meet" or "connect"). Make constraints consistent with these exclusive rules.

REMOVE_REDUNDANT

public static boolean REMOVE_REDUNDANT
Remove constraints that can be geometrically derived from others because they are redundant.

PRINT_DETAILS

public static boolean PRINT_DETAILS
Print the confidence and the relevance of the constraint, when printing out the constraint graph

FIND_SUBOBJECTS

public static boolean FIND_SUBOBJECTS
Print the confidence and the relevance of the constraint, when printing out the constraint graph
Constructor Detail

ObjectDescription

public ObjectDescription(String name)
Constructs an empty object description

ObjectDescription

public ObjectDescription(Vector strokes,
                         String name)
Constructs the object description from and example drawn by the user. Type of Vector: StrokeInput
Method Detail

print

public void print()
Print the description of the object.

removeUncertainConstraints

public void removeUncertainConstraints()
Remove constraints that are below the UNCERTAIN_THRESHOLD in combined confidence and relevance

removeLowConfidenceConstraints

public void removeLowConfidenceConstraints()
Remove constraints that are below the LOW_CONFIDENCE_THRESHOLD in confidence

removeExclusiveConstraints

public void removeExclusiveConstraints()
Remove constraints that are perceptually exclusive. For example the lines either meet or connect.

removeRedundantConstraints

public void removeRedundantConstraints()
Remove constraints that are redundant (derivable from others).

getConstraint

public Constraint getConstraint(String name)
Returns a certain constraint (given by name)

recordSubobjects

public void recordSubobjects(Vector objects)
Find in this object and record subobjects from a given list (of ObjectDescriptions).

name

public String name()
Name of the object

primToGeomParts

public HashMap primToGeomParts()
Returns the correspondence of primitives to geom parts from the user example stroke that this description was based on

subobjectPrimitiveMappingAll

public Vector subobjectPrimitiveMappingAll(ObjectDescription target)
Find ALL mapping between the primitives of this object and the primitives of the target template object, assuming that the target object is a subobject (Example: find a rectangle in the symbol for the house). If the target is not a subobject return null. Otherwise rturn a list of all the found mappings Note: For now just looks for graph matches. So the stroke direction (P1, P2) have to be the same for both objects.

constraints

public Vector constraints()
Return the list of constraints for this object

primitives

public Vector primitives()
Return the list of primitives for this object

subobjects

public Vector subobjects()
Return the list of subobjects for this object