diva.sketch.toolbox
Class DashedPathRecognizer

java.lang.Object
  extended by diva.sketch.toolbox.DashedPathRecognizer
All Implemented Interfaces:
SceneRecognizer

public class DashedPathRecognizer
extends Object
implements SceneRecognizer

This recognizer recognizes dashed paths from sessions of individual strokes. It first checks to make sure that every stroke in the session is a straight line, then checks to see whether the stroke lengths are equal across strokes and whether endpoints of adjacent strokes are close to equidistant across all the strokes. If this check passes, it makes the segments into a path, and then runs a filter on the path to clean it up. It also saves out the average stroke length and the average distance between strokes.

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

Field Summary
static double DEFAULT_ANGLE_THRESH
          The default tolerance for the maximum angle error over the sum of the edges of the polygon.
static double DEFAULT_DIST_THRESH
          The default tolerance for the maximum distance squared between endpoints of lines.
static double DEFAULT_MIN_CONFIDENCE
          The default tolerance for the minimum allowable line confidence per stroke.
 
Constructor Summary
DashedPathRecognizer(SceneRecognizer child)
          Construct a dashed path recognizer with the given child recognizer and the default threshold values DEFAULT_DIST_THRESH, DEFAULT_ANGLE_THRESH, DEFAULT_MIN_CONFIDENCE.
DashedPathRecognizer(SceneRecognizer child, double distThresh, double angleThresh, double minConf)
          Construct a polygon recognizer with the given child recognizer that transitively invokes low-level recognition, as well as threshold tolerances for the maximum distance squared between endpoints, the maximum angle error over the polygon, and the minimum "line" confidence for each stroke in the polygon.
 
Method Summary
 SceneDeltaSet sessionCompleted(StrokeElement[] session, Scene db)
          Test whether the given strokes make a dashed path.
 SceneDeltaSet strokeCompleted(StrokeElement stroke, Scene db)
           
 SceneDeltaSet strokeModified(StrokeElement stroke, Scene db)
           
 SceneDeltaSet strokeStarted(StrokeElement stroke, Scene db)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DIST_THRESH

public static final double DEFAULT_DIST_THRESH
The default tolerance for the maximum distance squared between endpoints of lines.

See Also:
Constant Field Values

DEFAULT_ANGLE_THRESH

public static final double DEFAULT_ANGLE_THRESH
The default tolerance for the maximum angle error over the sum of the edges of the polygon.

See Also:
Constant Field Values

DEFAULT_MIN_CONFIDENCE

public static final double DEFAULT_MIN_CONFIDENCE
The default tolerance for the minimum allowable line confidence per stroke.

See Also:
Constant Field Values
Constructor Detail

DashedPathRecognizer

public DashedPathRecognizer(SceneRecognizer child)
Construct a dashed path recognizer with the given child recognizer and the default threshold values DEFAULT_DIST_THRESH, DEFAULT_ANGLE_THRESH, DEFAULT_MIN_CONFIDENCE.

See Also:
DashedPathRecognizer(SceneRecognizer, double, double, double)

DashedPathRecognizer

public DashedPathRecognizer(SceneRecognizer child,
                            double distThresh,
                            double angleThresh,
                            double minConf)
Construct a polygon recognizer with the given child recognizer that transitively invokes low-level recognition, as well as threshold tolerances for the maximum distance squared between endpoints, the maximum angle error over the polygon, and the minimum "line" confidence for each stroke in the polygon.

Method Detail

strokeStarted

public SceneDeltaSet strokeStarted(StrokeElement stroke,
                                   Scene db)
Specified by:
strokeStarted in interface SceneRecognizer

strokeModified

public SceneDeltaSet strokeModified(StrokeElement stroke,
                                    Scene db)
Specified by:
strokeModified in interface SceneRecognizer

strokeCompleted

public SceneDeltaSet strokeCompleted(StrokeElement stroke,
                                     Scene db)
Specified by:
strokeCompleted in interface SceneRecognizer

sessionCompleted

public SceneDeltaSet sessionCompleted(StrokeElement[] session,
                                      Scene db)
Test whether the given strokes make a dashed path. If so, add it to the scene database.

Specified by:
sessionCompleted in interface SceneRecognizer


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