Question
Question-7 (6 marks) Write a MATLAB function,g spatialFiltering f. k). The function takes as an input an 8-bit MXN image, J. and an mxm spatial
Question-7 (6 marks) Write a MATLAB function,g spatialFiltering f. k). The function takes as an input an 8-bit MXN image, J. and an mxm spatial filter kemel, k where m-20+1. and a is a positive integer. The function performs linear spatial filtering, by convolving the image.f. with the kernel, k. Recall that with convolution the kernel is pre-rotated by 180. The function does not employ zero-padding on the image. Instead, the function just does not perform the sum-of-product operation on the first nor the last a rows, nor the first last a columns. The values of these rows and columns are taken, instead, directly from the corresponding pixel values in the input image. You are required to implement the operations above (especially the sum of products) with basic MATLAB commands (eg, if statements, for and while loops, etc.) and not allowed to use existing functions from MATLAB for the intended purpose like conv2 nor imfilter. Assume that the size of the kernel is always much smaller than the size of the image, and you do not need to check for that. formunlas you might need: 2D continuous fourier transformatio, 2D continuous inverse transformation, histogram-equalization continuous transformation function
Question-7 (6 marks) Write a MATLAB function, g spatialFiltering(f, k). The function takes as an input an 8-bit M-N image, f, and an mxm spatial filter kermel, k where m= 2a+1, and a is a positive integer. The function performs linear spatial filtering, by convolving the image, f, with the kernel, k. Recall that with convolution the kermel is pre-rotated by 180. The function does not employ zero-padding on the image. Instead, the function just does not perform the sum-of-product operation on the first nor the last a rows, nor the first/last a columns. The values of these rows and columns are taken, instead, directly from the corresponding pixel values in the input image. You are required to implement the operations above (especially the sum of products) with basic MATLAB commands (e.g., if statements, for and while loops, etc.) and not allowed to use existing functions from MATLAB for the intended purpose like conv2 nor imfilter. Assume that the size of the kemel is always much smaller than the size of the image, and you do not need to check for that. Formulas you might need The 2-D continuous Fourier transform: F(u.v)=J The 2-D continuous inverse Fourier transform: f(x,y) F Histogram-equalization continuous transformation function: sT(r)=(L ap ()'d where L is the number of intensity levels, and r and s are the input and output intensity values, receptivity. Page 5/5 Question-7 (6 marks) Write a MATLAB function, g spatialFiltering(f, k). The function takes as an input an 8-bit M-N image, f, and an mxm spatial filter kermel, k where m= 2a+1, and a is a positive integer. The function performs linear spatial filtering, by convolving the image, f, with the kernel, k. Recall that with convolution the kermel is pre-rotated by 180. The function does not employ zero-padding on the image. Instead, the function just does not perform the sum-of-product operation on the first nor the last a rows, nor the first/last a columns. The values of these rows and columns are taken, instead, directly from the corresponding pixel values in the input image. You are required to implement the operations above (especially the sum of products) with basic MATLAB commands (e.g., if statements, for and while loops, etc.) and not allowed to use existing functions from MATLAB for the intended purpose like conv2 nor imfilter. Assume that the size of the kemel is always much smaller than the size of the image, and you do not need to check for that. Formulas you might need The 2-D continuous Fourier transform: F(u.v)=J The 2-D continuous inverse Fourier transform: f(x,y) F Histogram-equalization continuous transformation function: sT(r)=(L ap ()'d where L is the number of intensity levels, and r and s are the input and output intensity values, receptivity. Page 5/5Step 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