在PythonMagic中访问直方图

时间:2016-05-09 15:20:22

标签: python-2.7 imagemagick pythonmagick

是否可以从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:

这与this问题非常相似,只是我想在Python中使用结果。我也不想依赖于将直方图写成文本文件并将其重新导入到Python中,如果不是多余的话,它似乎有点慢。

0 个答案:

没有答案