This paper represents a hand shapes recognition system for the Human Machine Interaction (HMI) with service robot of disable people. This system uses a touchpad to precept the touching of fingers, as well as to provide a background for hand shapes image. Each finger can stay in one of the 4 statuses: stretch- touching on the pad, retracting-touching on the pad, stretch-detaching over the pad and retracting-detaching over the pad. Hand shapes, posed to express HMI instructions, are defined by the status combinations of Index finger, Middle finger, Ring finger and Little finger. Hand shape features, the relative heights of the fingertips, are extracted through the singularity detection with wavelet transform on hand shape contour. The hand shape recognition of this system is based on an optimized Bayesian decision binary tree. The design of 2 types of classifier in the tree and the corresponding error rates of the classifiers are analyzed. Implemented by a DSP processor, a correctness ratio of over 98% is obtained in the identification of 12 hand shapes. Experiments show that this system can provide a flexible, humanized and expendable HMI for service robot, as well as for other applications.