title: Hand written word recognition using Matlab
body: <p>I am working on a <strong>hand written word recognition</strong> project.</p>
  
  <p>With this project, I have collected sample hand written scripts from several different writers. Hence I have obtained different writing styles.</p>
  
  <ul>
  <li><p>For <strong><em>segmentation</em></strong> and <strong><em>labeling</em></strong> the following <em>code</em> is
  used.</p>
  
  <pre><code>I = imread('1.jpg');
  bin_im = imcomplement(out);
  bin_im = bwareaopen(bin_im,30);
  bw1 = bin_im;
  
  
  cc = bwconncomp(bw1)
  cc.NumObjects
  
  
  %Label the connected components
  [Label,Total]=bwlabel(bw1,8);
  
  
  %Rectangle containing the region
  Sdata=regionprops(Label,'BoundingBox');
  
  for i=1:Total  
  %Crop all the Images 
      Img = imcrop(bw1,Sdata(i).BoundingBox);
      Name = strcat('Object Number:',num2str(i));
      pathname1 = 'C:\Users\sahanpriyanga\Documents\MATLAB\stack\Words';
      baseFileName1 = sprintf('Img%d.jpg',i);
      fullFileName1 = fullfile(pathname1,baseFileName1);
      imwrite(Img,fullFileName1);
  end
  </code></pre></li>
  </ul>
  
  <p>This is the <strong>image</strong> that I have used.</p>
  
  <p><a href="https://i.stack.imgur.com/ZNkFS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZNkFS.jpg" alt="enter image description here"></a></p>
  
  <p>With this code there are some problems:</p>
  
  <ol>
  <li>The labels are not in sequence </li>
  </ol>
  
  <p>Image of the folder of <strong>segmented images</strong></p>
  
  <p><a href="https://i.stack.imgur.com/E6jSG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E6jSG.jpg" alt="enter image description here"></a></p>
  
  <ol start="2">
  <li>The lower case letters “ i ” &amp; “ j ”  generate two figures (“ i ”
  gives . and 1 separately )</li>
  <li><p>Some letters are segmented incorrectly.</p>
  
  <p><em>like img5 and img6 in the second figure.</em> </p></li>
  <li><p>The document only contains 61 characters, but after segmentation
      it gives 71 images.</p></li>
  </ol>
  
  <p>For accurate output I need to modify the project
  to resolve these weaknesses and would like suggestions.</p>