title: How to split an image into clean paragraphs in Python/OpenCV?
body: <p><strong>TL;DR:</strong> How to select a paragraph on an image in such a way that it doesn't contain adjacent (top and bot) paragraphs?</p>
  
  <p>I have a set of scanned images which are single columns of text, such as <a href="https://imgur.com/0X5VZJH" rel="nofollow noreferrer">this one</a>. These images are all black and white, already rotated, their noise is reduced and have white spaces trimmed.</p>
  
  <p>What I want to do is divide each of such images into paragraphs. My initial idea was to measure average brightness of each row to find spaces between lines of text and try to select a rectangle starting from that line to match the indentation and measure the brightness of that rectangle. But that seems a tad cumbersome.</p>
  
  <p>Moreover, the lines are sometimes slightly skewed (up to ≈ 10 px vertical difference on extreme ends), so sometimes there is line overlap. So I thought of selecting all letters of a paragraph and using them to plot a block of text and I got <a href="https://imgur.com/BPAw8Rw" rel="nofollow noreferrer">this</a> using <a href="https://stackoverflow.com/a/35078614/3918419">this method</a>, but I am not sure how to proceed further. Select each letter rectangle starting <code>n</code> pixels from the left, and try to include every rectangle starting no less than <code>first_rectangle_x - offset</code>? But what then?</p>