I have been reading DIP by Woods and Gonzalvez when I stumbled upon filtering digital images topic.
It states that take a mask of 3x3 matrix like below:
w=[0 1 0; 1 4 1; 0 1 0];
But then further on for edge detection it states to take below mask:
w=[-1 -1 -1; -1 8 -1; -1 -1 -1];
I am not sure on what basis of a image we should take mask as - cause different mask matrix values is yielding different images as output of the original image.
Is there a generic way to categorize mask matrix to be taken for filtering an Image - I mean take this filter matrix for smoothing, for sharpening for edge detections etc?