A computer program, stored on a non-transitory computer-readable storage medium, to be executed by a computer which is designed to generate a restored image by reducing a motion blur that has been induced by a camera shake from an image that has been captured by an image capture device, the program being defined to make the computer perform the steps of:
- getting the image and information that affects the degree of the motion blur of the image;
- setting the size of a blur kernel that defines the camera-shake-induced motion blur of the image by reference to the information that affects the degree of the motion blur of the image and changing the size of the blur kernel according to an exposure time, the blur kernel being a coefficient matrix representing a point spread function, the size of the blur kernel being the number of elements of the coefficient matrix;
- determining the blur kernel;
- and
- generating the restored image by reducing the camera-shake-induced motion blur from the image using the blur kernel that has been determined.