{"id":34689050,"url":"https://github.com/mostafabaghi/python-car-plate-reader","last_synced_at":"2026-05-06T00:02:28.911Z","repository":{"id":297701794,"uuid":"997650450","full_name":"mostafabaghi/python-car-plate-reader","owner":"mostafabaghi","description":"🔍 Python Car Plate Reader — A terminal-based license plate recognition tool that detects and extracts vehicle plate numbers from images using computer vision.","archived":false,"fork":false,"pushed_at":"2025-06-06T23:15:24.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-06T23:29:41.126Z","etag":null,"topics":["ai","alpr","automation","computer-vision","cv2","image-processing","license-plate-recognition","machine-learning","number-plate-reader","object-detection","ocr","opencv","python","python-project","terminal-app","vehicle-detection"],"latest_commit_sha":null,"homepage":"https://mostafabaghi.com/","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/mostafabaghi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-06T22:37:37.000Z","updated_at":"2025-06-06T23:14:12.000Z","dependencies_parsed_at":"2025-06-06T23:29:47.103Z","dependency_job_id":"9bc510d3-231b-4c24-a4fc-68d28619677e","html_url":"https://github.com/mostafabaghi/python-car-plate-reader","commit_stats":null,"previous_names":["mostafabaghi/python-car-plate-reader"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mostafabaghi/python-car-plate-reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafabaghi%2Fpython-car-plate-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafabaghi%2Fpython-car-plate-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafabaghi%2Fpython-car-plate-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafabaghi%2Fpython-car-plate-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mostafabaghi","download_url":"https://codeload.github.com/mostafabaghi/python-car-plate-reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mostafabaghi%2Fpython-car-plate-reader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32672682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["ai","alpr","automation","computer-vision","cv2","image-processing","license-plate-recognition","machine-learning","number-plate-reader","object-detection","ocr","opencv","python","python-project","terminal-app","vehicle-detection"],"created_at":"2025-12-24T21:56:50.051Z","updated_at":"2026-05-06T00:02:28.906Z","avatar_url":"https://github.com/mostafabaghi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚗 License Plate Text Extractor\n\nThis Python project uses OpenCV and Tesseract OCR to detect and extract license plate text from car images — optimized for **French license plates**.\n\n## 📸 Example Use Case\n\nYou place images of vehicles inside a `cars/` folder, and the script will process each image to locate the license plate and extract its text.\n\n## 🔧 Features\n\n- Automatic detection of license plates using image processing\n- Optical Character Recognition (OCR) with `pytesseract`\n- Optimized for French plate formats (e.g. `AB-123-CD`)\n- Preprocessing pipeline for better OCR accuracy\n- CLI output of image paths and detected plate text\n\n---\n\n## 🧰 Requirements\n\n- Python 3.6+\n- OpenCV\n- pytesseract\n- Tesseract OCR engine installed on your system\n\n### Install dependencies\n\n```bash\npip install opencv-python pytesseract numpy\n```\n\n### Install Tesseract (OCR Engine)\n\n#### Ubuntu/Debian:\n```bash\nsudo apt update\nsudo apt install tesseract-ocr\n```\n\n#### macOS (using Homebrew):\n```bash\nbrew install tesseract\n```\n\n#### Windows:\n- Download the installer from: https://github.com/tesseract-ocr/tesseract\n- Make sure to add the Tesseract installation path to your system’s PATH.\n- Example: `C:\\Program Files\\Tesseract-OCR\\tesseract.exe`\n\nIf needed, you can specify the Tesseract executable path in the script:\n```python\npytesseract.pytesseract.tesseract_cmd = r'C:\\Program Files\\Tesseract-OCR\\tesseract.exe'\n```\n\n---\n\n## 📁 Folder Structure\n\n```\nproject/\n│\n├── cars/                 # Input images of vehicles\n├── main.py               # Main script for processing\n├── README.md             # This file\n```\n\n---\n\n## ▶️ How to Run\n\n```bash\npython main.py\n```\n\nThe script will print the detected license plate text for each image in the `cars/` directory.\n\n---\n\n## 🔍 How It Works\n\n1. Converts the image to grayscale and enhances contrast.\n2. Uses edge detection and contour finding to locate license plate candidates.\n3. Filters candidates based on aspect ratio (French plates ~4:1).\n4. Extracts the plate region and applies thresholding.\n5. Uses `pytesseract` to perform OCR on the region.\n6. Prints the extracted text if it resembles a valid French plate.\n\n---\n\n## ✨ Sample Output\n\n```\n🔍 Reading French car plates from images in 'cars/' folder...\n\n📷 cars/car1.jpg ➤ 🏷️ Plate: AB-123-CD\n📷 cars/car2.jpg ➤ 🏷️ Plate: ZY-987-WX\n```\n\n---\n\n## 📌 License Plate Format Supported\n\nThis script is optimized for **French license plates**, typically formatted like:\n\n- `AB-123-CD`\n- `1234 AB 75`\n\nFor other country formats, some logic may need to be adjusted.\n\n---\n\n## 🛠️ Future Improvements\n\n- Support for other countries (e.g. Iran, Germany)\n- GUI for drag-and-drop detection\n- Model-based plate detection with YOLO or other deep learning methods\n- Integration with Flask for web interface\n\n---\n\n## 📄 License\n\nThis project is open-source and free to use under the [MIT License](LICENSE).\n\n---\n\n## 🤝 Contributions\n\nFeel free to fork, improve, or submit a pull request! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostafabaghi%2Fpython-car-plate-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmostafabaghi%2Fpython-car-plate-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmostafabaghi%2Fpython-car-plate-reader/lists"}