What is the actual mathematics behind the circular averaging(pillbox) filter?

20 views (last 30 days)
When we use h = fspecial('disk',radius),what actually happens within the program?
I went through the code here,but could not make much sense of it due to my not having a prior background in mathematics.Could someone help me out with this?

Accepted Answer

Image Analyst
Image Analyst on 26 Nov 2017
It takes the average of all elements in a window around each location. Let's say you were looking at an element (pixel) at (100,200) and had a disc of radius 10. So it would take all pixels in a circle from 90 to 110 and 190 to 210, multiply them by the values in the fspecial array, which are 1's in the disc, and 0's in the corners which are not included in the disc, then sum them up, and set the output value at (100, 200) to that sum. This will give the effect of blurring the array (image).

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!