【每日coding】轮廓

def contour(path):
    from PIL import  Image
    from matplotlib import  pyplot as plt

    image = Image.open(path).convert('L')

    plt.figure(figsize=(15, 8))
    plt.gray()

    plt.subplot(121)
    plt.contour(image, origin='image')
    plt.subplot(122)
    plt.imshow(image)


    plt.show()






if __name__ == '__main__':
    path = '../data/imgs/hdrplus.png'
    contour(path)

 

你可能感兴趣的:(Everyday,code,python)