Ed said:
Originally posted by ZeeGerman
In order to give you reasonable advice, we need to know the exact setup of your problem. Is it somewhat like this?
1. you have a set of k different characters like the above.
Yes. These marks might occur on examples in museum collections or private collections
2. each character is given in the form of a bitmap x pixels width and y pixels height, with x and y being the same for all bitmaps. Each pixel can be one of c different colors.
Actually 0/1 would be sufficient for color. They are stamped in metal, usually steel.
3. For any given x by y bitmap with c-colored pixels, you want to know to which of your k characters it is the most similar?
Yes
4. For each character, do you have exactly one prototype or do you have a number of slightly different examples (written by different persons), but the characters are already correctly classified?
Aye, there's the rub, matey. Since the "quality" of the exemplar figures can vary one might wish to make a composite of some sort or, alternatively, call those variations a "class" and determine the hits/class. I was attempting to simplify by suggesting one example in the library.
The size of the numbers k, x, y, c and the sizeof your sample set matter a big deal regarding what classification algorithm might suit you.
Ultimately the library examples might number in the few thousands. The sample (ie. that which is to be identified) will be one at a time. It will never be a batch operation.
Incidentially, this has been a bee in my bonnet for some time. I believe that various museums would be interested in helping to assemble the database
Zee
[/B][/QUOTE]
that's still not clear enough.
How many diefferent characters (i.e. classes) are there? e.g. our alphabeth has 26, the set of digits has ten etc.
Generally, buildinan classifier you do the following:
(lets stick to the alphabeth example, i.e. we have 26 different classes: A,B,C, ..., Z)
First you need a training sample (we call it T) with say relatively uniformly distributed 260 bitmaps, i.e. 10 A, 10 B, 9 C, 11 D, 8 E etc. and these bitmaps are already correctly labelled, i.e. classified.
We assume, that the bitmaps are all of the same size (x by y) and pixels are either black or white and are not randomly rotated.
Second, we need to extract relevant features from the bitmaps in T. The simplest thing would be to regard each bitmap as a bitstring of x*y bits with values 0 or 1. So the feature vector of each training bitmap in T would have x*y two-valued features. Assuming that the bitmaps are e.g. 64*64 pixels, that would give 4096 features. Way to much for the common training algorithms to succeed. What we need to do is to compress the information in the bitmaps in a way that leaves you with 5 to 10 features.
Now you choose a training algorithm e.g. C4.5 or a neural network of some kind and present it the training patterns again and again to give it time to adapt.
For your unknown bitmap you want to classify automatically, you apply the same feature extraction and present the feature vector to the trained classifier and it will give you the class with the highets probaility (according to the information embedded in the training sample).
The trick is really, to identify and extract the right features. once you got those, a decision tree algo like C4.5 will happily calculate a classifier within a couple of seconds or minutes and the classification of a unknown pattern will take no time at all.
Now, I never did OCR but you could try some simple spectral analysis of your bitmaps like a histogram along x yn y. Divide each bitmap in say 4 16 pixel wide columns and 4 16 bit wide rows and count the number of black pixels in each column and row respectively. That would yield a feature vector with 8 features, each of which would take values from 0 to 1024.
Might already work. Or not
Sadly, pattern recognition is not a straight forward technique and I spent some happy hours watching a couple of workstations crunching on my problems with different approaches and algorithms.
Zee