Ask Your Question

advice for costum font recognition

asked 2012-10-03 16:18:43 -0500

julius gravatar image


ive found quite a lot of theoretical papers on google, but only a few practical examples. these are most of the chars i would like to recognize:



trying javaocr showed that the chars would need some space between them to be recognized. do you know any other ways in opencv to work with these?


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-10-04 03:52:37 -0500

elmiguelao gravatar image

An alternative is to segment each number and letter, via contour extraction, and analyse their Hu moments against those you pre-calculate on each reference character. Hu moments have the advantages of being rotation, reflection and scaling invariant, hence the name Hu invariants. This method is computationally cheap (i.e. fast): moments are aggregated measures from the shapes (center of mass, center of inertia, etc) so comparisons are made number-to-number, as opposed to pixel-to-pixel comparisons which are more costly.

In this article the whole recognition process is explained step-by-step, with CV code. In the Bradski-Kaehler openCV book (Chapter 8) there is a discussion about Hu moments for character recognition. Finally there is a library function cvMatchShapes which would extract those moments and compare them internally.

Finally, if you search in internet for "Hu moments character recognition", there are many academical references, but they boil down to the explanations quoted above.

edit flag offensive delete link more

answered 2012-10-04 02:10:06 -0500

Adi gravatar image

If the fonts are always fixed size, then maybe a simple template matching scan will be sufficient.

edit flag offensive delete link more

Question Tools


Asked: 2012-10-03 16:18:43 -0500

Seen: 1,072 times

Last updated: Oct 04 '12