Conjecture::OCRModule Class Reference

#include <OCRModule.h>

Inheritance diagram for Conjecture::OCRModule:

Conjecture::GocrModule Conjecture::OcradModule Conjecture::DefaultModule Conjecture::WmhModule List of all members.

Detailed Description

AbstractFactory design pattern supporting the bundled creation of related Component algorithms.

*****************************************************************

In order to make customization easy, Conjecture identifies the fundamental algorithms necessary to perform OCR. Each of these algorithms is formalized into a Component class hierarchy - different subclasses provide different implementations of the algorithm. A particular run of the OCR establishes which strategy to use for every one of its algorithms, and performs them in the appropriate sequence (the sequence in which algorithms are applied is also one of the algorithms).

Since the specific strategy for solving one problem might depend on or require a specific strategy for solving some other pattern, we introduce an Abstract Factory design pattern. In general, an Abstract Factory is a collection of Factory Methods (which produce products). An Abstract Factory allows one to enforce dependencies between individual products created.

NOTE: The products being produced here are instances of a specific subclass of each Component hierarchy. Component is another design pattern, and normally the subclasses are Singletons (the classes represent algorithms, and are normally stateless, or at least requiring only a single state). However, I have not yet fully established whether using Singletons will pose problems for multi-threading or parallel/distributed algorithms, so for now I'm not making Component subclasses singletons. If we do decide to do so, it might be easier to just have the OCRModule intern objects than to put the Singleton design pattern into every single Component subclass. There will be many Component hierarchies, and potentially many subclasses in each hierarchy.


Public Member Functions

FormatComponentformat () const
IdentifyComponentidentify () const
SegmentComponentsegment () const
ProcessComponentprocess () const
void init ()
virtual ProcessComponentcreateProcessComponent () const =0
virtual SegmentComponentcreateSegmentComponent () const =0
virtual IdentifyComponentcreateIdentifyComponent () const =0
virtual FormatComponentcreateFormatComponent () const =0
virtual void processArgs (int argc, const char **argv, Env *env=NULL)

Protected Member Functions

void formatIs (FormatComponent *format)
void identifyIs (IdentifyComponent *identify)
void segmentIs (SegmentComponent *segment)
void processIs (ProcessComponent *process)


Member Function Documentation

virtual void Conjecture::OCRModule::processArgs int  argc,
const char **  argv,
Env env = NULL
[inline, virtual]
 

Command-line processing

This method provides module-specific command-line processing.

The default implementation is a no-op. Subclasses redefine as necessary.

Reimplemented in Conjecture::GocrModule.


The documentation for this class was generated from the following files:
Generated on Thu Jun 15 19:56:10 2006 for Conjecture by  doxygen 1.4.6