This Python project demonstrates the implementation of a document scanner using OpenCV, an open-source computer vision library. The program takes an input image containing a document, detects its contours, applies perspective transformation to obtain a top-down view, and finally applies local thresholding to enhance the document's readability.
numpy: Numerical computing library for array manipulation.argparse: Command-line argument parsing.cv2(OpenCV): Computer vision library for image processing.imutils: Convenience functions to make basic image processing operations simpler.
- Run the script
Cscanner.py. - Pass the input image path using the
-ior--imageargument.
python Cscanner.py --image <path_to_input_image>