An hidden Markov model based complex walking pattern recognition algorithm