←Select platform

RecognitionTime Property

Summary
Gets or sets the recognition time in milliseconds.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public long RecognitionTime { get; set; } 
@property (nonatomic, assign) UInt64 recognitionTime; 
public long getRecognitionTime() 
public void setRecognitionTime(long value) 
public: 
property int64 RecognitionTime { 
   int64 get(); 
   void set (    int64 ); 
} 
RecognitionTime # get and set (OcrStatistic) 

Property Value

The recognition time in milliseconds.

Remarks

Note: This property is not supported in the LEADTOOLS OCR Module - LEAD Engine.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Ocr; 
using Leadtools.Document.Writer; 
 
public void OcrStatisticExample() 
{ 
   // Create an instance of the engine 
   using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)) 
   { 
      // Start the engine using default parameters 
      ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
 
      string tifFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.tif"); 
      string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, "Ocr1.pdf"); 
 
      // Create an OCR page 
      using (IOcrPage ocrPage = ocrEngine.CreatePage(ocrEngine.RasterCodecsInstance.Load(tifFileName, 1), OcrImageSharingMode.AutoDispose)) 
      { 
         // Process the page 
         ocrPage.AutoPreprocess(OcrAutoPreprocessPageCommand.Deskew, null); 
 
         // Recognize the page 
         // Note, Recognize can be called without calling AutoZone or manually adding zones. The engine will 
         // check and automatically auto-zones the page 
         ocrPage.Recognize(null); 
 
         // Show the statistic about the last recognize operation 
         OcrStatistic statistic = ocrEngine.GetLastStatistic(); 
         Console.WriteLine("Recognized characters: {0}", statistic.RecognizedCharacters); 
         Console.WriteLine("Recognized words: {0}", statistic.RecognizedWords); 
         Console.WriteLine("Rejected characters: {0}", statistic.RejectedCharacters); 
         Console.WriteLine("Corrected words: {0}", statistic.CorrectedWords); 
         Console.WriteLine("Recognition time: {0} ms", statistic.RecognitionTime); 
         Console.WriteLine("Reading time: {0} ms", statistic.ReadingTime); 
         Console.WriteLine("Image Preprocessing time: {0} ms", statistic.ImagePreprocessingTime); 
         Console.WriteLine("Decomposition time: {0} ms", statistic.DecompositionTime); 
         Console.WriteLine("Post processing time: {0} ms", statistic.ReadingTime - statistic.RecognitionTime); 
      } 
 
      // Shutdown the engine 
      // Note: calling Dispose will also automatically shutdown the engine if it has been started 
      ocrEngine.Shutdown(); 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Ocr Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.