Head gesture is one kind of body language which is often used to communicate among people. Developing a good head gesture recognition system will let the user interface more humanistic. In this technology, wi achieve a head gesture recognition system with principal component analysis (PCA), the Gaussian mixture model (GMM), and the hidden Markov model (HMM) for the recognition of head nodding and shaking. The testing database includes 50 video segments with challenging characteristics such as white balance, non-uniform head movements, occlusion, and variations of face expressions. This technology has high recognition rate verified through the testing database.