本文整理汇总了Python中Image.Image.to_pil_image方法的典型用法代码示例。如果您正苦于以下问题:Python Image.to_pil_image方法的具体用法?Python Image.to_pil_image怎么用?Python Image.to_pil_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image.Image
的用法示例。
在下文中一共展示了Image.to_pil_image方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Image
# 需要导入模块: from Image import Image [as 别名]
# 或者: from Image.Image import to_pil_image [as 别名]
import argparse
import numpy as np
import scipy as sp
import math
import matplotlib.pyplot as plt
from PIL import Image as PILImage
from Image import Image
from SuperResolutioner import SuperResolutioner
if __name__ == "__main__":
# parser = argparse.ArgumentParser(description='Super Resolution from a Single Image (Glasner, et al.).')
# parser.add_argument('image', type=str,
# help='the location of the image to be super-resolutioned')
# args = parser.parse_args()
#
# input_image = MPImage.imread(args2.image)
img_name = '/Users/Yousuf/Documents/Research/SuperResolutionGeometry/Glasner_SingleImageSuperResolution/babyface.png'
PIL_input_image = PILImage.open(img_name)
input_image = Image(PILImage = PIL_input_image)
super_resolutioned_image = SuperResolutioner(input_image).super_resolution(2)
super_resolutioned_image.save('/Users/Yousuf/Documents/Research/SuperResolutionGeometry/Glasner_SingleImageSuperResolution/babyface_sr.png', 'png')
plt.figure(0)
plt.imshow(input_image.to_pil_image())
plt.figure(1)
plt.imshow(super_resolutioned_image.to_pil_image())
plt.show()