1. A method for cameras to gain tilt information of an image sensor of a camera in order to correct for this tilt, comprising the following steps: (1) providing a digital camera module comprising a movable lens and an image sensor, and a measurement device; (2) performing an autofocus operation on the center of the image field; (3) performing a sweep of the lens position around the autofocus position found in previous step; (4) measuring sharpness in at least three ROIs of the image field; (5) tracking the lens positions at which the ROIs selected in previous step reach their maximum sharpness values using sharpness metrics; (6) calculating a tilt of the image sensor using geometric transformation based on the lens positions yielding the maximum sharpness values found in previous step; and (7) correcting the tilt of image sensor based on tilt information found in previous step.