title: OpenCV - Separating letter contours in text segmentation
body: <p>I’ve been working with text recognition in a dataset of images. I want to segment the characters of the image using components and finding contours of a thresholded image. However, many of the characters are merged with each other and with other components in the image. </p>
  
  <p>Can you give me some idea for separating them? Thanks for the help! </p>
  
  <p>Below are some examples, and part of my code:</p>
  
  <pre><code>Mat placa_contornos = processContourns(img_placa_adaptativeTreshold_mean);
  vector&lt;vector&lt;Point&gt;&gt; contours_placa;
  findContours(placa_contornos,
               contours_placa, 
               CV_RETR_EXTERNAL, externos)
               CV_CHAIN_APPROX_NONE); 
  vector&lt;vector&lt;Point&gt; &gt;::iterator itc = contours_placa.begin();
  while (itc != contours_placa.end()) {
      //Create bounding rect of object
      Rect mr = boundingRect(Mat(*itc));
      rectangle(imagem_placa_cor, mr, Scalar(0, 255, 0));
      ++itc;
  }
  imshow("placa con rectangles", imagem_placa_cor);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NAFLh.png" rel="nofollow noreferrer">Results examples</a></p>
  
  <p><a href="https://i.stack.imgur.com/i96Bu.png" rel="nofollow noreferrer">original image, binarized image, result</a></p>