Last active
December 16, 2015 21:59
-
-
Save vane90/5503484 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toma_pendiente(imagen): # obtenemos la pendiente | |
Gx=gx | |
Gy=gy | |
print Gx | |
print Gy | |
imagen=imagen.load() | |
ancho,alto=imagen.size | |
pendiente=numpy.empty((ancho, alto)) | |
for i in range(ancho): | |
for j in range(alto): | |
if Gx[i,j]!=0 and Gy[i,j]!=0: | |
m=0 | |
elif Gx[i,j]==0 and Gy[i,j]==0: | |
m=1 | |
elif Gy[i,j]<=0 and Gx[i,j]==0: | |
m=2 | |
elif Gy[i,j]>=0 and Gx[i,j]==0: | |
m=3 | |
elif Gx[i,j]<=0 and Gy[i,j]==0: | |
m=4 | |
elif Gx[i,j]>=0 and Gy[i,j]==0: | |
m=5 | |
pendiente[i,j]=m | |
print 'termino' | |
return pendiente |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment