title: How do I equalize contrast & brightness of images using opencv?
body: <p>I've got an image that I've scanned, but the white paper is not white on the screen. Is there a way to equalize the contract/brightness to make the background whiter?</p>
  
  <p><a href="https://i.stack.imgur.com/9jU1U.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/9jU1Um.jpg" alt=""></a></p>
  
  <p><strong>Update</strong></p>
  
  <p>I've tried the suggested Image._EqualizeHist function from EmguCv:</p>
  
  <pre><code>string file = @"IMG_20120512_055533.jpg";
  Image&lt;Bgr, byte&gt; originalColour = new Image&lt;Bgr, byte&gt;(file);
  
  Image&lt;Bgr, byte&gt; improved = originalColour.Clone();
  improved._EqualizeHist();
  </code></pre>
  
  <p>But get an even worse result (also when first gray scaled):</p>
  
  <p><a href="https://i.stack.imgur.com/vetKe.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/vetKem.jpg" alt=""></a></p>
  
  <p>Am I missing other parameters?</p>