Conjecture::Glyph Class Reference

#include <Glyph.h>

Inheritance diagram for Conjecture::Glyph:

Conjecture::Element Conjecture::Root List of all members.

Detailed Description

A rectangular region of the overall image that has been identified as representing a single character.

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

The Box class represents all information associated with the graphical reprsentation of a to-be-identified character. The correctness of this box (i.e. whether it really does represent a single character) depends on:

Ths class is responsible for converting an image of a character into a unicode character value, and as such is at the heart of the OCR code.


Public Member Functions

 Glyph (Element *parent=NULL, void *internal=NULL)
 Glyph (Glyph *glyph)
virtual GlyphasGlyph ()
virtual const GlyphasGlyph () const
void setUnicode (wchar_t unicode)
virtual void printSummary (std::ostream &os=std::cerr, const std::string &indent="", int index=-1) const
void addChar (const Glyph::Char &chr)
GlyphFeatures::LineType lineType () const
virtual void writeText (std::ostream &os) const
wchar_t unicode () const
const std::vector< Char > & charset () const
int best () const
virtual int type () const
const Box * box () const
void boxIs (Box *box)
Box *& boxRef ()

Static Public Member Functions

static void test (int argc=0, const char *argv[]=NULL)

Protected Member Functions

void bestIs (const int &best)
int & bestRef ()
wchar_t & unicodeRef ()
void unicodeIs (wchar_t unicode)
std::vector< Char > & charset ()

Classes

class  Char


Constructor & Destructor Documentation

Conjecture::Glyph::Glyph Element parent = NULL,
void *  internal = NULL
 

Parent allowed to be NULL only until dependence on C code is removed. The 'internal' param is also temporary (it is a Box struct if provided).

Conjecture::Glyph::Glyph Glyph glyph  ) 
 

Non-standard copy constructor (may switch to pass-by-ref later)

  • arg intentionally non-const due to parent-link issues


Member Function Documentation

virtual Glyph* Conjecture::Glyph::asGlyph  )  [inline, virtual]
 

Allows Image instances to be converted to Glyph instances safely without requiring explicit down-casting.

Reimplemented from Conjecture::Element.

GlyphFeatures::LineType Conjecture::Glyph::lineType  )  const
 

Returns a categorization of this glyph within its line.

See the LineType documentation for semantics.

virtual void Conjecture::Glyph::printSummary std::ostream &  os = std::cerr,
const std::string &  indent = "",
int  index = -1
const [virtual]
 

Print out information about this Element.

Reimplemented from Conjecture::Element.

void Conjecture::Glyph::setUnicode wchar_t  unicode  )  [inline]
 

Initializes the crucial 'unicode' field to a given character.

In many ways, the entire purpose of an OCR can be summarized as figuring out what value to pass to this method, for every Glyph in a Page.

void Conjecture::Glyph::test int  argc = 0,
const char *  argv[] = NULL
[static]
 

Unit testing method.

This static method should create instances of the class (and instances of any other class necessary) and perform tests to ensure that all methods within the class are working as expected.

Reimplemented from Conjecture::Element.

virtual int Conjecture::Glyph::type  )  const [inline, virtual]
 

Returns an integer establishing how "small" this image type is, relative to other image types. It has nothing to do with width or height, but instead with the conceptual size of the type itself. All instances of a particular subtype will always return the same value. The code is designed so that Glyph returns a larger number than Word, which is larger than Line, which is larger than Region, which is larger than Page. This allows us to perform some sanity checks on hierarchial decompositions to ensure that we don't make silly structures in which Lines have Glyphs as parents, etc.

FUTURE FIX: This method should be pure-virtual, but making it pure-virtual causes compilation failure (pure virtual method invoked in constructor).

Reimplemented from Conjecture::Element.

virtual void Conjecture::Glyph::writeText std::ostream &  os  )  const [virtual]
 

Writes a textual representation of this element to given output stream.

Reimplemented from Conjecture::Element.


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