Letters recognition using template matching

2 views (last 30 days)
Dawid J
Dawid J on 22 Mar 2014
Edited: Image Analyst on 25 Jun 2021
Hey Guys, I'm having some problems with my license plate recognition. The method I'm trying to use is 'template matching'. I have already segmented picture of license plate, and it looks like that:
znaki3 =
Columns 1 through 6
[40x28 logical] [40x28 logical] [40x28 logical] [40x28 logical] [40x28 logical] [40x28 logical]
Column 7
[40x28 logical]
They are 7 different letters and I made them the same dimension. My template is made the same way and there are 35 letters within (also 40x28).
Now I'm trying to use 'corr2' function and this is how my script looks like:
load wzor % Loads the templates of characters
comp = [ ];
for rr = 1:length(znaki3)
for n = 1:length(wzor)
sem(n) = corr2(wzor{1,n},znaki3{rr}); Correlates every input image (1 to 7) with every image in the template
comp = [comp sem(n)];
end
f(rr) = max(comp);
vd(rr) = find(comp == f(rr));
end
But it doesn't seem to work properly. I hope you could give me some hints.

Answers (1)

Image Analyst
Image Analyst on 22 Mar 2014
Edited: Image Analyst on 25 Jun 2021
"it doesn't seem to work properly" is not descriptive enough. If it's just not doing OCR accurately, then there's no one here who is an OCR expert so you're on your own. You can find OCR algorithms here: http://iris.usc.edu/Vision-Notes/bibliography/contentschar.html#OCR,%20Document%20Analysis%20and%20Character%20Recognition%20Systems
Or use the ocr() function in the Computer Vision Toolbox.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!