1

是否可以从 PythonMagick 中访问直方图(作为我正在考虑的元组??)?

#!/usr/bin/env python
import PythonMagick

img = PythonMagick.Image("c:\\temp\\temp\\sample_image.jpg")

h = img.convert().histogram() # pseudo code for the following command line:
# convert sample_image.jpg -define histogram:unique-colors=true -format %c histogram:info:

这很像这个问题,只是我想在 Python 中使用结果。我也不想依赖将直方图写成文本文件,然后将其导入 Python 似乎有点慢,如果不是多余的话。

4

0 回答 0