Just initialize orb with
orb = cv2.ORB_create()
instead of
orb = cv2.ORB()
for opencv 3.3.1 dev
outImg
is optional. However, the python error message is explicit - an argument is required in position 6, it is named outImg
in the function signature. I suspect the documentation may not exactly match the code requirements. It appears that the signature of the C++ code that the python binding is calling has no default value for outImg
, so need that argument to be supplied.<function_name>.__doc__
. In this case, you can see that outImg
is not shown as optional. Here is the output from my installation:>>> cv2.drawMatchesKnn.__doc__
'drawMatchesKnn(img1, keypoints1, img2, keypoints2, matches1to2, outImg[, matchC
olor[, singlePointColor[, matchesMask[, flags]]]]) -> outImg'
None
in the place of outImg
. I think that will work for your case also.draw_params = dict(matchColor = (0,255,0),
singlePointColor = (255,0,0),
matchesMask = matchesMask,
flags = 0)
img3 = cv2.drawMatchesKnn(img1,kp1,img2,kp2,matches,None,**draw_params)
draw_params
dict, you could try just passing flags
i.e.img3 = cv2.drawMatchesKnn(img1,kp1,img2,kp2,matches,None,flags=2)