import matplotlib.pyplot as plt
import cv2 as cv
a=cv.imread('learn.jpg')
cv.imshow('learn',a)
fig=plt.figure(1) #新建绘图窗口
b=fig.add_subplot(221) #选择画布第一个
b.imshow(a,cmap=plt.cm.gray) #读图
cv.imshow('learn',a)
fig=plt.figure(1) #新建绘图窗口
b=fig.add_subplot(222) #选择画布第一个
b.imshow(a,cmap='gray') #读图
plt.title('fig')
fig1=plt.figure(2) #新建绘图窗口
b1=fig1.add_subplot(223) #选择画布第一个
b1.imshow(a,cmap=plt.cm.gray) #读图
plt.title('fig1')
plt.figure(3) #新建绘图窗口
plt.subplot(111) #选择画布第一个
plt.imshow(a,cmap='gray') #读图
plt.title('fig2')

 

 

 

 

利用cv与matplotlib.pyplot读图片与显示图片

 

相关文章:

  • 2021-10-29
  • 2021-08-07
  • 2021-12-19
  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-12
  • 2022-12-23
  • 2021-07-17
  • 2022-01-01
  • 2021-07-21
  • 2021-06-04
  • 2021-08-21
相关资源
相似解决方案