Forum Discussion

yaacovk's avatar
yaacovk
Contributor
9 years ago

OCR on jpg img

Hi,

 

On my application, a timer is filmed in a clip.

Assuming that I know the exact location of timer in the video player, and image of timer is clear enough, like in attached jpg image , is it possible to read the time displayed by OCR ?

 

I used the code below (javascript) , but OCR could not read time displayed:

 

var wnd = TestedObj;

var rect = wnd.Picture(x, y, Width, Height);
Regions.AddPicture(rect , "myfile");

var obj = OCR.CreateObject(rect);
var OCROptions = obj.CreateOptions();

OCROptions.RecognitionRejectionAuto = false;
OCROptions.RecognitionRejection= 0.3;
OCROptions.ExactSearch = false;

var Font = OCROptions.Fonts.Add();

//size of text more or less as below

Font.Sizes.Add(16);
Font.Sizes.Add(18);
Font.Sizes.Add(20);

Log.Message(obj.GetText(OCROptions));

2 Replies

    • yaacovk's avatar
      yaacovk
      Contributor

      Hi Tanya,

       

      According to my knowledge, Text Recognition feature is useful when the text is a part of an tested object. I used it a lot throughout my testing. In my case described above, the timer is a part of snapshot, and Text Recognition does not detect the numbers.

      Do you mean to save the snapshot as an image and then to use Text Recognition feature?

      Thanks