{"id":14128574,"url":"https://github.com/sammdu/pyimgscan","last_synced_at":"2026-05-07T19:33:34.483Z","repository":{"id":37598443,"uuid":"173869320","full_name":"sammdu/pyimgscan","owner":"sammdu","description":"Take any phone-taken picture and turn it into a document scan.","archived":false,"fork":false,"pushed_at":"2024-08-30T23:44:18.000Z","size":9986,"stargazers_count":91,"open_issues_count":1,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-03T23:44:57.579Z","etag":null,"topics":["image-processing","opencv","perspective-correction","perspective-transform","productivity","python","python3","scan","scanner"],"latest_commit_sha":null,"homepage":"https://gitlab.com/sammdu/pyimgscan","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sammdu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-05T03:52:04.000Z","updated_at":"2025-07-10T12:49:39.000Z","dependencies_parsed_at":"2022-08-25T22:11:04.425Z","dependency_job_id":null,"html_url":"https://github.com/sammdu/pyimgscan","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sammdu/pyimgscan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammdu%2Fpyimgscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammdu%2Fpyimgscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammdu%2Fpyimgscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammdu%2Fpyimgscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sammdu","download_url":"https://codeload.github.com/sammdu/pyimgscan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sammdu%2Fpyimgscan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32753062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["image-processing","opencv","perspective-correction","perspective-transform","productivity","python","python3","scan","scanner"],"created_at":"2024-08-15T16:01:51.299Z","updated_at":"2026-05-07T19:33:34.456Z","avatar_url":"https://github.com/sammdu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# pyimgscan: open-source document scanning tool ![MIT License](https://img.shields.io/badge/LICENSE-MIT-brightgreen.svg?style=for-the-badge)\n\n### Take a picture with your phone and convert it to a professional-looking scan.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"readme/diagram.png\" width=\"80%\" height=\"80%\"/\u003e\u003c/p\u003e\n\n### * Usage\n**`$ python3.9 ./pyimgscan.py`**\n```\nusage: pyimgscan.py [-h] -i IMAGE [-I [INVERTED]]\n```\nThe program will by default output a `corrected.png` and a `thresholded.png`\n* `-h` display the above help message\n* `-i` specify a path to the source image file\n* `-I` also output an inverted binary image (white on black) to `thresholded_inverted.png`\n\n\u003cbr\u003e\n\n### * Dependencies\n![Python3.9](https://img.shields.io/badge/python-3.9-blue.svg?style=for-the-badge)\n```\nnumpy==1.16.2\nopencv-contrib-python==4.2.0.32\n```\ncan also be found at `requirements.txt`\n\n\u003cbr\u003e\n\n### * Setup with `virtualenv`\n**1. Set up virtual environment:**   \n```\nvirtualenv -p python3.9 PyImgScan/\ncd ./PyImgScan/\n./bin/activate\n```\n\n**2. Clone repository:**   \n\n![GitLab](https://img.shields.io/badge/REPO-GitLab-blueviolet.svg?style=for-the-badge)   \n`git clone https://gitlab.com/sammdu/pyimgscan.git`    \n\n![GitHub](https://img.shields.io/badge/repo-github-lightgrey.svg?style=for-the-badge)   \n`git clone https://github.com/sammdu/pyimgscan.git`\n\n**3. Install dependencies:**   \n```\ncd pyimgscan/\npip install -r requirements.txt\n```\n\n**4. Test out an example!**   \n```\npython ./pyimgscan.py -i ./test/1.png\n```\nAvailable examples: `./test/1.png` `./test/2.jpg` `./test/3.jpg`\n\n\u003cbr\u003e\n\n### * TODO\n* unify average brightness for better adaptation to different lighting of input images\n* instead of convex hull, try to always complete a 4-corner-polygon\n* try Gaussian thresholding for better binary image results   \n  https://docs.opencv.org/3.4.0/d7/d4d/tutorial_py_thresholding.html   \n* add shadow removal functionality   \n  https://stackoverflow.com/questions/44047819/increase-image-brightness-without-overflow/44054699#44054699   \n  https://stackoverflow.com/questions/44752240/how-to-remove-shadow-from-scanned-images-using-opencv   \n* add a border / four anchor points for better positioning and more reliable contour recognition\n* build binaries with PyInstaller\n* support multi-color thresholding\n\n\u003cbr\u003e\n\n* * *\n### References:\n\n`imutils` https://github.com/jrosebr1/imutils\n\n`PyImageSearch` https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammdu%2Fpyimgscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsammdu%2Fpyimgscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsammdu%2Fpyimgscan/lists"}