I am very beginner in C# and I have an absurd method which is described below.
If I want to create a 3x3 window and find average value of these 9 pixels I follow that way:
IM[i - 1, j - 1]
IM[i - 1, j]
IM[i - 1, j + 1]
IM[i, j - 1]
IM[i, j + 1]
IM[i - 1, j - 1]
IM[i - 1, j]
IM[i - 1, j + 1]
IM[i, j]
If I want to create a 5x5 window and put it on each pixel to find average of these 25 pixel I follow that way:
IM[i - 2, j - 2]
IM[i - 1, j - 2]
IM[i, j - 2]
IM[i + 1, j - 2]
IM[i + 2, j - 2]
IM[i - 2, j - 1]
IM[i - 1, j - 1]
IM[i, j - 1]
IM[i + 1, j - 1]
IM[i + 2, j - 1]
IM[i - 2, j]
IM[i - 1, j]
IM[i, j]
IM[i + 1, j]
IM[i + 2, j]
IM[i - 2, j + 1]
IM[i - 1, j + 1]
IM[i, j + 1]
IM[i + 1, j + 1]
IM[i + 2, j + 1]
IM[i - 2, j + 2]
IM[i - 1, j + 2]
IM[i, j + 2]
IM[i + 1, j + 2]
IM[i + 2, j + 2]
If I want to create 7x7 or more window, it is too hard to write position of each pixel in the 7x7 window.
I want to create the dynamic window whose size is defined by user. How can I do that? Is there any way to do that?
forloop.. - TaW