Opencv Chamfer Matching Error in Results

asked 2016-01-14 07:09:55 -0600

thesis_ gravatar image

Hi folks! I really need help in this one...

I've been working on edge-based template matching and happened to find chamfer matching. I've been trying to work at this on my own but I think my knowledge about chamfer matching and its implementation in opencv is lacking (since I can't also find a good documentaiton or tutorial of it). So I hope you find time to answer my question.

I was able to run chamfer matching implementation in opencv python. However, I don't understand why my results are not what I expect them to be.

Here's how I called the function

bestfit, results, cost = cv2.chamerMatching(queryFrame, template)

Here's my sample input image (i already made edge-based image processing on it) image description Here's the template image description

And here's the result image description

I am really at lost as to how I will solve it. Do I have to 'guess' on the right constants required in the parameter (since there's a lot of it, and they have default values) or is it about the input image/template image? Please help...

Any help will be much appreciated. Thanks!

P.S. I also tried the input image incuded in samples, however, it's not also properly matching the template... i don't know what is the main culprit... is it my copy of opencv or i don't know...

edit retag flag offensive close merge delete

Comments

imho, the chamferMatching is broken, and it is no more part of current opencv3 api.

berak gravatar imageberak ( 2016-01-14 07:29:32 -0600 )edit

ohhh... that's why... thanks for that info :)

P.S.Last night, i was able to find a working one through github (for earlier version of opencv). Thanks anyhow!!!! :)

thesis_ gravatar imagethesis_ ( 2016-01-14 17:10:39 -0600 )edit