title: Improve Text Binarization / OCR Preprocessing with OpenCV
body: <p>I am building a scanner feature for my app and binarize the photo of the document with OpenCV:</p>
  
  <pre><code>    // convert to greyscale
      cv::Mat converted, blurred, blackAndWhite;
      converted = cv::Mat(inputMatrix.rows, inputMatrix.cols, CV_8UC1);
      cv::cvtColor(inputMatrix, converted, CV_BGR2GRAY );
  
      // remove noise
      cv::GaussianBlur(converted, blurred, cvSize(3,3), 0);
  
      // adaptive threshold
      cv::adaptiveThreshold(blackAndWhite, blackAndWhite, 255, cv::ADAPTIVE_THRESH_GAUSSIAN_C, cv::THRESH_BINARY, 15 , 9);
  </code></pre>
  
  <p>The result is okay, but scans from different scanner apps are much better. Especially very small, tiny sized text is much better:
  Processed with opencv
  <a href="https://i.stack.imgur.com/x1xeN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x1xeN.png" alt="First: my result"></a> </p>
  
  <p>Scanned With DropBox
  <a href="https://i.stack.imgur.com/YvH8c.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YvH8c.png" alt="Second: Scanned with dropbox"></a></p>
  
  <p>What can I do, to improve my result?</p>