1. A method for capturing stabilized video, for use in a device that includes a lens, an image sensor, a display, a memory, and a processor, the device having a field of view, the method comprising: displaying, in the display of the device, a preview of a subject within the field of view of the device; capturing a video of the subject, with the lens and the image sensor, wherein the video is a sequence of images; detecting, by the processor, the subject in one or more images of the sequence of images and determining a location of the subject within the images; shifting, by the processor, the one or more images vertically and horizontally by an integer number of pixels to obtain corrected images, wherein the amount of vertical and horizontal shift for each of the one or more images is determined at least in part based on the location of the subject in the image; combining the corrected images to obtain a stabilized video; and displaying the stabilized video in the display of the device.