Having a matrix as shown below
i wanted to take 3×3 pixel
and compare the 3 pixels (highlighted in yellow colour) with the pixel (highlighted in green colour),
and if 2 or more pixel (highlighted in yellow) has value greater than the pixel (highlighted in green) 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
Best Answer