This example illustrates the bound matrix format the pixel coordinates.
A binary image is created using the mmbinary function.
from morph import *
S = mmbinary([ [0,0,0,0,0], [0,0,1,0,0], [0,0,1,1,0], [0,0,1,1,0], [0,0,0,0,0]])
print S
[[0 0 0 0 0] [0 0 1 0 0] [0 0 1 1 0] [0 0 1 1 0] [0 0 0 0 0]]
E = mmbinary([ [0,1,0], [1,1,1], [0,1,0]])
print E
[[0 1 0] [1 1 1] [0 1 0]]
The image origin, with coordinates (0,0) is at the center. The first coordinate is the row number from top to bottom and the second coordinate is the column number from left to right.
Si,Sv = mmmat2set(S)
print Si
[[-1 0] [ 0 0] [ 0 1] [ 1 0] [ 1 1]]
Ei,Ev = mmmat2set(E)
print Ei
[[-1 0] [ 0 -1] [ 0 0] [ 0 1] [ 1 0]]