easmaa.salih 0 Newbie Poster

i am making program to read text by convert image of text into text but i have problem in the out because the text not in line but in column and i can't detect space between words . the code in matlab:

load 'Charachters.mat';
str ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','1','2','3','4','5','6','7','8','9','0',' '};
f = imread('1.PNG');
imshow( f )
bwf=bwareaopen(imbw,55);
imshow(bwf)
[tags num]=bwlabel(bwf);
improps=regionprops(tags);
for i=1:num

z = imcrop(bwf,[improps(i).BoundingBox(1),improps(i).BoundingBox(2),improps(i).BoundingBox(3),improps(i).BoundingBox(4)]);
 w=imresize(z,[90 45]); 

  for j=1:36
  c(j)= corr2(w,Charachters{j});
  end
  cc = find (c == max(c));

      r=[str{cc}];
  disp(r) 
end 

can you help me?