【问题标题】:Extract small regions from a PIL image python从 PIL 图像 python 中提取小区域
【发布时间】:2021-10-15 05:44:23
【问题描述】:

enter image description here

我在 python 中有一个 PIL 图像,如图所示,我想将每个小的红色区域分别提取为 jpeg 格式。所以从这个文件中,我期待 file1.jpg、file2.jpg 等。

如何获取每个不同文件中的每个子区域?

【问题讨论】:

    标签: python-3.x image image-processing python-imaging-library


    【解决方案1】:

    PIL 在这方面并不擅长。我会考虑使用:

    • OpenCV findContours(),或
    • scikit-image regionprops(),或
    • ImageMagick Connected Components,或
    • Python wand 绑定到 ImageMagick 如上所述

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-10
      • 2022-01-18
      • 1970-01-01
      • 2011-04-12
      • 1970-01-01
      • 2021-01-08
      相关资源
      最近更新 更多