Tibo-s-Team / OCR_EPITA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image Preprocessing

Titalah opened this issue · comments

Images must be prepared for OCR use to limit impurities and clarify the text, meaning:

  • Image rotating
    It is asked to be able to rotate manually or automatically, possibly with the UI and/or with simple text bloc orientation detection?

  • Image grayscaling
    Transform the colored images into a more usable grayscaled image with the following formula given by Leo:
    L = 0.2126 × R + 0.7152 × G + 0.0722 × B

  • Image constrasting
    The grayscaled image must become a matrix of black and white. Using @FlorianDrevet method we should try to test a threshold value for the contrast, where everything under it will become black and everything higher will become white.

  • Noise suppression *optional
    An algorithm to delete noises on the image must be found in order for the OCR to render better text reading and formatting (meaning we should take in account that the noise can interfere with text bloc/paragraph detection)

The end result must be a matrix of RGB that should end in black and white, or comprised of exclusively 1s and 0s