Processing Raw Data

Raw data for recognition consists of pen coordinates. At a minimum, the recognizer must collect coordinate data while the pen is in contact with the tablet. Optionally, the recognizer can also process additional pen data such as pen pressure, the height of the pen tip above the pad, the angle of the pen, and the rotation of the pen. Not all pen devices can provide such information.

The Microsoft Handwriting Recognizer (GRECO.DLL) processes only coordinate data. The Pen API provides the OEMPENINFO structure for other types of pen data. For details, see the entry for OEMPENINFO in Chapter 11, "Pen Application Programming Interface Structures."

Noise Reduction and Normalization

To improve recognition, a recognizer can optionally employ noise reduction and normalization techniques. Noise reduction filters the input to weed out erroneous inputpics/PENAPI00090001.giffor example, pen skips, inadvertent marks from the user, or spurious noise from the input device.

Normalization corrects the natural skewing of handwritten text. In the same way that lines of text tend to run askew on blank paper, lines of pen input are usually not parallel to the top and bottom of the tablet. (An application can provide guidelines to help correct this tendency.)

Coordinates should be normalized relative to a horizontal line, called the baseline, that marks the bottom of the text. The baseline is analogous to a single line on lined notebook paper. Letter descenders, such as the lower parts of "y" or "j," descend below the baseline.

If a guide is present, its vertical coordinate defines the baseline. The baseline of a single-line guide in absolute coordinates is the sum of the yOrigin and cyBase members of the GUIDE structure. For more information, see the reference description of the GUIDE structure.

Allowed Time

The recognizer must return within the period of time specified by the dwTimeMax parameter of the ProcessHRC function. This parameter can have the values PH_MIN, PH_DEFAULT, or PH_MAX. Respectively, these values limit the time allowed for processing to approximately 50 milliseconds, 200 milliseconds, or as much time as required.

For values other than PH_MAX, the recognizer must ensure that it does not exceed the allotted time. The recognizer can either regularly poll with the GetTickCount function to mark the passage of time or, through the SetTimer function, provide a callback function that sets a time-out flag. The SREC sample recognizer described at the end of this chapter demonstrates the latter technique.

Allowed Number of Guesses

The recognizer must return no more than the maximum number of guesses specified by the SetMaxResultsHRC function. For a description of this function, see the "Number of Recognition Guesses" section in Chapter 5. By default, the recognizer returns only its best guess with no alternative guesses.

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
Unix Manual Pages
Delphi Examples