Guest User

Untitled

a guest
Jan 19th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import numpy as np
  2. from PIL import Image as PILImage
  3.  
  4.  
  5. channel = int(np.ceil(len(img_msg.data)/(img_msg.height * img_msg.width)))
  6. im = np.ndarray(shape=(img_msg.height, img_msg.width, channel),
  7. dtype=np.uint8, buffer=img_msg.data)
  8. pim = PILImage.fromarray(im)
  9.  
  10. pim.show()
Add Comment
Please, Sign In to add comment