Python Script written with OpenCV to implement document scanner.
In this scenario we make use of Perspective transform to get the top-down view of the image in a plane.
Four-Point Transform is applied to approximate Region of Interest and filter selected area from the image provided. Here we assume that the document will be one with a rectangular contour, and thus apply transformations accordingly.
More on Region on Interest at Wiki Link
What is Four Point Transform and its Application?
python script.py
img,ratio,edged,orig=read_img("image.jpg")
Change file to your file_path
- Python 3.5+
- Numpy
- OpenCV 2.4+
- imutils
Input | Output |
---|---|
![]() |
![]() |