Statistical Models On Human Shapes With Application To Bayesian Image Segmentation And Gait Recognition