Pyimgscan
Take any phone-taken picture and turn it into a document scan.
Install / Use
/learn @sammdu/PyimgscanREADME
pyimgscan: open-source document scanning tool 
Take a picture with your phone and convert it to a professional-looking scan.
<p align="center"><img src="readme/diagram.png" width="80%" height="80%"/></p>* Usage
$ python3.9 ./pyimgscan.py
usage: pyimgscan.py [-h] -i IMAGE [-I [INVERTED]]
The program will by default output a corrected.png and a thresholded.png
-hdisplay the above help message-ispecify a path to the source image file-Ialso output an inverted binary image (white on black) tothresholded_inverted.png
* Dependencies
numpy==1.16.2
opencv-contrib-python==4.2.0.32
can also be found at requirements.txt
* Setup with virtualenv
1. Set up virtual environment:
virtualenv -p python3.9 PyImgScan/
cd ./PyImgScan/
./bin/activate
2. Clone repository:
git clone https://gitlab.com/sammdu/pyimgscan.git
git clone https://github.com/sammdu/pyimgscan.git
3. Install dependencies:
cd pyimgscan/
pip install -r requirements.txt
4. Test out an example!
python ./pyimgscan.py -i ./test/1.png
Available examples: ./test/1.png ./test/2.jpg ./test/3.jpg
* TODO
- unify average brightness for better adaptation to different lighting of input images
- instead of convex hull, try to always complete a 4-corner-polygon
- try Gaussian thresholding for better binary image results
https://docs.opencv.org/3.4.0/d7/d4d/tutorial_py_thresholding.html - add shadow removal functionality
https://stackoverflow.com/questions/44047819/increase-image-brightness-without-overflow/44054699#44054699
https://stackoverflow.com/questions/44752240/how-to-remove-shadow-from-scanned-images-using-opencv - add a border / four anchor points for better positioning and more reliable contour recognition
- build binaries with PyInstaller
- support multi-color thresholding
References:
imutils https://github.com/jrosebr1/imutils
PyImageSearch https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/
Related Skills
claude-opus-4-5-migration
107.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
346.4kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
50.7k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.8kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
