A mobile device for capturing and equalizing a text area on an identification document which is a passport or identity card and for which a structural information of the text area on the identification document is predetermined, wherein the text area is a machine-readable zone of the identification document and wherein the structural information comprises the number of text characters per text line, the mobile device comprising: an image camera which is configured to capture an image of the identification document in order to obtain a document image; and a processor which is configured: - to segment the document image to obtain a plurality of image segments; - to select, as text character image segments, the image segments representing text characters from among the plurality of image segments, - to group similar text character image segments with spatial coherence using a Delaunay triangulation of the centroids of the text character image segments; - to compare for each text character group of the plurality of text character groups the number of text characters per text line with the number of text characters per text line according to the structural information in order to detect the text area on the identification document, wherein the processor is configured to determine a spatial position of the image camera relative to the captured text area and to equalize the captured text area in perspective, wherein lines are adapted by a linear regression on the centroids of the detected text character image segments of the text area and these lines are intersected in order to provide an estimate of the four outermost text character centers and to equalize the text area using the structural information and the four estimated outermost text character centers. an image camera which is configured to capture an image of the identification document in order to obtain a document image; and a processor which is configured: - to segment the document image to obtain a plurality of image segments; - to select, as text character image segments, the image segments representing text characters from among the plurality of image segments, - to group similar text character image segments with spatial coherence using a Delaunay triangulation of the centroids of the text character image segments; - to compare for each text character group of the plurality of text character groups the number of text characters per text line with the number of text characters per text line according to the structural information in order to detect the text area on the identification document, - to segment the document image to obtain a plurality of image segments; - to select, as text character image segments, the image segments representing text characters from among the plurality of image segments, - to group similar text character image segments with spatial coherence using a Delaunay triangulation of the centroids of the text character image segments; - to compare for each text character group of the plurality of text character groups the number of text characters per text line with the number of text characters per text line according to the structural information in order to detect the text area on the identification document, wherein the processor is configured to determine a spatial position of the image camera relative to the captured text area and to equalize the captured text area in perspective, wherein lines are adapted by a linear regression on the centroids of the detected text character image segments of the text area and these lines are intersected in order to provide an estimate of the four outermost text character centers and to equalize the text area using the structural information and the four estimated outermost text character centers.