Once again we will work with our color image depicting the light bulb soldier. The results can be visible even in the grayscale form of the image, so you could convert it to grayscale before applying the technique:
Let's start off with loading our image and creating the filter. We'll use the
prewitt
kernel (in its default value it will emphasize horizontal edges):>> img = imread('soldier.jpg'); >> kernel = fspecial('prewitt');
Then, we will apply our filter to the image and add the result to our original:
>> edges = imfilter(img,kernel); >> brighter = img + edges;
Now, let's see the result side-by-side with the original:
>> subplot(1,2,1),imshow(img),title('Original image'); >> subplot(1,2,2),imshow(brighter),title('Brightened image');
To get a better idea of the effect, let's crop the left part of the images, containing Christmas light bulbs on trees:
>> imcrop(brighter); >> imcrop(img...