We will now try to get a feel of what edge enhancement is all about. We will use our holiday image to perform grayscale enhancement and our soldier image to perform color enhancement (remember that the edge detection techniques of Chapter 3, Morphological Operations and Object Analysis, involved only grayscale images):
First, we will load our two images in two matrices:
>> gray = imread('holiday_image2.bmp'); >> color = imread('soldier.jpg');
Now, let's prepare our kernels (we'll use their default settings):
>> lp = fspecial('laplacian'); >> lg = fspecial('log'); >> pr = fspecial('prewitt'); >> sb = fspecial('sobel');
Next, we apply the filters to both images (in the same line to save space):
>> g1 = imfilter(gray,lp); c1 = imfilter(color,lp); >> g2 = imfilter(gray,lg); c2 = imfilter(color,lg); >> g3 = imfilter(gray,pr); c3 = imfilter(color,pr); >> g4 = imfilter(gray,sb); c4 = imfilter...