hi
take a look at the following article
OCR Line Detection
it is a solution for detecting lines in a document. apply this algorithm to your image and after detecting lines rotate the image by 90 degree and apply the algorithm for the second time. then it gives you the image for each character.