Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def convert(self, img):
  2. for i in range(img.shape[0]):
  3. for j in range(img.shape[1]):
  4. if img.item(i, j) != 0:
  5. img.itemset((i, j), 255)
  6. return img
  7.  
  8. a[a != 0] = 255
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement