SAMPLE: Simple Training Techniques for a Recognizer

ID: Q99797

The information in this article applies to:

SUMMARY

The following information concerns the Microsoft Windows for Pen Computing sample Training Emulator, version 1 (TrainInk).

There is a sample called TRAINEM in the Microsoft Software Library. This Windows for Pen Computing sample demonstrates how to do simple training on a trainable handwriting recognizer. The sample utilizes the TrainInk application programming interface (API) to do the training.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ Trainem.exe (size: 24845 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE : How to Obtain Microsoft Support Files from Online Services

Trainem.exe is a Windows for Pen Computing version 1.0 sample, which can be run on any Windows version 3.1 or Windows for Workgroups machine that has the Pen Extensions installed [from the Microsoft Windows 3.1 Software Development Kit (SDK) or Visual C++ Development Kit.]

On a system that is running only the Pen Extensions and not the full Windows for Pen Computing environment, the virtual keyboard executable may not be present (SKB.EXE on U.S. systems) such that the ShowKeyboard call cannot bring up the virtual keyboard. In this case, when the Keyboard button is pressed, a dialog box will be displayed informing the user that the virtual keyboard could not be started.

Trainem.exe demonstrates one of the training APIs used in training handwriting in a recognizer. The TrainInk API is the simpler of the two training APIs available; however, using it requires knowledge of recognizers and what they are capable of doing. Therefore, Trainem.exe also demonstrates querying a recognizer to determine whether it is capable of being trained; if so, the sample demonstrates the limitations of that training.

Trainem.exe also demonstrates one method of capturing ink for training, and displays an interface that a user can use to view that ink and train it to the correct value. Note that during this process, ink can be captured and saved from an hedit or bedit control, and textual information can be retrieved with ordinary window messages.

As written, Trainem.exe requires the Microsoft default recognizer, also known as the Roman recognizer, MARS. Note that the ConfigRecognizer call is resident in the recognizer code itself and must be imported explicitly in the .DEF file. In the more general case, not dealt with in this sample, an application could install the recognizer at run time or query for the current recognizer and obtain a pointer to the needed function. This sample uses the more direct and easier method, though not necessarily the most robust method.

The sample also requires that some action be taken after a recognition session has taken place in the main hedit control on the main window. The user must choose either the Reset Hedit button or the Train button before further recognition sessions are allowed in the control. The control is disabled until training has taken place or until the control is reset.

This method was used to avoid losing track of the correct ink to train in the hedit control. More sophisticated training programs might explore algorithms that allow for tracking multiple recognition sessions, and bring up the appropriate result and original ink on request for training. This sample is a simple demonstration of the basics required for training a recognizer; more sophisticated algorithms for handling multiple recognition sessions are beyond its scope.

Additional query words: softlib TRAINEM.EXE KBCategory: kbprg kbfile KBSubcategory: WpenTrain

Keywords          : WpenTrain 
Version           : 1.00
Platform          : WINDOWS

Last Reviewed: December 11, 1998