matplotlib实现显示伪彩色图像及色度条
灰度图显示为伪彩色图 法一 import matplotlib.pyplot as plt img = plt.imread('C:/Users/leex/Desktop/lena.jpg') img_s = img[:,:,0]# 直接读入的img为3通道,这里用直接赋值的方法转为单通道 sc = plt.imshow(img_s) sc.set_cmap('hot')# 这里可以设置多种模式 plt.colorbar()# 显示色度条 效果 限制范围 import matplotlib.pyplot as plt img = plt.imread('C:/Users/leex/De
下载地址
用户评论