If I understand your question correctly, you isolate and crop a character from some bitmap-like image and you then want to identify what character it is? Like an automatic character recognition?
Perhaps you could use an edge detector instead of comparing histograms?
I would try an algorithm something like:
- find, isolate and crop the character to be identified
- Scale it to a predetermined horizontal and vertical size to normalize it.
- Sweep a directional edge detector over the character, something simple like a Sobel
edge detector.
- First apply a Horizontal edge detector, then horizontally "flatten" the edge-map to obtain a vector representing the edge information at each pixel row. (i.e. count the 1, and 0 in the edge-map for each pixel row)
- Second apply a Vertical edge detector, and vertically flatten the edge-map giving another vector that represents the edge information at each pixel column. (i.e. cumulate and count the edge information for each pixel column)
- Concatenate these two vectors [horizontal-edge information, vertical-edge information]
- Then compare the final concatenated vector to a library of precomputed vectors of your known test samples (0-9, +/*-)
Numbers that look somewhat similar (8,6,9,3) should still have distinct peaks and valleys either in the horizontal component or the vertical component.