Ask Your Question
0

TypeError: drawKeypoints() missing required argument 'outImage' (pos 3)

asked 2019-07-23 12:04:21 -0600

Tahmina gravatar image

updated 2019-07-23 12:13:14 -0600

berak gravatar image

Hii, I'm new to opencv and python. I tried with a sample code to extract the features and I'm getting this error TypeError: drawKeypoints() missing required argument 'outImage' (pos 3) and my code goes like this

import numpy as np
import cv2
from matplotlib import pyplot as plt

img = cv2.imread('1.png',0)

# Initiate FAST object with default values
fast = cv2.FastFeatureDetector_create()

# find and draw the keypoints
kp = fast.detect(img,None)
img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))

# Print all default params
print ("Threshold: ", fast.getInt('threshold'))
print ("nonmaxSuppression: ", fast.getBool('nonmaxSuppression'))
print ("neighborhood: ", fast.getInt('type'))
print ("Total Keypoints with nonmaxSuppression: ", len(kp))

cv2.imwrite('fast_true.png',img2)

# Disable nonmaxSuppression
fast.setBool('nonmaxSuppression',0)
kp = fast.detect(img,None)

print ("Total Keypoints without nonmaxSuppression: ", len(kp))

img3 = cv2.drawKeypoints(img, kp, color=(255,0,0))

cv2.imwrite('fast_false.png',img3)

Any suggestions on how to extract the features of an image to compare with webcam image will be helpful. Thanks.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-07-23 12:18:07 -0600

berak gravatar image

it is like the error says, the outImage param is mandatory. use it like:

img3 = cv2.drawKeypoints(img, kp, outImage=None, color=(255,0,0))

also have another look at the tutorial, where it is used correctly.

edit flag offensive delete link more

Comments

1

That tutorial helped me.Thanks

Tahmina gravatar imageTahmina ( 2019-07-23 12:55:31 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-07-23 12:04:21 -0600

Seen: 1,509 times

Last updated: Jul 23 '19