Forum Discussion
I have some limited experience with OCR that I will share...
I recommend that chop the one-liner into pieces and break down the problem you are trying to solve. My gut tells my that you are not capturing the image correctly. You could try something like this (in JavaScript)...
var region;
var pic;
var ocr;
var myText = "";
var attr = Log.CreateNewAttributes();
try
{
//
// Capture the image to a region
region=Regions.CreateRegionInfo(Aliases.ProgramName.ViewPath, 1, 1,
Aliases.ProgramName.ViewPath.Width, Aliases.ProgramName.ViewPath.Height, false);
//
//Get the image from the region.
pic = region.Picture();
//
//Create an OCR object using the image.
ocr = OCR.CreateObject(pic);
//
//Get the text from the OCR object.
myText = ocr.GetText();
Log.Message(myText, "", pmNormal, attr, pic, -1)
}
catch(err)
{
Log.Error(err.message, "", pmNormal, attr, pic, -1);
}
I recommend you step through the debugger and find out where the problem occurs.