helpers.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:opencv-helpers 作者: abarrak 项目源码 文件源码
def plot_two_images(image_1, image_2, cmap_1=None, cmap_2=None, title='Image Viewer', disable_toolbar=True):
  '''
  plot :image1: and :image2: in a row.
  '''
  if disable_toolbar:
    matplotlib.rcParams['toolbar'] = 'None'

  fig = plt.figure(figsize=(13, 4))
  fig.canvas.set_window_title(title)

  a = fig.add_subplot(1, 2, 1)

  plt.imshow(image_1, cmap_1)
  plt.xticks([]), plt.yticks([])
  a.set_title('Before')

  a = fig.add_subplot(1, 2 ,2)
  plt.imshow(image_2, cmap_2)
  plt.xticks([]), plt.yticks([])
  a.set_title('After')

  plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号