Using the Straighten Columns Function

Document Camera images can commonly have two different types of image distortion; a rotational distortion caused by the document and camera not being perpendicularly aligned and a cylindrical "page curl" distortion with books and magazines caused by the binding not allowing pages to lie flat. TopOCR tries to rectify these image distortions by the following process:

  1. Perform a document layout analysis of the image and detect the location of columns of text, graphics and clipped columns of text near the edges of the document.


  2. Determine if this particular image has just one single column of text or has multiple columns.


  3. In the case of one single column, it will straighten the entire image, if the image has multiple columns, since each column can have different distortion characteristics, it will try to straighten each individual column separately. This is typical for an image of an open book with two pages, each of which can have its own unique distortion.


  4. TopOCR will straighten the columns of text and also remove graphics and clipped columns of text. The process is very fast, generally taking under .25 sec once an image has been binarized. This process can greatly improve OCR accuracy, in some cases by as much as 40%-50%!


Note: Straighten Columns will not work very well on more extreme cases of cylindrical book curvature. As a consequence of this, it's recommended that you use your hands to flatten the pages to reduce the degree of curvature. The current version of this function does not work well on images that have greater than 12 degress of skew.

The Straighten Columns function will not alter single lines of text or short columns of less than 4 lines of text.

An example of the power of the Straighten Columns function is given below in a sample input and output image, note the column of text detected and straightened as well as the removal of the clipped text!


Input Image


Output Image