0

I want to use the current array to be the output array of the blur operation made in the frame image and im getting this error:

TypeError: <unknown> is not a numpy array

I already checked and both are arrays of the same size and type, I dont understand why this is happening.

Part of the code:

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))

2 Answers 2

2

The arguments to cv2.blur, as described in the documentation, are the following:

cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) → dst

So, I think you meant

current= cv2.blur(frame, (15,15))
Sign up to request clarification or add additional context in comments.

2 Comments

oh thanks!! I was used to use the older one the cv one instead of cv2, and then I do mistakes like this.. Thanks for the help
@user1832231 No problem. If there's nothing to add to the answer, make sure to mark it as accepted (there's a green checkbox next to it). Since you're just getting started here on SO, you may want to read the faq
0

Probably you have open the image using cv.CreateImage instread of cv2.imread You can use imwrite only if you have opened image using imread.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.