The deformable templates method for track finding in high energy physics is reviewed and extended to handle multiple and secondary vertex positions. An automatized miminization method that handles different types of parameterizations is derived. It is based on the gradient descent method but modified with an explicit calculation of the natural metric. Also a simplified and more intuitive derivation of the algorithm using Potts mean field theory equations is given.