Skip to main content

Preprocessed-Data Input Format

There are a variety of processes that can be applied to raw tablet data before it is transmitted to the requesting program. For instance, when the tablet is "noisy" or jittery, various smoothing algorithms may be applied. The most common of these is some form of weighted, clumped or moving average. At SDC, we have settled on an 8-point moving average when smoothing is desirable. Another fairly common form of preprocessing is "thinning" or filtering to remove unnecessary or redundant data points. Depending on the end use of the data, filter "windows" can have a variety of geometries, including square, rectangular, diamond, and circular, and the filter may be single or double windowed. SDC currently uses a single square window filter on all tablet input. The window size is a variable and may be set to zero, thus, eliminating the filter.

Logically, the filter may be described as:

      Take (X,Y) if |Xp - X| >= w or |Yp - Y| >= w is true

where: (X,Y) is the current data point, (Xp,Yp) is the previously accepted data point that either passed the filter or was the first point of the stroke, and w is the window size.

Pictorially, this can be represented as:

         ---- +-------------+-----
^ | | ^
| | | |
| | W
2W | Xp, Yp __|__v__
| |
| | |
v | |
-----+-------------+
| <-- 2W --> |

Any point inside the square will be rejected, any point on the boundary or beyond is accepted and becomes (Xp,Yp). In addition to smoothing and filtering, we have found it necessary that our character recognition algorithms be able to estimate the velocity along the path of the stroke. Therefore in addition to saving the X, Y coordinates that pass the filter (smoothing, if done, precedes filtering and is done on the raw points), we count and store the number of rejected points between the saved ones. Since the data-tablet input is synchronous, the count times the sampling rate divided into the distance between adjacent points is a sufficient approximation for our purposes. Our character-generator also requires the rectangle surrounding a stroke (defined by the minimum and maximum values of X and Y in the stroke); this information is very easy to generate during preprocessing.

Assuming that other Network nodes wanted to use SDC's tablet graphic software--the character recognizer in particular--we would have to know what, if any, preprocessing was done to the input data before it was sent. Our suggested format for this from of tablet data, then, is:

  • Byte 0: Data tablet op code
  • Byte 1: Type, 3 = preprocessed
  • Byte 2: Flags
  • Byte 3: Scale of deltas
  • Byte 4: Sampling rate if synchronous (as indicated by flag)
  • Byte 5: Window Size
  • Byte 6-7: Number of Points
  • Byte 8-9: 1st X-coordinate
  • Byte 10-11: 1st Y-coordinate
  • Byte 12-13: Minimum value of X in the stroke
  • Byte 14-15: Minimum value of Y in the stroke
  • Byte 16-17: Minimum value of X in the stroke
  • Byte 18-19: Minimum value of Y in the stroke

Editor's note: The original text labels both the Byte 12-15 pair and the Byte 16-19 pair as "Minimum value"; by the surrounding definition of the stroke rectangle, the second pair is evidently meant to be the maximum values.

Two forms follow from here, depending upon another flag:

        Counts included         and       Counts deleted

Byte 20: delta X1 Byte 20: delta X1

Byte 21: delta Y1 Byte 21: delta Y1

Byte 22: rejected point count1

Byte 3n+20: delta Xn Byte 2n+20: delta Xn

Byte 3n+21: delta Xn Byte 2n+21: delta Yn

Byte 3n+22: RPCn
  • Counts included
8  8   8     8     8     8      16    16   16   16    16    16    16
--+-+-----+-----+-----+------+------+----+----+-----+-----+-----+-----+
|3|Flags|Scale|Rate |Window| # | X0 | Y0 |Xmin|Ymin |Xmax |Ymax |
| | | | | Size |points| | | | | | |
--+-+-----+-----+-----+------+------+----+----+-----+-----+-----+-----+
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

8 8 8 8 8 8
-----+-----+-----+-//-----+-----+-----+
delta|delta| RCP1| //delta|delta| RCPn|
X1 |Y1 | | Xn | Yn | |
-----+-----+-----+-//-----+-----+-----+
20 21 22 20 21 22

Counts Included
  • Counts deleted
8  8   8     8     8     8      16    16   16   16    16    16    16
--+-+-----+-----+-----+------+------+----+----+-----+-----+-----+-----+
Op|3|Flags|Scale|Rate |Window| # | X0 | Y0 |Xmin |Ymin |Xmax |Ymax |
| | | | | Size |points| | | | | | |
--+-+-----+-----+-----+------+------+----+----+-----+-----+-----+-----+
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

8 8 8 8 8
-----+-----+-----+ +-----+-----+
delta|delta|delta|...|delta|delta|
X1 |Y1 | X2 | |Xn |Yn |
-----+-----+-----+ +-----+-----+
20 21 22 2n+20 2n+21

Counts deleted

The flags in this format not only indicated whether or not the data is synchronous and whether the counts are present, but may also be used to indicate whether or not the data was smoothed and the type of filtering.