plt.imshow()显示不出图片
在之后添加 plt.show()
python">import matplotlib.pyplot as plt
plt.imshow(predicted_boxes[:,:,::-1])
plt.show()
更换颜色通道顺序
图像通道转换——从np.ndarray的[w, h, c]转为Tensor的[c, w, h]
python"># img in BlueGreenRed (opencv style) -> matplotlib likes RedGreenBlue, switch the channel order.
predicted_boxes[:,:,::-1]
Pandas 数据分析工具
Pandas 教程
python">print(predicted_boxes.head(50)) # 打印前50个数据
openCV4.5.5 运行imshow()时报错
error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'
我检查重装(pip install
)了libgtk2.0-dev
和 pkg-config
这两个包,但问题还是没有解决。
参考StackOverflow的解决方案:opencv The function is not implemented
# 使用pip的方式安装python-opencv就不会出现这种错误
pip install opencv-python
之后,问题解决。
python"># 该方式也可用于显示图片
matplotlib.pyplot.imshow()
关于图像的一些基本处理
python——PIL,Image,cv2读取、修改图片
关于Rasterio库的使用
使用Rasterio读取栅格数据
使用Rasterio做投影变换
关于图像降采样
【Python学习蝴蝶书】第五章 图像处理8-图像金字塔