In this paper, we study lens distortion for still images considering two well-known distortion models: the two-parameter polynomial model and the two-parameter division model. We study the invertibility of these models, and we mathematically characterize the conditions for the distortion parameters under which the distortion model defines a one-to-one transformation. This ensures that the inverse transformation is well defined and the distortion-free image can be properly computed, which provides robustness to the distortion models. A new automatic method to correct the radial distortion is proposed, and a comparative analysis for this method is extensively performed using the polynomial and the division models. With the aim of obtaining an accurate estimation of the model, we propose an optimization scheme which iteratively improves the parameters to achieve a better matching between the distorted lines and the edge points. The proposed method estimates two-parameter radial distortion models by detecting...