1. A computer-implemented method for generating an image, the method comprising: capturing a sequence of images that includes a first image and a second image; selecting a first image segment within the first image that represents a first group of real-world objects based on a comparison of the first image and the second image; generating a first motion estimate for a first portion of the first image segment and a second motion estimate for a second portion of the first image segment relative to a region in the second image that corresponds to the first image segment; performing a first deblurring operation on the first portion of the first image segment based on a first blur kernel derived from the first motion estimate to generate a first deblurred portion of the first image segment; performing the first deblurring operation on the second portion of the first image segment based on a second blur kernel derived from the second motion estimate to generate a second deblurred portion of the first image segment; and generating a deblurred version of the first image by combining the first deblurred portion of the first image segment and the second deblurred portion of the first image segment.