title: How to remove background from binary image in opencv?
body: <p>I have images like the following:</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/tD305.jpg" alt="enter image description here"></p>
  </blockquote>
  
  <p>I want to extract the background (in other words I want make a new image without the characters) so that i substract from the original image the background image resulting a new image with only the characters. 
  I know how crop the letters but it's not what i need. </p>
  
  <p>This is the background:</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/wAzAD.jpg" alt="http://i.imgur.com/QJB3yxp.jpg"></p>
  </blockquote>
  
  <p>This is the desired output:</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/qSVtw.jpg" alt="enter image description here"></p>
  </blockquote>