Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. def convert_to_rgba(self, matrix):
  2. #print(matrix)
  3. new_matrix = []
  4. for x in range(0,len(matrix)):
  5. line = []
  6. for y in range(0,len(matrix[x])):
  7. #pixel
  8. pixel = matrix[x][y]
  9. new_pixel = [pixel[0],pixel[1],pixel[2], 255]
  10. line.append(new_pixel)
  11. new_matrix.append(line)
  12. return np.array(new_matrix)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement