如何将plt.imshow()的输出保存到lis中

2024-07-04 06:00:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个plt的图像输出。显示我想保存到一个数组中。我试图保存到列表中的图像是原始图像及其覆盖的结果

differencesList = []
for i in range(len(imagesArrayMerged)):
  if(imagesArrayMerged[i]!=imagesArrayCorrupt[i]):
    background = imagesArrayCorrupt[i]
    overlay = imagesArrayMerged[i]

    #creates the image of the background and overlay image
    plt.imshow(background)
    plt.imshow(overlay, cmap='jet', alpha=0.4)

    #want to put the output of the prior two lines into a list
    differencesList.append(imshow_result_goes_here)

Tags: ofthein图像image列表forplt

热门问题