Question: Write a MATLAB function named addBoarder that adds a black boarder to a gray scale image by replacing the top and bottom N rows and
Write a MATLAB function named addBoarder that adds a black boarder to a gray scale image by replacing the top and bottom N rows and the left and right N columns with the value o (black), where N is the thickness ot the boarder in pixels. The function should have two inputs, the first is a matrix that represents a gray scale image, and the second input is the thickness of the boarder (N). The output is a matrix that is the same as the input image except that the top and bottiom N rows, and the left and right N columns are replaced with the value 0. For example, it the input image is x 50 ones(4,4) and N- 1, then the output would be y- [0000:0 50 500:0 50 50 0:000 01 As another example, it the input image is x 50 ones(5.5) and N-2, then the output would be y- 10 000 0:00000:00 5000:00000:000o o
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
