Using out of process engine loader

  • 1.6K Views
  • Last Post 30 September 2014
kirill posted this 30 September 2014

Hi, I'm trying to use OutprocLoader to create engine and recognize image.

Here is a code:

var engineLoader = new OutprocLoader();
var processControl = (IHostProcessControl) engineLoader; processControl.SetClientProcessId(Process.GetCurrentProcess().Id); var engine = engineLoader.GetEngineObjectEx("SWATXXXXXXXXXXXXXXXXXXXX", null, null, true); var frDocument = engine.CreateFRDocument(); frDocument.AddImageFile(@"C:\Users\kiril_000\Downloads\Demo.jpg"); frDocument.Recognize(); Console.WriteLine(frDocument.PlainText.Text);

But every time I run this code, it returns empty string. Demo image contains text. So how can I debug engine in this case? Does FREngine.exe write logs?

Thanks in advance.

Anastasiya Medvedeva posted this 30 September 2014

Most probably, Engine object was not correctly created. Please try to use GetEngineObject function instead of GetEngineObjectEx one. Please note that you should pass ProjectId as the first parameter. To get more information about ProjectId see this KnowledgeBase article.

">>Does FREngine.exe write logs?"

Sure, in order to turn on logging, use IEngine::StartLogging method (Help -> API Reference -> Engine Object -> Supplementary Methods).

Close