May-02-2018, 08:32 PM
Hi everyone,
I am working with Python and ia habe a problem with convert the format PIL to CV2, my code is:
Thank,
karlo.
I am working with Python and ia habe a problem with convert the format PIL to CV2, my code is:
from PIL import Image import numpy as np img = Image.open('C:/Users/XYZ/example.png') #Format PIL to CV2 cv_img = np.asarray(img)[:,:,::].copy()The error is:
Error:cv_img = np.asarray(img)[:,:,::].copy()
Traceback (most recent call last):
File "<ipython-input-81-422b4aff8d72>", line 1, in <module>
cv_img = np.asarray(img)[:,:,::].copy()
IndexError: too many indices for array
Please our help!Thank,
karlo.