[英]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.