1. A digital image processing method comprising: receiving a preview image; detecting by a controller a plurality of rectangular objects in the preview image and obtaining coordinate information corresponding to the plurality of rectangular objects; determining a main rectangular object that has a largest size from among the plurality of rectangular objects in the preview image by the controller, when respective distances between midpoints of the plurality of rectangular objects detected from the preview image are smaller than a predetermined threshold value; capturing an image corresponding to the preview image, after detecting the plurality of rectangular objects and determining the main rectangular object, wherein capturing the image further comprises focusing on the main rectangular object determined by the controller; and generating a perspective-transformed image by performing perspective transform on the captured image using coordinate information corresponding to the main rectangular object.