【发布时间】:2013-03-27 21:47:58
【问题描述】:
我想在 python 中计算我的 Cielab 图像的 3D 直方图。我正在使用 openCV 来计算我的直方图。我想使用 openCV 的 compareHist 函数比较图像,这就是我使用 openCV 计算图像的 3D 直方图的原因。
我尝试了以下变量:
i_lab = image.copy()
i_lab = i_lab.astype(np.uint8)
Range_hist = [[0, 100], [-100, 100], [-100, 100]]
hist_1 = cv2.calcHist([i_lab], [[0], [1], [2]], None, [[20], [20], [20]], Range_hist)
但它给出了错误SystemError: error return without exception set
请告诉我我做错了什么以及是否可以在 python 中使用 openCV 计算 3D 直方图
【问题讨论】:
-
我在使用numpy库生成的直方图上使用了
compareHist函数,所以我不再需要上面的函数来计算我的直方图了。