py360convert
py360convert copied to clipboard
Problem with Py360Convert and Pillow
When I play the code on Python it gives me this error and I think it is a problem with PIL
/bin/python3 "/home/jubei/Documentos/Python/Images 360/equiretangular.py"
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2813, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 3), '<f8')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/jubei/Documentos/Python/Images 360/equiretangular.py", line 9, in <module>
image = Image.fromarray(equiretangular)
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2815, in fromarray
raise TypeError("Cannot handle this data type: %s, %s" % typekey) from e
TypeError: Cannot handle this data type: (1, 1, 3), <f8
you need to convert the image to unint8
equirec = np.clip(equirec, 0, 255).astype(np.uint8)