ALOCR Ver 1.0 users manual

Tabel of Contents
  1. Overview
  2. Classes

manual home page

reference manual


Overview

ALOCR was a Japanese printed character recognition library released in 1999. It provides functions of paragraph recognition, text line recognition, and patterndictionary maintenance.
You need to use ALPRIM library to abstract paragraphs or text lines from document images.

System dictionary includes "Mincho" , "Gothic", "Maru-Gochic" and "Japanese Text-Book" fonts. We provide some optional dictionary. "Kaisho" and "Reisho" pattern dictionary and so on. "Pattern dictionary compiler" can make pattern dictionary from any Japanese TrueType font.

On 400 dpi image, ALOCR can recognize over 6-point font size. Font size depends on resolution of aquired image.
**72 point correspond to 1 inch square. 6 point character in 400 dpi image correspond to 33 * 33 pixels.


Feature

  1. Up-to-date algorithms
    • Non-linear regularization
      To recognize character, we need to regularize input character pattern to match with pattern dictionary. We separate some informations(size information, stretch or shrink) from input pattern. Non-linear regularization can also separate information(rotation, distortion etc) from input pattern.
      It means that we can match input pattern width pattern dictionary without these excessive informations.

    • Thinning
      We adopt thinning algorithm to get stroke features from character. It means that ALOCR can recognize independent from stroke width features.

    • Hybrid features
      ALOCR achives high recognition rate by combine different types of features. We select features that are independent from other features. The more independent features the richer information to recognize character.

  2. High recognition rate for low resolution images
    ALOCR provides special pattern dictionary for blot or blur characters. Recognition engine can estimate the quality of character pattern automatically and adopts most adequate pattern dictionary to recognize.

  3. Special font handling.
    You can build pattern dictionary for special fonts that are not used frequently by using pattern dictionary compiler. You only need TrueType font to make pattern dictionary.

  4. Powerful language processing.
    We can provide dictionary of statistical probability of Japanese character connection. It reduces error up to 50%.

Table of content


Environment

Windows 95, 98, NT, 2000 and XP. and Visual C++ 6.0 over.
If you want to call from VB or the other development environment, you need to encapsulate VC++ API by building dynamic link library.

Table of content


List of library files

  1. four dlls
    DLLFunction
    ngkocr1.dllRecognition engine core(C++)
    ngkocr2.dllRecognition engine core(C)
    ngkocr3.dllRecognition API(C++)
    ngkocr4.dllRecognition engine(C++)

  2. Import library
    You need ngkocr3.lib correspond to ngkocr3.dll

  3. Header files
    Header fileFunction
    ocrdef.hDefinition of character type and so on.
    ocrco.hDefinition of structure of recognition result and so on.
    errcode.hDefinition of error code
    cjocrpat98.hPattern class
    cjocrstock.h-
    cjocrdict98.hPattern dictionary class
    cjocrrec98.hOne character recognition class
    cjocrline98.hOne line recognition class
    cjocrlang.hOne line recognition class with language processing
    cjocrblock.hOne paragraph recognition class with language processing

  4. Key files
    To start ALOCR library, you need to put two key files in same computer.
    Kurabo issue key files. Key files combined to LAN card and timer. It watch and report illegal use of library.
    You need to define compiler symbol "USEALOCRDLL3" to import classes.

Table of contents.


Class library

Pattern recognition is executed by matching features extracted from target pattern with features in pattern dictionary. Features in pattern dictionary is calculated in the same way that features of target pattern is calculated.
Classes to recognize pattern is as follows.

  1. Pattern dictionary class(CJocrDict)
    Pattern dictionary is a database of features of standard patterns.
    User dictionary also holds pattern images to show users.

  2. Pattern class(CJocrPattern)
    Pattern class is a set of calculation methods to translate input pattern to feature vector. Pattern dictionary class uses this class to build itself.

  3. One character recognition class(CJocrRecognize)
    It holds instances of pattern class and pattern dictionary class. It matched features calculated by pattern class and features stored in pattern dictionary class. As a result of recognition, this class output key string bind with most similar pattern.

  4. One line recognition class(CJocrLine)
    This class abstract character images from a text line image. The character image is sent to one character recognition class. This class sum up results output by One character recognition class.

  5. One line recognition class with language processing.(CJocrLang)
    This class is a subclass of CJocrLine. If you don't attach language dictionary, this class works exactly same as CJocrLine. This class sorts candidates list in ocr results by considering linguistic probability information

  6. Paragraph recognition class(CJocrBlock)
    This class abstracts text lines from a paragraph. And call methods of CJocrLang class.


Table of contents.


Option tools

  1. Pattern dictionary compiler
    This program generate a patter dictionary from Windows TrueType font.

  2. Language dictionary compiler
    This program generate a language dictionary from Japanese corpus(simple plane text). At least 3 million character corpus is need to build reliable dictionary.
    The effect of language dictionary depends on the domain of corpus and document image.
    For example, if you use language dictionary built from address book for newspaper recognition, you will get disadvantage. If you use the same dictionary for address recognition, you can get big advantage.


Table of contents.


