【发布时间】:2014-07-14 17:11:09
【问题描述】:
我正在尝试对图像应用阈值,但出现以下错误:
TypeError: 'unknown' 不是 numpy 数组
我在 cv2.imshow() 行收到此错误。
这是我的代码:
import cv2
import numpy as np
img = cv2.imread('...',0)
img2 = cv2.imread('...',0)
fImg = cv2.addWeighted(img.astype(np.float32), 0.9, img2.astype(np.float32), 0.1, -20.0)
th = cv2.threshold(fImg, 127, 255, cv2.TRESH_BINARY)
cv2.imshow('th', th)
cv2.waitKey(0)
cv2.destroyAllWindows
提前感谢您的帮助!
【问题讨论】:
标签: python opencv image-processing numpy computer-vision