Understanding Freeman chain codes for OCR

前端 未结 4 1235
醉酒成梦
醉酒成梦 2021-01-30 17:34

Note that I\'m really looking for an answer to my question. I am not looking for a link to some source code or to some academic paper: I\'ve already used the s

4条回答
  •  醉梦人生
    2021-01-30 18:22

    As your question is not specific enough (whether you want the full algorithm based on the chain code or just some probabilistic classifying), I'll tell you what I know about the problem.

    Using the chain code, you can count some properties of the symbol, e.g. the number of rotations of the form 344445, 244445, 2555556, 344446 (arbitrary number of 4s), i.e. the "spikes" on the letter. Say there are 3 sections in the chain code that looks like this. So, this is almost certainly "W"! But this is a good case. You can count numbers of different kinds of rotations and compare that to previously saved values for every letter (which you do by hand). This is quite a good classifier, but alone is not sufficient, of course. It will be impossible for it to differentiate "D" and "O", "V" and "U". And much depends on your imagination.

    You should start by creating a test case of images of some letters with a reference and check your algorithm between the changes and inventing new criteria.

    Hope this answers your question at least partially.

    Update: One bright idea just came into my mind :) You can count the number of monotonic sequences in the chain, for example, for chain 000111222233334443333222444455544443333 (a quick dumb example, doesn't really correspond to any letter) we have
    00011122223333444 3333222444455544443333,
    00011122223333444 3333222 444455544443333,
    000111222233334443333222 4444555 44443333,
    0001112222333344433332224444555 44443333,

    i.e. four monotonic subsequences.

    This should be a good generalization, just count the number of this changes for real letters and compare to that acquired from the detected chain, this is a good try.

    Some problems and ideas:

    1. Chain is cyclic in a way, so you should deal with detecting monotony on the ends of the chain (to avoid off-by-one errors),
    2. Some artifacts should be accounted for, for example, if you know that letter is big enough (for example, 20 pixels in height), you would want to ignore monotony interruption shorter than 3 items, for example :)

提交回复
热议问题