A lightweight Telegram bot that applies adaptive thresholding to images using OpenCV—perfect for turning photos into clean, high-contrast binary images.
- Accepts photos via Telegram
- Converts to grayscale, enhances contrast, and applies adaptive thresholding
- Returns the processed image instantly
- Auto-cleans temporary files
- Python 3.7+
- Libraries:
python-telegram-bot,opencv-python
Install with:
pip install python-telegram-bot opencv-python- Create a bot with BotFather and get your token.
- Replace
"Your telegram bot token"in the script with your actual token. - Run the bot:
python TelegramCV2_threshholding.py- Send an image to your bot on Telegram!
MIT License — free to use, modify, and share.