python 图像读入 reshape尺寸时的问题
2017-01-09 20:28
351 查看
可以用matplotlib模块中的image模块进行图像的读取
#coding=utf-8 import matplotlib.pyplot as plt import matplotlib.image as mimage image=mimage.imread('lala.jpg') print image.shape # show a picture image=image.reshape(1,-1) #-1是根据数组大小进行维度的自动推断 #若使用的是image=image.reshape成一行,分别为R一块, G块 ,B一块 # t=imgX1[222,:].reshape(3,32,32) # print('t= ' ,t.shape) # image=np.transpose(t,(1,2,0)) image=image.reshape(1186,1920,3) print(image.shape) plt.imshow(image) plt.axis('off') plt.show()
相关文章推荐
- 转载 python每次读入文件一行的问题(血的教训啊)
- Python&OpenCV - 随机生成图像 与 图像的转维(reshape)
- python2.7中用numpy.reshape 对图像进行切割
- Python3.5+OpenCV3.2读取图像问题
- python opencv 图像尺寸变换
- Label和CLabel设置图像的尺寸问题
- 解决Python2.7画三维图像遇到的编码问题
- Python 图像读入处理(R+G+B+Gray)
- Linux下python matplotlib.pyplot在图像上显示中文的问题
- Python图像resize前后颜色不一致问题
- python opencv 图像尺寸变换
- ps中的背景图尺寸与图像尺寸不同时,如何将图像分离出来----------已解决的问题
- python 函数 字符串读入问题
- 学习笔记系列-Python量化交易(1)-matplotlib库plot后图像不显示问题
- 趣谈MATLAB的图像读入格式问题
- Python&OpenCV - 随机生成图像 与 图像的转维(reshape)
- python opencv入门(读 / 写 显示以及转换图像 和 视频读入)
- python 调用图像处理类库PIL 时遇到的问题
- python 图像问题
- 用python 批量更改图像尺寸到统一大小