1. A method for controlling a camera of a mobile device to automatically capture images of a rectangular object, the method comprising: capturing a video stream including low resolution images of the rectangular object; calculating a coordinate of each corner of a quadrangle in each frame of the video stream; calculating a statistical measure for deviation of the coordinate of each corner of the quadrangle in each frame of the video stream; capturing a high resolution image of the rectangular object based on the statistical measure; and geometrically transforming a quadrangle of the rectangular object in the high resolution image into a rectangle.