我的問題是爲什麼以下代碼中的兩個直方圖是相同的。 由於圖片確實發生變化,首先顯示原始圖片,然後顯示全黑圖片。爲什麼直方圖是相同的[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
它工作正常。幾天前我已經更新了我的SimpleCV。 – Froyo 2013-03-17 23:22:26