1. A method implemented in a device, the method comprising: obtaining an input image; obtaining an edge direction for each of multiple pixels identified in the input image; selecting, by the device and using the edge direction of each of the multiple pixels, one or more of the multiple pixels, the selecting including: assigning each of the multiple pixels to one of multiple groups based on an angle of the edge direction of the pixel, and selecting, as the one or more pixels, a number of pixels from each of the multiple groups, the numbers of pixels selected from the multiple groups being within a threshold difference of one another; and generating, by the device and using the selected one or more pixels, a blur kernel based on which a de-blurred version of the input image is generated.