Since this question is marked as MATLAB, I translated the @belisarius solution as such (which, in my opinion, is superior to the currently accepted answer):
%# read image I = imread('http://i.stack.imgur.com/nGNGf.png'); %# complement it, and convert to HSV colorspace hsv = rgb2hsv(imcomplement(I)); I1 = hsv(:,:,3); %# work with V channel %# Binarize/threshold image I2 = im2bw(I1, 0.92); %# Perform morphological thinning to get the skeleton I3 = bwmorph(I2, 'thin',Inf); %# prune the skeleton (remove small branches at the endpoints) I4 = bwmorph(I3, 'spur', 7); %# Remove small components I5 = bwareaopen(I4, 30); %# dilate image I6 = imdilate(I5, strel('square',2*3+1)); %# show step-by-step results figure('Position',[200 150 700 700]) subplot(711), imshow(I) subplot(712), imshow(I1) subplot(713), imshow(I2) subplot(714), imshow(I3) subplot(715), imshow(I4) subplot(716), imshow(I5) subplot(717), imshow(I6)

Finally, you can apply some form of OCR for number recognition. Unfortunately, MATLAB does not have a built-in function equivalent to TextRecognize[] in Mathematica ... At the same time, look at File Exchange , I "Of course you will find dozens of applications filling the gap :)
Amro
source share