I have a double image and my aim is to convert it to logical. I want to create 5x5 window and put it on each pixel in the image. Then, I calculate the average of these 25 pixels. If the center pixel value is greater then the average value, it will be 1. Otherwise 0.
How can I do that?
P.S. I don't want to do that this 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]
.
.