public int RecognizedWords { get; set; } @property (nonatomic, assign) NSUInteger recognizedWords; public int getRecognizedWords()public void setRecognizedWords(int value)
RecognizedWords # get and set (OcrStatistic)
The number of recognized words on the last page.
using Leadtools;using Leadtools.Codecs;using Leadtools.Ocr;using Leadtools.Document.Writer;public void OcrStatisticExample(){// Create an instance of the engineusing (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)){// Start the engine using default parametersocrEngine.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 pageusing (IOcrPage ocrPage = ocrEngine.CreatePage(ocrEngine.RasterCodecsInstance.Load(tifFileName, 1), OcrImageSharingMode.AutoDispose)){// Process the pageocrPage.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 pageocrPage.Recognize(null);// Show the statistic about the last recognize operationOcrStatistic 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 startedocrEngine.Shutdown();}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS23\Bin\Common\OcrLEADRuntime";}
import java.io.File;import java.io.IOException;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;import org.junit.*;import org.junit.runner.JUnitCore;import org.junit.runner.Result;import org.junit.runner.notification.Failure;import static org.junit.Assert.assertTrue;import leadtools.*;import leadtools.codecs.*;import leadtools.document.writer.*;import leadtools.ocr.*;public void IOcrStatisticExample() {final String OCR_LEAD_RUNTIME_DIR = "C:\\LEADTOOLS23\\Bin\\Common\\OcrLEADRuntime";final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images";// Create an instance of the engineOcrEngine ocrEngine = OcrEngineManager.createEngine(OcrEngineType.LEAD);// Start the engine using default parametersocrEngine.startup(null, null, null, OCR_LEAD_RUNTIME_DIR);assertTrue(ocrEngine.isStarted());String tifFileName = combine(LEAD_VARS_IMAGES_DIR, "Ocr1.tif");// Create an OCR pageOcrPage ocrPage = ocrEngine.createPage(ocrEngine.getRasterCodecsInstance().load(tifFileName, 1),OcrImageSharingMode.AUTO_DISPOSE);// Process the pageocrPage.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 pageocrPage.recognize(null);// Show the statistic about the last recognize operationOcrStatistic statistic = ocrEngine.getLastStatistic();assertTrue("Statistics have been received", statistic != null);System.out.printf("Recognized characters: %s%n", statistic.getRecognizedCharacters());System.out.printf("Recognized words: %s%n", statistic.getRecognizedWords());System.out.printf("Rejected characters: %s%n", statistic.getRejectedCharacters());System.out.printf("Corrected words: %s%n", statistic.getCorrectedWords());System.out.printf("Recognition time: %s ms%n", statistic.getRecognitionTime());System.out.printf("Reading time: %s ms%n", statistic.getReadingTime());System.out.printf("Image Preprocessing time: %s ms%n", statistic.getImagePreprocessingTime());System.out.printf("Decomposition time: %s ms%n", statistic.getDecompositionTime());System.out.printf("Post processing time: %s ms%n", statistic.getReadingTime() - statistic.getRecognitionTime());// Shutdown the engine// Note: calling Dispose will also automatically shutdown the engine if it has// been startedocrEngine.shutdown();}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
