Question
3. [4 points] Implement a MedianFiltering function to perform a filtering operation, as explained in class, on the input image. The prototype of this function
3. [4 points]
Implement a MedianFiltering function to perform a filtering operation, as explained in class, on the input image. The prototype of this function should be:
function filteredIm = MedianFiltering(im, mask)
where im is the original grayscale image and mask is the square filter with odd numbers of rows and columns. Make sure that your function shows appropriate error messages when the masks dimension is not an odd number and the mask is not a square. Note: both input and output images of the MedianFiltering function should be an array with data type uint8. You are not allowed to simply use the Matlab medfilt2 or other built-in functions in your implementation. However, you can use the built-in sorting function to sort the values covered by the mask.
Call this function to process the same noisy image Circuit.jpg using a standard 33 median filter and a standard 55 median filter, respectively. Display the original image and two processed images in Figure 3 with appropriate titles.
Hint: you may use matlab built-in function median() to compute the median of an array.
Please provide working code, will rate if done so.
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