Click or drag to resize

IOcrManagerGetOcrEngineT Method

Get an OCR engine

Namespace:  EdaIntegrationContract.OCR
Assembly:  EdaIntegration.Contract (in EdaIntegration.Contract.dll) Version: 7.6
Syntax
C#
T GetOcrEngine<T>()
where T : class, IOcrEngine

Type Parameters

T
The type of OCR engine to retrieve

Return Value

Type: T
The desired OCR engine
Examples
The following example demonstrates updating the properties for a case.
C#
using EdaIntegrationContract;
using EdaIntegrationContract.Case;
using EdaIntegrationContract.OCR;
using EdaIntegrationContract.OCR.Expervision;

class Sample
{
    public static void Main()
    {
        var edaIntegration = new EdaIntegration().ConnectToExplore();
        ICase edaCase = edaIntegration.Cases.OpenCaseByName("Case 1");

        // Set OCR case properties
        IOcrProperties ocrProps = theCase.OCR.Properties;
        ocrProps.MaxOcrAgents = 4;
        ocrProps.QueueForOcrDuringAnalysis = true;
        ocrProps.AnalysisOcrFileTypes = theCase.OCR.GetValidOcrFileTypes();
        theCase.OCR.UpdateProperties();

        // Specify which OCR engine to use 
        IExpervisionOcrEngine ocrEng = theCase.OCR.GetOcrEngine<IExpervisionOcrEngine>();
        ocrEng.Language = ExpervisionLanguage.English;
        ocrEng.AutoDeskew = true;
        ocrEng.AutoRotate = ExpervisionAutoRotateSetting.AlwaysOn;
        theCase.OCR.SetActiveOcrEngine(ocrEng);
    }
}
See Also