Build your own document scanner with OpenCV Python
Clone or download
Latest commit e292754 Jan 7, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Jan 6, 2019 Update Jan 7, 2019 Added Comments Jan 7, 2019 Add files via upload Jan 6, 2019
test_img.jpg Add files via upload Jan 6, 2019


Build your own document scanner with OpenCV Python


What is this ?

The script takes an image as input and then scans the document from the image by applying few image processing techniques and gives the output image with scanned effect

How does it do this?

Initially we need to resize the images so OpenCV can handle it and then the following functions are applied

  1. Guassian Blur to smoothen image.
  2. Canny Edges to detect the edges.
  3. Find contours and boundary of the page
  4. Map the end points of contours to 800 * 800 window
  5. Apply perspective trasform to get scanned or bird eye view of the image.

This is shit, why did you build this?

I was BORED :/


pip install opencv-python


  1. Guassian Blur :
  2. SO article on guassian Blur
  3. Vipul Sharma Github :
  4. Canny Edge Deetction 5)Contours Documentation :
  5. ArcLength Documentation:
  6. Perspective Transform Pyimage Search Tutorial