Complete the MATLAB code - image convolution:
- Implement image convolution in Matlab:
-- Apply the following kernels and compare their images
-- If output is less than zero, set it to zero
![-2 10 151 0 10 0 1 0 clear % Read image A-int32 (imread ( [N, M]-size (A) % change unsigned to signed integer for matrix comp](http://img.homeworklib.com/images/81547270-9942-4d8a-91fd-c717fb1d4357.png?x-oss-process=image/resize,w_560)
Below is matlab code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all,
clear all,
clc,
ProjectPath = pwd;
ImagePath = strcat(ProjectPath,'\Leena.jpg');
Orig = imread(ImagePath);
Gray = rgb2gray(Orig);
subplot(2,2,1); imshow(Gray); title('Original Gray Image');
%Convolution Filter-1
s = [0 1 0; 1 1 1; 0 1 0];
size(Gray)
A = uint8(conv2(Gray,s));
subplot(2,2,2); imshow(A); str= strcat(num2str(s)); title(str);
%Convolution Filter-1
s = [0 -1 0;-1 5 1;0 -1 0];
size(Gray)
A = uint8(conv2(Gray,s));
subplot(2,2,3); imshow(A); str= strcat(num2str(s)); title(str);
%Convolution Filter-1
s = [-2 -1 0;0 1 1;0 1 2];
size(Gray)
A = uint8(conv2(Gray,s));
subplot(2,2,4); imshow(A); str= strcat(num2str(s));
title(str);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Complete the MATLAB code - image convolution: - Implement image convolution in Matlab: -- Apply the following kernels and compare their images -- If output is less than zero, set it to zero -2 10 151...