Classes


  1. Pattern dictionary class

    Pattern dictionary class is a kind of database class. It manages about 300 dimension feature vectors calculated from regularized character image patter.

    This class regists record to database, deletes record and queries record from database.

    Japanese ocr dictionary has at least 4000 kinds of patterns. Each pattern has about 300 dimension feature vectors. To recognize character is to pickup most similar pattern from pattern database. Similarity is defined as distance or angle of vectors. We need to compare more that 1,200,000 vectors to recognize one character pattern.

    The less calculation we can get the faster pattern recognition. We used many accelerating methods to speed up pattern recognition. Pattern dictionary class also provide the most suitable data structure to execute acceleration methods.

    This class also manage user dictionary. You can add, delete and change user pattern whenever you want to. If you add new records to user dictinary, you receive benefit of new record immediately.

    We describe the detail of pattern dictinary class in reference manual. The outline is only 5 steps as follows

    1. new instance of pattern dictionary class.
    2. set dictionary names(same as filename without extention)
    3. load dictionaries
    4. do operations(recognize, registrate, delete and query).
    5. delete an instance

    You need to use
    pattern class and one character recognition class or one line recognition class or one line regognition with language processing class or one paragraph recognition class to recognize character.
    If you want to registrate ,delete and query, you need to use pattern class with this class.

    Table of contents.


  2. Pattern class

    This class calculate features from character pattern image. Firstly pattern image is regularized to 48 * 48 square image. This transformation is more complicate than an afin transform. We adopt non-linear transformation to regularize character pattern. This operation eliminates extra-features comes from size, rotation, distortion and make matching operation simpler.

    Pattern class is able to calculate more than 20 kinds of features and more than 2000 dimensions of feature vectors. ALOCR uses 6 kinds and 300 dimensions of features.

    We describe a detail of pattern class in reference manual. The outline is only 4 steps as follows
    1. new instance of pattern class
    2. call an initialize method
    3. set pattern rectangle area in document image and calculate features
    4. delete aninstance of pattern class
    To recognize characgter, you need
    pattern dictionary class and one character recognition class or one line recognition class or one line recognition with language processing class or one paragraph recognition class. To registrate pattern, you need to use pattern dictionary class with this class.

    Table of contents.


  3. One character recognition class

    This class holds pattern class and pattern dictionary class and matches feature vectors abstracted from input character image with feature vector databases stored in pattern dictionary. It outputs the most likelihood pattern key string(character code).

    We describe the detail of one character recognition class in reference manual. The outline is 7 steps as follows
    1. New an instance of one character recognition class
    2. Set instances of pattern class and pattern dictionary class
    3. Call an initialize method.
    4. Set pattern image as a rectangle coodinates to instance of pattern class and call a feature calculation method.
    5. Call a recognize method
    6. Get a result of recognition.
    7. Delete an instance

    If you repeat 4 to 6, you can do one character recognition as many as you like.

    Result of recognition consists of up to 10 candidates, they are sorted in accordance with confidence value , character pattern's bounding box and character type of the pattern. You may regard the first candidate as a result of recognition.

    Table of contents.


  4. One line recognition class

    It holds a instance of one character recognition class . This class recognize one line text. Japanese documents have horizontal and vertical lines. This class can handle both directions.
    This class cut out an image of one character from an image of one line text and repeat one character recognition.

    Many kanji characters have spaces in it. If the character pitch is not fixed but variable, the process of abstracting character from text line becomes very complicated. ALOCR recognizes every possible combination and adopt best combination as output.

    We describe the detail of one line recognition class in reference manual. The outline is 7 steps as follows

    1. New an instance of one line recognition class
    2. Set instances of pattern class and one character recognition class
    3. Set document image(address, width and height)
    4. Set text line bounding box and angle.
    5. Call a recognition method.
    6. Get results of recognition.
    7. Delete an instance.

    If you repeat from 4 to 6, you can recognize one line recognition as many as you like. If you want to recognize another document, you repeat from 3 to 6.

    The results of recognition is an array of result, each result is almost as same as one character recognition. Space size information after character is added to result.

    Table of contents.


  5. One line recognition with language processing class

    This class is a subclass of one line recognition class. It act exactly as same as the parent class. In addition this class can rearrange candidates in the result of recognition by using language processing dictionary.
    We recommend you to use this class, is if you don't specify language dictionary this class is identical with one line recognition class.


    Table of contents.


  6. One paragraph recognition class

    This class separate text lines from a paragraph and call methods of one line recognition class with language processing Each paragraph is need to be unified as horizontal paragraph or vertical paragraph. It can not be a mixture of horizontal and vertical lines.

    We recommend to use ALOCR to abstract paragraphs from document image. ALOCR can abstract text paragraphs from tables, maps, drafts and general japanese document like newspaper or catalogue.


    We describe the detail of one character recognition class in reference manual. The outline is 7 steps as follows

    1. New instance of one paragraph recognition class
    2. Set an instance of one line recognition class with language processing
    3. Set spcifications of document image(address, width, height and resolution)
    4. Set paragraph bounding box. Any angle is acceptable.
    5. Call an one paragraph recognition method.
    6. Get results of recognition.
    7. Delete an instance

    If you repeat from 4 to 6, you can recognize paragraphs as many as you like. If you want to recognize paragraphs in another document, you repeat from 3 to 6.

    The recognition result is almost as same as one line recognition class. The difference is the existence of return code as a separater of lines.

    We strongly recommend to use this class to recognize documents. This class is an almighty class. If contains all methods other classes have.
Table of contents.


Manual home page

Reference manual