In: Computer Science
Design a convolution mask that does the following and implement the convolution process
(Pls do not use any image processing library functions)
1. smoothing
2. sharpening
3. detect edges
**Please do not use any image processing library functions.**
1. Smoothing:(Gaussian blur)
or
2. Sharpening:
3. Edge detector:
Here is a matlab code for the problem: (only conv2d is used for convolution)
clc;
clear;
A = imread('Lenna.png');
I = rgb2gray(A);
mask1 = (1/16)*[1 2 1;2 4 2;1 2 1]; %Gaussian blur
mask2 = [0 -1 -0;-1 5 -1; 0 -1 0]; %Sharpen
mask3 = [-1 -1 -1;-1 8 -1;-1 -1 -1]; %Edge
I1 = conv2(I,mask1);
I2 = conv2(I,mask2);
I3 = conv2(I,mask3);
subplot(2,2,1);
imshow(I);
title('original')
subplot(2,2,2);
imshow(uint8(I1));
title('smooth');
subplot(2,2,3);
imshow(uint8(I2));
title('sharp');
subplot(2,2,4);
imshow(uint8(I3));
title('edge');
Hope this helps.