**2.6 Graphical system**

In order to access the resources of the operating system, the mouse functionalities have been replaced by computing the end-effector position and by reading the signals coming from the buttons attached to the HD. Just after the real-time control is started, the system cursor is controlled, by using the mouse Win32 APIs, so that the contact point position is used to refresh cursor's position.

Fig. 13. The drawing interface window is shown.

As it was explained before, the contact position is computed by the real-time application and then, it is transferred to the shared memory. Then, the non-real time application developed with Visual C++, obtains the position and transform it to screen coordinates.

Training Motor Skills Using Haptic Interfaces 209

edges are s segmented using label connected components in a binary image (Haralick & Shapiro, 1992), subsequently its components that are not more longer than a minimum predefined size are erased. The remaining components are converted to one pixel wide curves applying on them the morphological thin operator (Haralick & Shapiro, 1992).

a) Original image file b) Processed Image "Trajectories"

c) Haptic and Visual Feedback d) Visual Feedback

Finally, the coordinates of the remaining objects (virtual templates) are converted to the HDS reference system controller and stored in a segment memory, which is shared with the HDS controller. The Figure 15a shows an example of original jpg image and Figure 15b

The GUI displays the processed images and assists to the user to interact with the templates. The application is controlled through four buttons, the first two (top to bottom, Figure 15c) acts like the left and right mouse buttons, the third cleans the screen and the fourth toggles the

Fig. 15. The HDS live a virtual tutor.

shows the results of the image processing.

Furthermore, the non-real time application displays an interactive drawing window where the user can draw any kind of shapes or write words by changing grasping the HI and by controlling the command buttons (Figure 13).
