我想使用当前数组作为在帧图像中进行的模糊操作的输出数组,并且我收到此错误:
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))
最佳答案
如in the documentation所述,cv2.blur
的参数如下:
cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) → dst
current= cv2.blur(frame, (15,15))
https://stackoverflow.com/questions/14514369/