Search

Atalasoft Knowledge Base

HOWTO: Server OCR with GlyphReader

Administrator
DotImage

The best way to OCR on a server is to create a Windows Service that will process images as they are added to a database or directory. You can use the FileSystemFolderWatcher component or a timer to view new files as they are added to a specific folder.

GlyphReader is restricted in the number of concurrent processes (or threads) by the number of licenses purchased. Each server license allows for a maximum of 20 threads (your number of licensed threads depends on your license agreement - licenses are sold with 5,10,15, or 20 threads). The ThreadPool class in the .NET Framework is great at limiting the number of OCR processes by the number of cores/CPU's on your server, or the number of licenses you have.

NOTE: SDK licenses for GlyphReader are limited to 1 thread/instance, and so you must be running under a server license in order to run/test multiple threads

Do not reference Atalasoft.dotImage.Ocr.GlyphReader.dll in your ASP.NET web application, because you will not be able to compile with the error "The specified module could not be found. (Exception from HRESULT: 0x8007007E)".

If you need to OCR directly from an ASP.NET application, considering saving an XML file containing a unique GUID and a file link to the image file. Then have your windows service pick up this new XML file as a job ticket. Let the ThreadPool do it's work by passing in the image referenced in the job ticket into the Thread Pool and saving the resulting OCR'ed file with the unique GUID filename. By watching the output folder, you will be able to report back to the user once the job is complete by matching the unique GUID in the job ticket with the output filename.

This ensures you have full control over thread count .. if you try and service incoming web requests with direct OCR, and you get more than you're licensed for at once, you can end up throwing license exceptions

See Also:

HOWTO: Load GlyphReaderEngine by Reflection

INFO: OcrEngine - Overview

INFO: GlyphReader Engine - Overview

Q10141 - HOWTO: Deploy a project using OCR

Original Article:
Q10202 - HOWTO: Server OCR with GlyphReader

Details
Last Modified: 7 Months Ago
Last Modified By: Tananda
Type: HOWTO
Rated 5 stars based on 1 vote
Article has been viewed 607 times.
Options
Also In This Category