title: OpenCV process all text to be black on white (segmentation)
body: <p>Is it possible to somehow make it so that all text in a document is black on white after thresholding. I've been looking online alot but I haven't been able to come to a solution. My current thresholded image is: <a href="https://i.ibb.co/Rpqcp7v/thresh.jpg" rel="nofollow noreferrer">https://i.ibb.co/Rpqcp7v/thresh.jpg</a></p>
  <p>The document needs to be read by an OCR and for that I need to have the areas that are currently white on black, to be inverted. How would I go about doing this? my current code:</p>
  <pre><code># thresholding
  def thresholding(image):
      # thresholds the image into a binary image (black and white)
      return cv2.threshold(image, 120, 255, cv2.THRESH_BINARY)[1]
  </code></pre>