1. A device-implemented method for computing a two-dimensional blur kernel for a digital image, the method comprising: receiving the digital image; estimating a sharp image from the digital image, the sharp image being derived from the digital image by sharpening at least portions of the digital image; and computing the two-dimensional blur function by minimizing an optimization algorithm that estimates the blur function.