I am testing Aspose.OCR, attempting to OCR a simple document, but finding that the OcrEngine.Process() returns jibberish with both my sample document and the sample provided by Aspose.
My code:
var license = new License();
license.SetLicense("Aspose.OCR.lic");
OcrEngine ocrEngine = new OcrEngine();
string text = null;
ocrEngine.Image = ImageStream.FromFile("Sample.Aspose.jpg");
if (ocrEngine.Process())
{
text = ocrEngine.Text.ToString();
}
Assert.IsTrue(text.Contains("TRUTH"), text);
The Sample.Aspose.jpg is a copy of Aspose's GIT sample.
The text returned (truncated for brevity) starts with:
Avi [hhhBuyahLITITI Ll r h u -- - ] ---hhh --III-f LIII-fhh l t} ITI r F8 4 1 T Y L h IiR
lm
'kpfan order 081Dec - - hh - hh - - h - h j : t ITI lblel tljehrerlly }}ollnatffst/t trun IT IT } li III
ckaigf nigh ''I.. } : :;;.et}: fc.'IL:ef:t;;e;atc{1';;;:L IT':c:, ,.,.:,, ., ,...,. ''I
Equivalent jibberish is returned from a sample GIF.
Am I missing some simple settings for the OcrEngine?
The sample file that you have used is an example for OMR operation. You may consider the file “Sample.bmp” for OCR example. The code snippet is fine. It will work.
I work with Aspose as Developer evangelist.