1. A method for determining parameters of a three-dimensional scene using a reverse-rendering function, the method comprising: receiving image data comprising a plurality of photographic images of a three-dimensional scene; receiving user input indicating a plurality of corresponding features each appearing in at least two of the plurality of photographic images; determining an error function for a reverse-rendering function, the reverse-rendering function defining a relationship between three-dimensional coordinates in the three-dimensional scene and corresponding two-dimensional coordinates of the plurality of corresponding features; and minimizing the error function to determine a solution corresponding to a global minimum of the error function, comprising calculating at least first derivatives of the error function using automatic differentiation, thereby computing intermediate solution estimates for successive iterations of the error function, until the solution estimates converge to the solution.