{"id":18963764,"url":"https://github.com/telattar/bachelor-project","last_synced_at":"2025-06-14T19:32:58.205Z","repository":{"id":241093318,"uuid":"804293472","full_name":"telattar/Bachelor-Project","owner":"telattar","description":"My bachelor thesis project: Egyptian License Plate Recognition in vehicles and motorcycles. YOLOv8n-based.","archived":false,"fork":false,"pushed_at":"2024-05-23T14:33:52.000Z","size":18139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T07:18:21.007Z","etag":null,"topics":["easyocr","object-detection","object-recognition","ocr","pillow","python","ultralytics","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telattar.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":"2024-05-22T10:20:32.000Z","updated_at":"2024-06-23T23:21:40.000Z","dependencies_parsed_at":"2025-05-25T22:15:58.968Z","dependency_job_id":null,"html_url":"https://github.com/telattar/Bachelor-Project","commit_stats":null,"previous_names":["telattar/bachelor-project"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/telattar/Bachelor-Project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telattar%2FBachelor-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telattar%2FBachelor-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telattar%2FBachelor-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telattar%2FBachelor-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telattar","download_url":"https://codeload.github.com/telattar/Bachelor-Project/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telattar%2FBachelor-Project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259870788,"owners_count":22924586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["easyocr","object-detection","object-recognition","ocr","pillow","python","ultralytics","yolov8"],"created_at":"2024-11-08T14:21:35.270Z","updated_at":"2025-06-14T19:32:58.145Z","avatar_url":"https://github.com/telattar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Egyptian License Plate Recognition in vehicles and motorcycles 🚗🛵\nMy bachelor project, YOLOv8n-based.\n\nIn this project, I developed a deep learning-based model that can detect and recognize the Egyptian license plates attached to cars and motorcycles. The model was trained on a dataset of different license plates with a variation of Arabic letters and Indian numerals.\n\n### Tech/Framework Used\n![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54)\n![PyCharm](https://img.shields.io/badge/pycharm-143?style=for-the-badge\u0026logo=pycharm\u0026logoColor=black\u0026color=black\u0026labelColor=green)\n![NumPy](https://img.shields.io/badge/numpy-%23013243.svg?style=for-the-badge\u0026logo=numpy\u0026logoColor=white)\n![OpenCV](https://img.shields.io/badge/opencv-%23white.svg?style=for-the-badge\u0026logo=opencv\u0026logoColor=white)\n\u003cimg src=\"https://github.com/telattar/Bachelor-Project/assets/110330655/009b86b4-1e5e-432a-87e6-b7e86cf76e90\" width=\"90\"\u003e\n\u003cimg src=\"https://github.com/telattar/Bachelor-Project/assets/110330655/79cd9ecf-07b2-4cbc-9762-95031c93a33b\" width=\"40\"\u003e\n\n## Project\nThis project proposed a real-time deep learning-based standard Egyptian license plate recognition system using YOLOv8 and EasyOCR.\n\nTo the best of my knowledge, this is the first proposed system that is capable of recognizing Egyptian motorcycle license plates. A 1200-image dataset of annotated motorcycle license plates has been collected. This dataset is publicly available at [this repository](https://github.com/telattar/Egyptian-motorcycle-license-plate-dataset).\n\nSeveral image post-processing procedures, such as contrast and skew adjustments, image sharpening, super resolution, and license plate cropping, were used to improve the system’s accuracy. The method saves the recognition result to a `.csv` file for further use. The detection step’s accuracy was determined to be 100%, while the recognition accuracy was 80%.\n\n### Methodology\n\n#### 1. Training the Model\nThe YOLO model was trained on both the [EALPR](https://github.com/ahmedramadan96/EALPR) dataset and a the previously mentioned motorcycle image dataset. Training iterations were conducted for 25, 50, 100, and 150 epochs, comparing the accuracy of each resulting model.\n\n#### 2. License Plate Detection\nTo ensure the system's speed and accuracy for real-time use, YOLOv8 was chosen for license plate detection. This model can accurately identify the location of a license plate in approximately 1 millisecond per frame.\n\n#### 3. License Plate Tracking\nEach new vehicle entering the scene is assigned an identification number for its license plate, which is tracked until it leaves. Tracking is achieved by comparing the center points of the plate in consecutive frames, identifying the same object if the distance difference is minimal.\n\n#### 4. Image Processing\n1. **Cropping the Detected Plate:** The standard Egyptian license plate, with a 2:1 aspect ratio, is cropped to exclude the top portion containing the country’s name and background color, focusing on the character and numeric sections.\n2. **Contrast Adjustment:** The image contrast is adjusted based on lighting conditions using standard deviation to ensure optimal OCR accuracy.\n3. **Super Resolution:** PyPi’s super resolution module is used to enhance the resolution of the cropped license plate image to improve OCR accuracy.\n4. **Image Sharpening:** Post super-resolution, the image is sharpened using PIL’s image sharpening function to enhance edge clarity for better OCR results.\n5. **Skew Adjustment:** Canny Edge Detection and Hough Line Transform are used to detect and correct the skew of the license plate image to ensure proper character recognition.\n\n#### 5. Character Recognition using [EasyOCR](https://github.com/JaidedAI/EasyOCR)\nEasyOCR was chosen for its accuracy and efficiency, as it did not require writing images to disk.\n\n#### 6. Character Anomaly Correction\nAnomalous characters, which are not used in Egyptian license plates, were identified and manually corrected. This step ensures the accuracy of the OCR results by replacing incorrect characters with the correct ones.\n\n\u003cimg src=\"https://github.com/telattar/Bachelor-Project/assets/110330655/f45c83f8-8633-4258-b300-5ffc2c59693c\" width=\"400\"\u003e\n\n\n#### 7. Saving the Recognition Results\nThe recognized car number and the recognition time are saved in a comma-delimited file. This data is useful for security systems to track the time and location of vehicle identification.\n\n## Installation\n1. Please make sure there is a working webcam on your device. If there is not, feel free to use your mobile phone camera as an integrated camera using a third-party application like [Camo](https://reincubate.com/camo/).\n2. Clone the project to your preferred directory. \n3. Open the unzipped folder in PyCharm IDE.\n4. Open a new terminal and install all the dependencies by running the command `pip install -r requirements.txt`\n5. Run the file `main.py`. You know that the project is properly running when your webcam turns on and a live video stream is displayed on the screen.\n6. Put the **EGYPTIAN** license plate in front of the camera (you can use your mobile phone to show a photo to the cam) and the system should start by drawing a green box around the plate.\n7. Wait for the OCR process to complete. Please be patient, it might need a few seconds to make sure that the recognized characters are correct.\n8. Once the characters are plotted on the live video, that is when the process is complete.\n9. Open the file recognition.csv and check for the plate characters and the saving time.\n\n## Citation\n\nPlease cite the link to this repo if this project helps your research. A publication citation will be uploaded soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelattar%2Fbachelor-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelattar%2Fbachelor-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelattar%2Fbachelor-project/lists"}