Interoperabilidade

 1 def se2offset(se):
 2     from numpy import array
 3     from ia870.iaseshow import iaseshow
 4 
 5     se = iaseshow(se, 'NORMAL')
 6 
 7     offset = []
 8     for i in range(se.shape[0]):
 9         for j in range(se.shape[1]):
10             if se[i,j] == True and (i-se.shape[0]/2 != 0 or j-se.shape[1]/2 != 0):
11                 offset.append([i-se.shape[0]/2,j-se.shape[1]/2])
12 
13     return array(offset)