#include <Glyph.h>
Inheritance diagram for Conjecture::Glyph:
*******************************************************************
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 Glyph * | asGlyph () |
virtual const Glyph * | asGlyph () 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 |
|
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). |
|
Non-standard copy constructor (may switch to pass-by-ref later)
|
|
Allows Image instances to be converted to Glyph instances safely without requiring explicit down-casting. Reimplemented from Conjecture::Element. |
|
Returns a categorization of this glyph within its line. See the LineType documentation for semantics. |
|
Print out information about this Element. Reimplemented from Conjecture::Element. |
|
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. |
|
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. |
|
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. |
|
Writes a textual representation of this element to given output stream. Reimplemented from Conjecture::Element. |