Results 1 to 6 of 6

Thread: OCR.recognize character mis-match

  1. #1
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default OCR.recognize character mis-match

    Hi,

    Using this code sample to read characters off a UI

    Code:
    OCR.Recognize(clanNameBounds[i],TOCRColorRule.Create([16777215]), RS_FONT_PLAIN_12)
    I note that the OCR engine can't seem to differentiate between "p" and "o" inspite of updating the font set

    I have attached the images below:

    lwOJ2ts.png

    I can't seem to upload bmps so here is the font file i am using for ascii 112

    https://imgur.com/Fy0W4MS

  2. #2
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Unsure about this one. I'd honestly expect the "g" to be the problem here, as the "p" looks fine. Might be that the p you have replaced it with is not correctly centered, or the width of the image being too much.
    Last edited by slacky; 08-16-2022 at 01:13 PM.
    !No priv. messages please

  3. #3
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    SimpleOCR requires every pixel of the character for a match. The some pixels on the bottom of the `p` are hidden, so that is why it's thinking it's a `o`.

  4. #4
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    Unsure about this one. I'd honestly expect the "g" to be the problem here, as the "p" looks fine. Might be that the p you have replaced it with is not correctly centered, or the width of the image being too much.
    you are spot on. so basically this is for a pserver and the menu item i am trying to read doesn't have proper vertical padding so letters like p, g, and even q have their bottoms chopped off. I guess the issue is how I am creating the bitmap file. When you mentioned correctly centered, what are the best practices for creating bitmap file?

  5. #5
    Join Date
    Oct 2011
    Posts
    422
    Mentioned
    15 Post(s)
    Quoted
    116 Post(s)

    Default

    Quote Originally Posted by Olly View Post
    SimpleOCR requires every pixel of the character for a match. The some pixels on the bottom of the `p` are hidden, so that is why it's thinking it's a `o`.
    does this include the black mask?
    Last edited by slushpuppy; 08-17-2022 at 10:30 AM.

  6. #6
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Quote Originally Posted by slushpuppy View Post
    does this include the black mask?
    The black mask is used but it's not the entire black on the font bitmap. It's just the black pixels in the bounds of the (white) character.
    And the black mask hits don't have to be perfect, iirc anything > 50% is good.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •