how to find an optimal window size for moving averaging filter among several windows?

5 views (last 30 days)
lets say I have an image with size of 400 [vertical pixels] x 600 [horizontal pixels], then how to find an optimal window size for moving avearge filter among 3x3, 5x5, 7x7, 11x11, 13x13, 15x15 window size?
what I am doing now is that..
[step 1]
A: original input image
B3: the result by using averaging filter with 3x3 window size
B5: the result by using averaging filter with 5x5 window size
B7: the result by using averaging filter with 7x7 window size
B9, B11, B13, B15.
I can get seven binary images(intensity of each pixel is 0 or 1) for B3~B15 using a fixed threshold. FYI, the object area is changing gradually depending on window size.
[step 2]
I calculated a numerical value between two adjacent filters such as mean squared error
C35: MSE between B3 and B5
C57: MSE between B5 and B7
C79: MSE between B7 and B9
C911: MSE between B9 and B11
C1113: MSE between B11 and B13
C1315: MSE between B13 and B15
[step 3]
find when I can get maximum gradient among C35, C57, ..., C1315.
does is make sense? do you have any ideas?
Thank you in advance
Hee

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 6 Nov 2019
Edited: KALYAN ACHARJYA on 6 Nov 2019
"then how to find an optimal window size for moving"
As, average filter smooths the original image, its based on result on paricular images. I dont think, there is any specific size, which may consider as optimal. Because its vary with different input image. Just apply different sizes and see the result, which gives the maximum features extraction possibilities or visual information can be considered as optimal size.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!