I've always needed to think twice about why this filter sharpens an image. Can someone explain its behavior both near image edges (high gradients) and also near flat color regions of the image (where the gradient of pixel intensities is zero).
My intuitive understanding of this matrix is "subtracting all typical information of neighbors to make 'myself' outstanding". So "5&-1" numbers here means after subtracting all "4" nearby infos, what info 'I' remaining. For edge pixels, what info it remaining is the edge info. For pixels in flat region, what info it remaining is still similar to previous flat region.