我想使用当前数组作为在帧图像中进行的模糊操作的输出数组,我得到这个错误:
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))
可能您已经使用cv.CreateImageinstread ofcv2.imread打开了图像 只有使用imread打开图像时,才能使用imwrite。
如in the documentation所述,
cv2.blur
的参数如下:所以,我想你是说
相关问题 更多 >
编程相关推荐