Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I'm a newer in computer vision field.

I found some code examples in EmguCV(.NET wrapper for OpenCV) which I`m trying to use.

Currently I'm working on triangle traffic sign recognition and I'm using cvMatchShapes function.

The function returns "zero" in ideal case, it means that the shapes are the same and the number is

close to zero if shapes are similar.

The problem is that in my case function returns me result which is out of logic. when function compares triangle with the circle, it returns figure which is less than figure, got after comparing two triangles.

Here is the function that I use and the images:

C#
double ratio = CvInvoke.cvMatchShapes(modelSignTraffic, trafficSign, Emgu.CV.CvEnum.CONTOURS_MATCH_TYPE.CV_CONTOURS_MATCH_I3, 0);


modelSignTraffic - is a triangle template.

trafficSign - is an shape that should be compared to the template.

first compared shape-is a circle
second compared shape- is a triangle

For the first shape I get ratio 0.55 and for the second shape I get ratio 0.61 .

I would be very grateful if anybody could explain why do I get such illogical result and how I can fix it?

Thank you in advance.
Posted
Updated 25-Aug-12 21:45pm
v3
Comments
Christian Graus 25-Aug-12 9:02am    
You can't 'fix' it in the sense that you're using a third party system, not actually learning how to do this task yourself. I suspect the result is correct, computer vision is a fuzzy task at best
Mich_90 25-Aug-12 9:33am    
maybe i should use some other method to compare two shapes?
Christian Graus 25-Aug-12 9:42am    
Perhaps, but I suspect the library you have is a good option, perhaps your best

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900