Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # PIL Image object which holds a transparent background png image.
- pil_img = Image.open(ioFile).convert('RGBA')
- pil_img.show()
- # I use numpy to convert the pil_image into a numpy array
- numpy_image = np.array(pil_img)
- # I convert to a openCV2 image, notice the COLOR_RGB2BGR which means that
- # the color is converted from RGBA to BGR format
- opencvImage = cv2.cvtColor(numpy_image, cv2.COLOR_RGBA2BGR)
- showImage(opencvImage)
Add Comment
Please, Sign In to add comment