Abstract— Many vision problems can be formulated as minimization of appropriate energy functionals. These energy functionals are usually minimized, based on the calculus of variations (Euler-Lagrange equation). Once the Euler-Lagrange equation has been determined it needs to be discretized in order to implement it on a digital computer. This is not a trivial task and, moreover, error-prone. In this article, we propose a flexible alternative. We discretize the energy functional and subsequently apply the mathematical concept of algorithmic differentiation to directly derive algorithms that implement the energy functional’s derivatives. This approach has several advantages: First, the computed derivatives are exact with respect to the implementation of the energy functional. Second, it is basically straightforward to compute second-order derivatives and thus the Hessian matrix of the energy functional. Third, algorithmic differentiation is a process which can be automated. We demons...