Question: Investigate a more efficient way to implement spatial filtering when all the filter coefficients have the same value. The motivation comes from the observation that

Investigate a more efficient way to implement spatial filtering when all the filter coefficients have the same value. The motivation comes from the observation that as you slide the filter one pixel at a time over the image and compute the sum-of-products of image and filter values, you can use the results from the previous computation in the current computation. Although the method can be generalized, we will consider the case in which all the filter coefficients have the value 1. And, we will also ignore the 1/n2 scaling factor that typically accompanies an averaging filter of size nxn.

(a) Describe the algorithm you would use to compute the output value at location (x,y) given that you have already computed the result for location (x- 1,y), for example, for an averaging filter of size nxn (think about what changes when you shift the filter by one pixel).

(b) How many additions (in terms of n) does this require for each output pixel. Count subtractions as additions.

(c) Now, lets compare this with the standard approach of not using previous results. How many additions are required for each output pixel in this case. This should be in terms of n.

(d) Compute the computational advantage of the more efficient approach. This is simply the ratio of the number of additions required by the standard approach to the number of additions required by the more efficient approach. Again, this should be in terms of n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!