Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from PIL import Image as PILImage
- channel = int(np.ceil(len(img_msg.data)/(img_msg.height * img_msg.width)))
- im = np.ndarray(shape=(img_msg.height, img_msg.width, channel),
- dtype=np.uint8, buffer=img_msg.data)
- pim = PILImage.fromarray(im)
- pim.show()
Add Comment
Please, Sign In to add comment