Here is what I got:
Enter 4X4 pixels
1 1 1 0
0 1 0 0
1 0 0 1
1 1 1 1
square: (0,0),(0,0)
square: (0,1),(0,1)
square: (1,1),(1,1)
square: (2,0),(2,0)
square: (3,0),(3,0)
square: (3,1),(3,1)
square: (0,2),(1,3)
square: (3,2),(3,2)
square: (2,3),(2,3)
square: (3,3),(3,3)
10
It...