【问题标题】:How to overlap the ROI into the original scan image in python?如何将ROI重叠到python中的原始扫描图像中?
【发布时间】:2020-07-22 04:35:34
【问题描述】:

我有两张医学图像。一个是“扫描图像”,另一个是该扫描图像的“感兴趣区域”(ROI)。现在我需要叠加在另一个之上。这是原始扫描图像。

Scan image

ROI image

如何进行叠加,以便能够在原始扫描图像中看到 ROI 区域? 我想在python中做到这一点。

【问题讨论】:

    标签: python python-3.x image image-processing roi


    【解决方案1】:

    我解决了如下问题。如果有人对此感兴趣,您可以按照以下方式进行操作;

    from PIL import Image
    
    import numpy as np
    
    img = Image.open("path/to/the/roi")
    
    background = Image.open("path/to/the/scan/image")
    
    background.paste(img, (0, 0), img)
    background.save('path/to/save',"PNG")
    

    我想要的结果如下所示。

    参考:click for reference

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-01
      相关资源
      最近更新 更多