Skip to main content
5 of 6
added 470 characters in body
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
(* Get your image *)
digits = ImagePartition[Import["https://i.sstatic.net/cLncR.png"], 50];

(* Remove Borders and Binarize *)
d1 = Binarize[ImageCrop[#, 37], .5] & /@ Flatten@digits;

(* Keep only images with content (blanks affect the OCR) *)
d2 = Select[d1, Min@ImageData@# == 0 &];

(* Assemble as a line and "read" *)
TextRecognize@ImageAssemble@d2
(*
-> "64776958729385431752328231"
*)

Edit

The following will reassemble you original image (but cleaner)

tr    = TextRecognize@ImageAssemble@d2;
posd2 = Flatten@Position[d1, x_ /; Min@ImageData@x == 0, {1}];
tp2   = Thread@List[posd2, Characters@tr];
(d1[[#[[1]]]] = Graphics[Text[Style[#[[2]], Large]], ImageSize -> 37]) & /@ tp2;
GraphicsRow[{
   ImageAssemble@Partition[ImageCrop[#, 39] & /@ d1, 9], 
   ImageAssemble@digits}]

enter image description here

Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456