繁体   English   中英

为什么直方图是相同的[python + simplecv]

[英]Why are histograms the same [python + simplecv]

我的问题是,为什么以下代码中的两个直方图相同。 由于图像确实发生变化,因此第一幅显示原始图像,第二幅显示全黑图像。

我错过了使用simpleCV还是这是一个错误?

码:

from itertools import product
from SimpleCV import Image
from SimpleCV import Color

if __name__ == '__main__':
    pass

def number_of_hues(picture):
    image = Image(picture)

    #convert the picture's space to HSV
    image = image.toHSV()
    image.show()
    original_histogram = image.histogram()


    (image_x_length, image_y_length) = image.size()
    for i,j in product(range(image_x_length), range(image_y_length)):
        image[i,j] = Color.BLACK


    image.show()

    new_histogram =  image.histogram()

    for o,n in zip(original_histogram, new_histogram):
        if o != n:
            print o,n

您什么时候最后一次从github开发仓库中撤出? 图像类的set项调用中存在一个错误,该错误阻止直接设置图像。 几个星期前已修复。 通常,您应该尝试避免直接循环遍历图像对象并直接设置像素,因为这可能会很慢。 如果您认为发现了错误,请向我们的github存储库提交问题,我们将尝试尽快解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM