如何解决Jupyter-Notebook 光栅图像以真彩色 [0,255] 或浮点 [0,1] 进行可视化
我正在处理光栅图像,我试图以 rgb 真彩色进行可视化,但出现内存错误。
# astype('f4') is a numpy function to convert to float (4 byte)
redf = red.astype('f4') / red_max
bluef = blue.astype('f4') / blue_max
greenf = green.astype('f4') / green_max
rgb = [redf,greenf,bluef]
MemoryError Traceback (most recent call last)
<ipython-input-30-71dfcf631714> in <module>
1 # astype('f4') is a numpy function to convert to float (4 byte)
----> 2 redf = red.astype('f4') / red_max
3 bluef = blue.astype('f4') / blue_max
4 greenf = green.astype('f4') / green_max
5 rgb = [redf,bluef]
MemoryError: Unable to allocate 246. MiB for an array with shape (8071,7981) and data type float32
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。