Ask Your Question
0

Urgent!!! help with feature detection.

asked 2014-10-23 08:22:12 -0600

chim gravatar image

updated 2018-01-06 07:35:05 -0600

Hi, Everyone, i'm new to this and trying to learn real time feature matching. I try to do it first wit images but i stuck in this tutorial eventually - http://docs.opencv.org/trunk/doc/py_tutorials/py_feature2d/py_matcher/py_matcher.html#matcher I wrote the exactly same thing as the first example and i got this error:

Traceback (most recent call last): File "C:\Users\chimyun\Desktop\FYP\tutorial.py", line 25, in <module> img3 = cv2.drawMatches(img1,kp1,img2,kp2,matches[:10], flags=2) TypeError: Required argument 'outImg' (pos 6) not found

I'm using opencv 3.0.0 Alpha with python 2.7.6 as 2.7.10 doesnt have the method cv2.drawMatches(). Please help me as i need to learn it as soon as possible. Any help would be appreciated.

edit retag flag offensive close merge delete

Comments

unlike, what the docs say, the outImg param is mandatory.

berak gravatar imageberak ( 2014-10-23 11:21:22 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-10-23 11:04:13 -0600

Hi, You should try with a more stable version (i.e. 2.4.X) as the alpha is not yet stable, and the documentation is not fully updated...

edit flag offensive delete link more
0

answered 2014-12-08 16:28:31 -0600

tenspd137 gravatar image

CV3 isn't probably baked yet, but a workaround I found was to create a dummy array to send to the function since it thinks it needs it:

img3 = np.zeros((1,1)) and then

im4 = cv2.drawMatches(im1,kp1,ig2,kp2,matches[:10],img3,flags=2)

then imshow(im4/255.0) to view

Obviously, it probably isn't supposed to work this way, but since CV3 is in development it is probably a bug that needs to be worked out in the python interface still.

Your mileage may vary - but it worked for me pretty well. Once the python/C++ interface gets cleaned up, you shouldn't have to make that img3 to fill in the function.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-10-23 08:22:12 -0600

Seen: 5,152 times

Last updated: Dec 08 '14