Question

In: Computer Science

Design a convolution mask that does the following and implement the convolution process (Pls do not...

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.**

Solutions

Expert Solution

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.


Related Solutions

This is system engineering process. pls explain each step in this process. Problem definition(Analysis), Conceptual Design(Synthesis,...
This is system engineering process. pls explain each step in this process. Problem definition(Analysis), Conceptual Design(Synthesis, Preliminary design(Evaluation), Design decision(Decision), Detailed design(Action), Production, integration & test(verify)
Bank Accounts in Java! Design and implement a Java program that does the following: 1) reads...
Bank Accounts in Java! Design and implement a Java program that does the following: 1) reads in the principle 2) reads in additional money deposited each year (treat this as a constant) 3) reads in years to grow, and 4) reads in interest rate And then finally prints out how much money they would have each year. See below for formatting. Enter the principle: XX Enter the annual addition: XX Enter the number of years to grow: XX Enter the...
Describe the process of convolving an image with a mask (kernel). How could the process be...
Describe the process of convolving an image with a mask (kernel). How could the process be implemented in the (spatial) frequency domain?
Problem 2 (C++): Design and implement a class complexType, that can be used to process complex...
Problem 2 (C++): Design and implement a class complexType, that can be used to process complex numbers. A number of the form a +ib, in which i2 = -1 and a and b are real numbers, is called a complex number. We call a the real part and b the imaginary part of a + ib. Complex numbers can also be represented as ordered pairs (a, b). The class you will design should have the following features. Constructor Your class...
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day...
PLEASE DO THIS IN C#Design and implement a programming (name it NextMeeting) to determine the day of your next meeting from today. The program reads from the user an integer value representing today’s day (assume 0 for Sunday, 1 for Monday, 2 for Tuesday, 3 for Wednesday, etc…) and another integer value representing the number of days to the meeting day. The program determines and prints out the meeting day. Format the outputs following the sample runs below. Sample run...
what does the PE and PLS exam test on? what sections do the exams have ?
what does the PE and PLS exam test on? what sections do the exams have ?
Why does the convolution of a clear phantom image with a Gaussian function result in a...
Why does the convolution of a clear phantom image with a Gaussian function result in a smooth (blurry) image (*use Fourier transform and frequency domain perspective to explain).
Question :Design the parameters for the PI controller urgent answer pls
Question :Design the parameters for the PI controller urgent answer pls
PLS EXPLAIN IN DETAIL THE SAND MOLD CASTING PROCESS. PLS WRITE IN MORE THAN 250 WORDS...
PLS EXPLAIN IN DETAIL THE SAND MOLD CASTING PROCESS. PLS WRITE IN MORE THAN 250 WORDS ILLUSTRATING EACH AND EVERY FINE DETAIL.
Design and implement a C++ program that performs the following steps:Ask the user to enter a...
Design and implement a C++ program that performs the following steps:Ask the user to enter a positive integer number N; Your program may need to prompt the user to enter many times until it reads in a positive number;Let user to enter N (obtained in the previous step) floating point numbers, and count how many positive ones there are in the sequence and sum up these positive numbers; (Hint: negative numbers or 0 are ignored).Display result.You can and should use...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT