我想使用当前数组作为在帧图像中进行的模糊操作的输出数组,而im得到这个错误:
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))发布于 2013-01-25 10:37:01
如in the documentation所述,cv2.blur的参数如下:
cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) → dst所以,我想你是说
current= cv2.blur(frame, (15,15))发布于 2013-10-24 09:32:32
您可能已经使用cv2.imread的cv.CreateImage instread打开了图像。只有当您使用imread打开图像时,才能使用imwrite。
https://stackoverflow.com/questions/14514369
复制相似问题