1 2 3 4 5 6 7 8 9
| a.setshape((hauteur,largeur)) # a est une matrice contenant les data ds pixels
a=_cv.convolve2d(a,[[0,0,0],[0,1,0],[1,1,1]]) # a devient a convolué par le masque 0 deg
a=_cv.convolve2d(a,[[0,0,0],[1,1,0],[1,1,0]]) #a devient a convolué par le masque 45deg
a=_cv.convolve2d(a,[[1,0,0],[1,1,0],[1,0,0]]) #etc
a=_cv.convolve2d(a,[[1,1,0],[1,1,0],[0,0,0]])
a=_cv.convolve2d(a,[[1,1,1],[0,1,0],[0,0,0]])
a=_cv.convolve2d(a,[[0,1,1],[0,1,1],[0,0,0]])
a=_cv.convolve2d(a,[[0,0,1],[0,1,1],[0,0,1]])
a=_cv.convolve2d(a,[[0,0,0],[0,1,1],[0,1,1]]) |
Partager