function Img2=Convolution(Img, mask);
%Input: Img is the original image data matrix, mask is square matrix, could be 2x2, 3 x 3 or size
%Output: Img2 is the result image
Read an image file, apply the edge detection filters (i.e., masks) to see whether it works well. Try at least 3 filters: Sobel, Robert, Prewitt.
Screenshot of code and corresponding output :-
Figure title says about type of filter applied...
Code in text format ..
function Img2=Convolution(Img, mask)
%Input: Img is the original image data matrix, mask is square matrix,
% could be 2x2, 3 x 3 or size
%Output: Img2 is the result image
clc;
img = imread(Img); % Reading the input file
if size(img,3) == 3
img = rgb2gray(img); % Conversion to grayscle if the image is rgb
end
Img2 = conv2(img,mask,'same'); % Applying 2d Convolution with mask
% imshow(Img2); %Showing the image
end
Write a function in Matlab (or Java) as follows: function Img2=Convolution(Img, mask); %Input: Img is the original image data matrix, mask is square matrix, could be 2x2, 3 x 3 or size %Output: Img...
Hello, I need help with the following question in MATLAB for digital image processing, thank you for your help in advance Convolution operations using mask are commonly applied in image enhancement. Even edge detection is based on convolution with a specially designed mask. The assignment here is to write your own function for convolution and test it in edge detection. 1. Write a function in Matlab as follows: function Img2 Convolution(Img, mask); %Input: Img is the original image data matrix,...