zoukankan      html  css  js  c++  java
  • 将分割图和原图合在一起

    # 将分割图和原图合在一起
    from PIL import Image
    import matplotlib.pyplot as plt
     
    #image1 原图 
    #image2 分割图
    image1 = Image.open('/home/kesci/input/DRIVE4417/01_test.tif')
    image2 = Image.open('/home/kesci/input/DRIVE4417/01_manual1.gif')
     
    image1 = image1.convert('RGBA')
    image2 = image2.convert('RGBA')
     
    #两幅图像进行合并时,按公式:blended_img = img1 * (1 – alpha) + img2* alpha 进行
    image = Image.blend(image1,image2,0.3)
    image.save("test.png")
    image.show()
    

     

  • 相关阅读:
    数据库是什么以及用来干嘛
    10.3
    10.2
    12.7
    12.5
    12.4
    12.3
    12.2
    12.1JOptionPane
    11.30eclipse常用快捷键
  • 原文地址:https://www.cnblogs.com/ylHe/p/13922144.html
Copyright © 2011-2022 走看看