Patent ID: 8525918

Claim:
A portable electronic device, comprising: a lens module; a photo sensor, wherein, there is an image distance between the photo sensor and the lens module; a G-sensor, detecting an orientation of the portable electronic device and thereby generating orientation information; a storage unit, storing a plurality of autofocus look up tables for different orientations of the portable electronic device; a central processing unit, selecting one of the plurality of autofocus look up tables based on the orientation information and generating an actuating signal based on the selected autofocus look up table; and a focus module, actuated by the actuating signal to adjust the image distance, wherein: the orientation information generated by the G-sensor shows that the lens module is facing upward, forward or downward; and the plurality of lookup tables stored in the storage unit comprises: a first autofocus lookup table, providing a mapping table of the actuating signal to the image distance in a case where the lens module is facing upward; a second autofocus lookup table, providing a mapping table of the actuating signal to the image distance in a case where the lens module is facing forward; and a third autofocus lookup table, providing a mapping table of the actuating signal to the image distance in a case where the lens module is facing downward, wherein, to control the image distance to be a specific value, the first autofocus look up table outputs a first actuating signal which is greater than a second actuating signal determined by the second autofocus look up table, and, the second actuating signal is greater than a third actuating signal determined by the third autofocus table.