๐ A powerful FastAPI-based service for analyzing Wordfeud board screenshots using computer vision and OCR techniques. This project helps players analyze their Wordfeud game state through screenshot processing and provides a web interface for easy interaction.
- ๐ธ Screenshot analysis with OpenCV and Tesseract OCR
- ๐ฏ Board state recognition and visualization
- ๐ฒ Rack letter detection
- ๐ Modern web interface for uploads
- โก Async processing for long-running tasks
- ๐ Real-time status updates
- ๐ Python 3.10 or higher
- ๐ Tesseract OCR
brew install tesseract
For other platforms, see Tesseract documentation.
numpy==1.24.3
opencv-python==4.8.1.78
packaging==24.2
pillow==11.0.0
pytesseract>=0.3.10
matplotlib==3.8.2
fastapi==0.109.1
python-multipart==0.0.6
uvicorn==0.27.0
jinja2==3.1.3
- ๐ฅ Clone the repository:
git clone https://github.com/martinkallstrom/wordfeud-player.git
cd wordfeud-player
- ๐ Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- โก Install dependencies:
pip install -r requirements.txt
Run the FastAPI server:
uvicorn app:app --reload --host 0.0.0.0 --port 8000
- ๐ฅ๏ธ Web Interface: http://localhost:8000
- ๐ API Documentation: http://localhost:8000/docs
Upload and analyze a Wordfeud board screenshot:
curl -X POST "http://localhost:8000/analyze" -H "accept: application/json" -H "Content-Type: multipart/form-data" -F "file=@your_screenshot.png"
Check the status of an analysis task:
curl -X GET "http://localhost:8000/status/task_1" -H "accept: application/json"
- ๐
ocr/
: OCR-related code and template matching - ๐จ
visualization/
: Board and match visualization tools - ๐งช
test/
: Test suite - ๐
letter_templates/
: Reference images for letter recognition - ๐๏ธ
static/
: Generated visualizations and static assets - ๐ฏ
templates/
: HTML templates for web interface - ๐ ๏ธ
utils/
: Shared utility functions
Two helper scripts are provided for git operations:
- ๐ค Push changes to your repository:
./push_git.sh "Your commit message"
- ๐ฅ Pull updates from upstream:
./pull_upstream.sh
-
๐ OCR Engine
- ๐ธ OpenCV for image processing
- ๐ Tesseract OCR for text recognition
- ๐ฏ Custom template matching for letter detection
-
๐ฎ Game Logic
- ๐ฒ Board state representation
- โ Move validation
- ๐ Game state analysis
-
๐จ Visualization
- ๐ผ๏ธ Board state rendering
- ๐ Match visualization
- ๐ฏ Template matching results
-
โก API Service
- ๐ Async processing
- ๐ Background tasks
- ๐ Status tracking
- ๐ก๏ธ Error handling
- ๐ฑ Fork the repository
- ๐ฟ Create your feature branch
- ๐พ Commit your changes
- ๐ค Push to your branch
- ๐ฏ Create a Pull Request
This project is based on the work by mrcz and maintains the same license terms.
- ๐ฎ Original project by mrcz
- ๐ OpenCV and Tesseract OCR communities
- โก FastAPI framework developers