|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.mit.sketch.ddg.ObjectDescription
public class ObjectDescription
ObjectDescription is a representation of an object in the sketch as a set of primitives, subobjects and a constraints between them.
The object description stores several levels of description hypotheses. This allows preserving the initial information
so that the description could evolve with addition of more data.
Levels:
Raw Strokes - the original drawing example/examples
Initial constraints - all the constraints originally inferred, with their initial confidence and relevance values
HighConfidence constraints - original constraints filtered by confidence (what we decide is present in the drawing)
HighRelevanceConstraints - high confidence constraints filtered by relevance (what we decide is the essence of the figure)
Subobjects - higer level constraints inferred from highRelevanceConstraints.
Eventually there should be other higher level constraints added like "inside" or "overlaps", and others that are applied to whole
shapes, rather than low-level constraints. Also a further level of representation would be a minimal constraint list that is
mathematically equivalent to the highRelevanceConstraints. That list will be arrived at by geometrical reasoning. This stuff
is to be implemented later.
Needed Improvements:
Now the group constrains are recorded in the separate group constraint list in the function that finds groups. Only highly relevant
constraints are retained. Need to retain the initial confidence and relevance too.
Need to think how to encorporate the group constraints
into the search for subobjects. Right now subobject search does not look at those constraints in either object.
Object description should be eventually separated from the reasoning support for it. These should probably be two different classes.
| Field Summary | |
|---|---|
static double |
BETWEEN_TENSION_LINES_RELEVANCE_RATING
The larger the constant, the more the relevance of same-length constraint goes up for two primitives that are between two horizontal or vertical tension lines. |
static double |
DEFAULT_CONFIDENCE_THRESHOLD
Threshold for removing constraints with low confidence. |
static java.lang.String |
DEFAULT_NAME
Default name for the object if the name was not given |
static double |
DEFAULT_RELEVANCE_THRESHOLD
Threshold for removing constraints with low relevance. |
static int |
DEFAULT_STARTING_INDEX
Default index that primitives labelled from (for example 0 or 1) |
static double |
INTERFERENCE_STRENGTH
The larger the constant, the less the fall-off of the interference of lines with distance |
| Constructor Summary | |
|---|---|
ObjectDescription()
Constructs an empty object description |
|
ObjectDescription(java.lang.String name)
Constructs an empty object description with a given name. |
|
| Method Summary | |
|---|---|
ConstraintList |
allConstraints()
Get all the final constraints - the final decision, icluding all the constraints in all subobjects, recursively. |
ConstraintList |
constraints()
Get final constraints - the final decision. |
java.util.Vector |
findConnectedComponents(ConstraintList constraints)
Find all connected components in this object, given a constraint list to work on. |
void |
findTensionLines(ConstraintList constraints)
Find and record the tension lines that are present in the object |
void |
generateDescription(java.util.Vector strokes,
DomainDescription domainDescription)
Generate object description. |
ConstraintList |
groupConstraints()
Get the group constraints |
GroupingTree |
grouping()
Get Grouping tree |
java.lang.String |
name()
Name of the object |
boolean |
orientationMatters()
Return whether this object can be in any orientation |
PrimitiveList |
primitives()
Return the primitives in this object |
java.util.HashMap |
primToGeomParts()
Returns the correspondence of primitives to geom parts from the user example stroke that this description was based on |
void |
print(java.io.PrintStream out,
boolean printDetails,
boolean printInitial,
boolean printHighConfidence,
boolean printHighRelevance,
boolean printGroups,
boolean printNonRedundant,
boolean printSubobjects)
Print the description of the object, given an output stream. |
void |
printObjectParameters(java.io.PrintStream out)
Print all the object parameters used in the computation |
void |
printObstruction(java.io.PrintStream out)
Print the obstruction matrix for the symbol |
void |
printProximity(java.io.PrintStream out)
Print the proximity matrix for this symbol |
boolean |
sameAs(ObjectDescription object,
java.util.Vector mappingList)
Determines whether a given object is the same as the other one. |
void |
setConstraints(ConstraintList constraints)
Set high confidence constraints |
void |
setGroupConstraints(ConstraintList constraints)
Set the group constraints |
void |
setGrouping(GroupingTree tree)
set Grouping tree |
void |
setName(java.lang.String name)
Set the name of the object |
void |
setOrientationMatters(boolean value)
Set whether this object can be in any orientation |
void |
setPrimitives(PrimitiveList primitives)
Set the primitives of the object description |
java.util.Vector |
strokes()
Get the strokes of the original example |
java.util.Vector |
subobjectPrimitiveMapping(ConstraintList targetConstraints,
ConstraintList dataConstraints,
boolean exactMatch,
java.util.Vector relabelLists,
java.util.Vector nonRelabelLists)
Find ALL mappings 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). |
java.util.Vector |
subobjects()
Get subobjects |
TensionLineList |
tensionLines()
Return the tension lines |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_CONFIDENCE_THRESHOLD
public static double DEFAULT_RELEVANCE_THRESHOLD
public static final java.lang.String DEFAULT_NAME
public static final int DEFAULT_STARTING_INDEX
public static double INTERFERENCE_STRENGTH
public static double BETWEEN_TENSION_LINES_RELEVANCE_RATING
| Constructor Detail |
|---|
public ObjectDescription()
public ObjectDescription(java.lang.String name)
| Method Detail |
|---|
public void generateDescription(java.util.Vector strokes,
DomainDescription domainDescription)
public void findTensionLines(ConstraintList constraints)
public java.util.Vector findConnectedComponents(ConstraintList constraints)
public void printObstruction(java.io.PrintStream out)
public void printProximity(java.io.PrintStream out)
public void print(java.io.PrintStream out,
boolean printDetails,
boolean printInitial,
boolean printHighConfidence,
boolean printHighRelevance,
boolean printGroups,
boolean printNonRedundant,
boolean printSubobjects)
public void printObjectParameters(java.io.PrintStream out)
public java.lang.String name()
public void setName(java.lang.String name)
public PrimitiveList primitives()
public void setPrimitives(PrimitiveList primitives)
public java.util.HashMap primToGeomParts()
public java.util.Vector strokes()
public ConstraintList constraints()
public ConstraintList allConstraints()
public void setConstraints(ConstraintList constraints)
public ConstraintList groupConstraints()
public void setGroupConstraints(ConstraintList constraints)
public TensionLineList tensionLines()
public GroupingTree grouping()
public void setGrouping(GroupingTree tree)
public boolean orientationMatters()
public void setOrientationMatters(boolean value)
public java.util.Vector subobjects()
public boolean sameAs(ObjectDescription object,
java.util.Vector mappingList)
public java.util.Vector subobjectPrimitiveMapping(ConstraintList targetConstraints,
ConstraintList dataConstraints,
boolean exactMatch,
java.util.Vector relabelLists,
java.util.Vector nonRelabelLists)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||