Detect if a text image is upside down

后端 未结 4 1654
孤城傲影
孤城傲影 2021-01-31 03:06

I have some hundreds of images (scanned documents), most of them are skewed. I wanted to de-skew them using Python.
Here is the code I used:

import numpy a         


        
4条回答
  •  耶瑟儿~
    2021-01-31 03:09

    You can use the Alyn module. To install it:

    pip install alyn
    

    Then to use it to deskew images(Taken from the homepage):

    from alyn import Deskew
    d = Deskew(
        input_file='path_to_file',
        display_image='preview the image on screen',
        output_file='path_for_deskewed image',
        r_angle='offest_angle_in_degrees_to_control_orientation')`
    d.run()
    

    Note that Alyn is only for deskewing text.

提交回复
热议问题