I am writing a simple OCR solution for a finite set of characters. That is, I know the exact way all 26 letters in the alphabet will look like. I am using C# and am able to easi
You could create a tree.
Pick a pixel, and divide the letters into two buckets, based on the pixel being white or black. Then pick a second pixel, split the buckets into two buckets each based on that pixel and so on.
You could try to optimize the depth of the tree by choosing pixels which give buckets which are approximately equal in size.
Creating the tree is a one time preprocess step. You should not have to do it multiple times.
Now when you get an alphabet to match, follow the tree based on the pixels set/not set and get your letter.