1. A method of an apparatus for converting a document image captured using a camera to a dewarped document, the method comprising: obtaining, by the apparatus, a document image captured using the camera; extracting text lines from the document image; determining a projection formula to convert positions of respective points constituting the extracted text lines to coordinates projected on a plane of the dewarped document; determining a target function (E) which is used to calculate a difference between text lines projected on the plane of the dewarped document using the projection formula and real text lines; calculating parameters that minimize the target function (E); and converting the document image to the dewarped document by substituting the calculated parameters into the projection formula.