To effectively capture the dynamic information of the gait and accelerate the authentication and identification, a novel gait recognition algorithm was presented in this paper, which employed the row mass vector of the Frame Difference Energy Image (FDEI) as the gait features. The gait contour images were extracted through the object detection, binarization, morphological process and connectivity analysis of the original images. Using the width of the contour images sequence, the quasi-periodicity analysis and the row mass vector of the frame difference image were obtained, then the Continuous Hidden Markov Model (CHMM) was employed to train and recognize the parameters of model. The proposed algorithm was applied to Central Asia Student International Academic (CASIA) gait database. The experimental results show that it can easily extract the features of the gait with low dimension, achieving fast recognition speed and high recognition rate, so it can be used for real-time gait recognition.