Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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.

click to hide/show revision 2
None

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

berak gravatar image

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

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

plt

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

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

# Initiate FAST object with default values

values fast = cv2.FastFeatureDetector_create()

cv2.FastFeatureDetector_create()

# find and draw the keypoints

keypoints kp = fast.detect(img,None) img2 = cv2.drawKeypoints(img, kp, color=(255,0,0))

color=(255,0,0))

# Print all default params

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

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

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

# Disable nonmaxSuppression

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

fast.detect(img,None)

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

len(kp))

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

color=(255,0,0))

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

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.