Hello, I got chamfermatching.cpp and sample code from OpenCV 2.4.9 and I am trying to make the algorithm to match characters. Please see my source files and testing images attached. I got below results:
The program can match e1.png in e2.png, minCost is 0.0626175. It can match e1.png in e1.png(match itself), minCost is 0.0730605. But it can also match e1.png in a.png, minCost is 0.0681643.
You see, this means the match is not good, it cannot distinguish letter a, letter e and bigger letter e. I did a little change to the sample code. Commenting or uncommenting Canny() lines in opencv_test.cpp has the similar results.
I doubt the problem is in the implementation of chamferMatching2() function. Its declaration is: CV_EXPORTS_W int chamferMatching2( Mat& img, Mat& templ, CV_OUT vector<vector<point> >& results, CV_OUT vector<float>& cost, double templScale=1, int maxMatches = 20, double minMatchDistance = 1.0, int padX = 3, int padY = 3, int scales = 5, double minScale = 0.6, double maxScale = 1.6, double orientationWeight = 0.5, double truncate = 20);
You see, there are a lot of default parameters. I doubt the problem exists here. Maybe I should adjust the default parameters? Can you give me some guide to fix the problem?
Thanks in advancee1.png(/upfiles/14078926822989436.png)e2.png(/upfiles/14078928183252037.jpg)(/upfiles/14078927264801916.png)