Detecting deformable objects with flexible shape priors