Methods to improve autofocus in digital imaging systems, such as digital
cameras, are disclosed. Embodiments may include, in response to locking
of lens focus on a subject image, determining an initial subject focus
distance and an initial attitude, and in response to a request for an
exposure, determining a final attitude. Embodiments may also include
determining a final target subject distance based on the initial subject
focus distance and a focus correction distance, where the focus
correction distance is based on the difference between the initial
attitude and the final attitude. Embodiments may also include focusing
the lens at the final target subject distance. Further embodiments may
include after focusing the lens at the final target subject distance,
exposing an image. Other embodiments may include determining the initial
and final attitude with a micro-electro-mechanical (MEMS)-based sensor or
other sensor.