我想使用当前数组作为在帧图像中进行的模糊操作的输出数组,我得到了这个错误:
TypeError: <unknown> is not a numpy array
我已经检查过了,两者都是相同大小和类型的数组,我不明白为什么会这样。
部分代码:
previous = np.zeros((frameHeight,frameWidth,3),np.uint8) #blank image with 640x480 and 3 channels
difference = np.zeros((frameHeight,frameWidth,3),np.uint8)
current = np.zeros((frameHeight,frameWidth,3),np.uint8)
while True:
# Capture a frame
flag,frame = capture.read()
cv2.flip(frame, flipCode=1)
# Difference between frames
cv2.blur(frame, current, (15,15))