OCR with Infer.NET RRS feed

  • Question

  • I recently found this link that got me interested in probabilistic programming.

    I am programming with C# for some years now and I'm currently trying to adapt to this paradigm.
    My goal is something similiar like in the blogpost. No Captcha but recognition of aritificial low resolution text with applied anti aliasing.

    Of course a big part of the program in the blogpost are probabilistic programming libaries of a higher level then planned for Infer.NET.

    So input oft the simulation would be a string (Array of discrete variables).
    The string has a y value and every letter a x (x2>x1, x3>x2....)
    Output of the model would be in a Array2D. Could I use the System.Drawing.Bitmap und System.Drawing.Graphics to output the
    result in the Array2D or do I need to write something like font rendering and anti aliasing with Infer.NET abstractions?

    After that I think I can let the framework inference back from a picture to the string.
    With relations between the letters (markov chain) I probably could make results even better.

    So is this feasible and reasonly performant with Infer.NET?
    And how would I wire things together. I have some problems imaging where distributions and other things would fit in here.

    Thursday, June 30, 2011 5:55 PM


  • Yes, you could use Infer.NET to do OCR in this way.  You would have to write the full rendering process using the Infer.NET abstractions.  However, as an algorithm for OCR it would be quite slow.  Due to the inference algorithms Infer.NET is using, it would end up testing every possible (x,y) position for every possible glyph, and that takes a long time.  (I have worked on OCR using generative models in the past and I did develop an algorithm for reducing the number of positions that need to be searched, but this algorithm is not incorporated into Infer.NET.)
    • Marked as answer by test16324789 Friday, July 1, 2011 7:30 PM
    Friday, July 1, 2011 1:08 PM