andrewdcampbell/OpenCV-Document-Scanner
소개
Python과 OpenCV로 만든 대화형 문서 스캐너로, 모서리 자동 검출, 이미지 선명화, 색상 임계값 처리를 지원합니다.
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalDocument Scanner
An interactive document scanner built in Python using OpenCV
The scanner takes a poorly scanned image, finds the corners of the document, applies the perspective transformation to get a top-down view of the document, sharpens the image, and applies an adaptive color threshold to clean up the image.
On my test dataset of 280 images, the program correctly detected the corners of the document 92.8% of the time.
This project makes use of the transform and imutils modules from pyimagesearch (which can be accessed here). The UI code for the interactive mode is adapted from poly_editor.py from here.
You can manually click and drag the corners of the document to be perspective transformed:

The scanner can also process an entire directory of images automatically and save the output in an output directory:

Here are some examples of images before and after scan:


Usage
python scan.py (--images <IMG_DIR> | --image <IMG_PATH>) [-i]
- The
-iflag enables interactive mode, where you will be prompted to click and drag the corners of the document. For example, to scan a single image with interactive mode enabled:
python scan.py --image sample_images/desk.JPG -i
- Alternatively, to scan all images in a directory without any input:
python scan.py --images sample_images
관련 프로젝트 살펴보기
불러오는 중…