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

时间:2019-10-09 01:45:48

标签: python matplotlib

我从plt.show获得图像输出,我想保存到数组中。我要保存到列表中的图像是原始图像及其覆盖物的结果。

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)

0 个答案:

没有答案