i have a matrix as shown below
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249393/Untitled.png)
i wanted to take 3×3 pixel and take 3 pixels at a time along with the center pixel,
and compare the selected 3 pixel value with the center pixel,
and if 2 or morepixel has value greater than the center pixel and i wanted to assign 1 to it else 0
So in this case i will get 0-1-1-0 and then convert the binary 0110 to its corresponding decimal value = 6
Then the next 3×3 pixel
![Untitled1.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/249394/Untitled1.png)
Best Answer