Question
Coding in Matlab Function Name: zamboni Inputs: 1. ( char ) The file name of the input image, including file extension Outputs: None File Outputs:
Coding in Matlab
Function Name: zamboni
Inputs:
1. ( char ) The file name of the input image, including file extension
Outputs:
None
File Outputs:
1. The output image with 'blur_' appended to the beginning of the filename Banned Functions:
All image functions except imread() and imwrite() are banned for this problem.
Background:
The International Olympics Committee needs you to smooth out the ice before the big curling event! They need you to drive the zamboni over all of the ice in the rink. In order to show the Committee that you did your job, you will show what the design under the ice looks like, but more blurry than before.
Function Description:
Write a function called zamboni() that takes in an input image and outputs the same image modified with a box blur . In a box blur operation, each center pixel becomes the average of all 9 pixels around it (including itself), for every color layer. Refer to the example operation below for a 3x3 uint8 array.
30 30 30 90 90 90 ->
60 60 60
** ** **
** 60 **
** ** **
To determine the color values of the pixels in the output image, follow these steps:
1) Index out a 3x3 piece of the original array, where the middle pixel of the 3x3 piece corresponds to the new pixel.
2) Average the values in the 3x3 array, then set the new pixel to the average value (Do this for each layer of the image separately).
3) Repeat steps 2) and 3) for all 3x3 pieces of the image array.
There are not enough pixels in the original image to calculate the border values. Hence, the output image will have 2 fewer rows (top and bottom rows) and 2 fewer columns (far left and right columns) than the original. Write the resultant image with 'blur_' appended to the beginning of the input image filename.
Notes:
You should not overwrite pixels in the original image as you iterate. Use the original
pixel values to determine your new output pixels.
The solution file will produce file outputs named
'blur__soln.png'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started