1. A method implemented by one or more computing devices, the method comprising: extracting, by the one or more computing devices, line segments from an input image; determining, by the one or more computing devices, initial values for an energy function according to the extracted line segments; and calibrating, by the one or more computing devices, camera parameters by iteratively optimizing the energy function to estimate a camera intrinsic parameter matrix, an orientation matrix, and a set of vanishing points for the input image in conjunction with each other.