Final assignment: Word recognizer
Make a recognizer recognize.py that performs word recognition.
Input/output
When wordimage.ppm is a rectangular image cut out from a KdK page and contains the handwritten word "appeltaart", then:
python recognize.py wordimage.ppm
results in printed text like:
appeltaart 0.10
appelflap 0.25
appelsap 0.30
citroentaart 0.40
...
where each line contains a possible transcription and a score. The lower the score, the more likely the program considers this option to be the right one. The list should be sorted such that the top position is the most likely result (lowest score). The minimum number of lines in this list is 1, the maximum is 5. The scores are neglected during testing.
Framework
You could use or modify some files from /student/hwr/framework:
- pamImage.*: library with functions to read/write images using C++/Python (.pgm and .ppm format) (try not to modify these files)
- crop*: image cropping in Python/C++ using pamImage
- feat*: feature extraction in Python/C++ using pamImage
Testing options
For testing, the images will be cut like option 1, or if you like, option 2:
Option 1
Like the green rectangle:

Option 2
Like the red rectangle:

In this case, your program will be called with the shear angle of the word:
python recognize.py wordimage.ppm 45
This number will probably be equal to 45 in most cases, but not necessarily always. Indicate in a Readme file which option you would like your program to be tested with. By default, option 1 will be used. The blue parallelograms are defined as described in Assignment 1.
Requirements
- The main program must be written in Python
- The low-level routines that deal with pixels must be written in C++ (or C)
- The program must work stand-alone
- If you choose for option 2, include a Readme file that tells this.
- If you youse external libraries, include them in the package and have them compiled automatically. A 'make' commando should suffice to compile your program.
Criterion for scoring
- For assignment 3, the edit distance of the first word will be the main influence on your grade. If the exact correct answer is in the list, then this may influence your mark positively, but this is still to be determined because the test still has to be made. For the final assignment, the way of scoring may be tweaked a little bit, dependent on the experiences with assignment 3, but of course you will be informed in time.
Highscore
Last modified: May 24, 2007 by Axel Brink.