Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function to smooth a black-and-white image by replacing each pocel by the average of itself and its neighbors. In MATLAB a black- and-white

image text in transcribed
Write a function to "smooth" a black-and-white image by replacing each pocel by the average of itself and its neighbors. In MATLAB a black- and-white image is just a matrix of 1s and Os - 1 represents white, and 0 represents black To keep the algorithm simple, ignore the edges of the image - that is, do not change the first and last rows and columns function name = smooth_image() input argument = input matrix output argument = output matrix The algorithm can be described as follows: . Given an NoM input matrix Make a copy of the matrix - this will be the output matrix loop over rows 2 to N-1 of the input matrix loop over columns 2 to M-1 of the input matrix take the average of the 3,3 submatric centered on the current row & column set the corresponding element of the output matrix equal to this average Function e Reset DOMATLAB Documentation Code to call your function Reset 1 Imagel - zeros(10,10); Image1(2:9, 5:6) = 1; Imagel(5:6, 2:9) - 1; Image2 - smooth_image(Imagel) subplot(1,2,1) imshow(Image1) subplot(1,2,2) simshow(Image)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions