Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
luddie

Basic help with scar OCR

Recommended Posts

Hello Lovely scar community!:D

 

I am trying to use the ocr functionality of scar, but for some reason I can't get it to work. I type the text 'what' in word with verdana font size 22 and not bold etc.. But SCAR says it cannot find it and returns 'FAIL'.

Does somebody know why this is and what I'm doing wrong?

 

 

Any help is hugely appreciated.

 

 

program OCR;varx,y,c : Integer;Found:Boolean;beginc := LoadCharsFromFont2('Verdana', 22, False, False, False, False); Found:= IsTextInAreaEx(0, 0, 1300,700, x, y, 'what', 5, c, True, True, 0, 0, -1) if (Found=True)thenWriteLn('Found');if (Found=False)thenWriteLn('FAIL');end.

 

Edited by luddie

Share this post


Link to post
Share on other sites

 

function IsTextInAreaEx(x1, y1, x2, y2: Integer; var x, y: Integer; S: string; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer): Boolean; Searches for text in area specified by x1, y1, x2, y2. Other parameters match IsTextAtEx.

 

 

Change your Max spacing to more than 0 (1-10), CheckShadow and Check outline to false, try using exact color instead of -1.. search area looks pretty large.. maybe try to narrow that down as well. Eliminate and rule out which inputs are causing failure.

 

More guidelines from old manual

 

Checks if text specified by S is at location specified by x, y. Tolerance specifies acceptable color range in case characters are not completely monochrome, Chars specifies font number returned by LoadChars2 or LoadCharsFromFont2, CheckShadow specifies whether function should look for shadow, CheckOutline specifies whether function should verify if character borders are correct, MinSpacing and MaxSpacing are RS1 and RS2 specific parameters for text with changing spacing between characters, in other cases use MinSpacing=0 and MaxSpacing=0, TextColor specifies text color, if set to -1, will search for text in any color.

Share this post


Link to post
Share on other sites

Ye I learned the function from the old manual. When I put the CheckShadow and check outline to false it finds my text, at least I thought it was. But when I put the color to 0 (since my text in word is black) it does not find my text anymore. So even with color to -1 it does not actually find my text, but something weird that looks like my text in another color.

 

How do i know which input is causing failure? I tried adjusting all of them and it never finds the text except with color -1 and even then it does not find the text, because the x,y values are not those were the text is...

Can you test this script see if it works for you with a word text?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...