Representation of a recording of on-line handwritten data. On-line means that the pen trajectory is given (and not online as in ‘Internet’).
Represents a handwritten symbol.
Count all strokes of this recording that have only a single dot.
Get a list of features.
Every algorithm has to return the features as a list.
Some recordings have wrong times. Fix them so that nothing after loading a handwritten recording breaks.
Get the area in square pixels of the recording.
Get a bitmap of the object at a given instance of time. If time is None,`then the bitmap is generated for the last point in time.
Parameters: | time : int or None size : int
store_path : None or str
|
---|---|
Returns: | numpy array :
|
Get the bounding box of a pointlist.
Get a tuple (x,y) that is the center of mass. The center of mass is not necessarily the same as the center of the bounding box. Imagine a black square and a single dot wide outside of the square.
Get the height of the rectangular, axis-parallel bounding box.
Get a list of lists of tuples from JSON raw data string. Those lists represent strokes with control points.
Returns: | list :
|
---|
Make sure that the points and strokes are in order.
Get the time in which the recording was created.
Get the width of the rectangular, axis-parallel bounding box.
Apply preprocessing algorithms.
Parameters: | algorithms : a list objects
|
---|
Examples
>>> import preprocessing
>>> a = HandwrittenData(...)
>>> preprocessing_queue = [(preprocessing.scale_and_shift, []),
... (preprocessing.connect_strokes, []),
... (preprocessing.douglas_peucker,
... {'EPSILON': 0.2}),
... (preprocessing.space_evenly,
... {'number': 100,
... 'KIND': 'cubic'})]
>>> a.preprocessing(preprocessing_queue)
Overwrite pointlist.
Parameters: | pointlist : a list of strokes; each stroke is a list of points
|
---|
Show the data graphically in a new pop-up window.
Convert this HandwrittenData object into a list of HandwrittenData objects. Each element of the list is a single symbol.
Returns: | list of HandwrittenData objects |
---|