{"id":24892775,"url":"https://github.com/lamaabdeldayem/color-detection","last_synced_at":"2026-04-29T18:34:38.478Z","repository":{"id":272914615,"uuid":"858699494","full_name":"lamaabdeldayem/Color-Detection","owner":"lamaabdeldayem","description":"A Python project for detecting a yellow object (e.g., a ball) in a video using OpenCV and PIL, applying color-based masking and drawing bounding boxes around the detected object.","archived":false,"fork":false,"pushed_at":"2025-01-17T13:15:22.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T13:49:28.467Z","etag":null,"topics":["color-detection","computer-vision","hsv-colorspace","object-tracking","opencv","pil","python","video-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamaabdeldayem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-09-17T11:34:22.000Z","updated_at":"2025-01-17T13:15:24.000Z","dependencies_parsed_at":"2025-01-17T12:30:18.070Z","dependency_job_id":"49e6774c-2bb3-46df-a802-901011885a11","html_url":"https://github.com/lamaabdeldayem/Color-Detection","commit_stats":null,"previous_names":["lamaabdeldayem/color-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lamaabdeldayem/Color-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FColor-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FColor-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FColor-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FColor-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamaabdeldayem","download_url":"https://codeload.github.com/lamaabdeldayem/Color-Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamaabdeldayem%2FColor-Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32439295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"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":["color-detection","computer-vision","hsv-colorspace","object-tracking","opencv","pil","python","video-processing"],"created_at":"2025-02-01T18:16:53.452Z","updated_at":"2026-04-29T18:34:38.462Z","avatar_url":"https://github.com/lamaabdeldayem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Video Processing Project with OpenCV and PIL 🎥⚽\n\nThis project demonstrates the detection of a yellow ball in a video using **OpenCV** and **PIL**. The code applies color-based masking and identifies the bounding box of the detected object, then draws the bounding box around the object in the video frames.\n\n## Requirements 📦\n\nTo run the project, you need to install the required dependencies using `pip`:\n\n- `opencv-python`\n- `Pillow`\n- `numpy`\n\n### Installation 🔧\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/lamaabdeldayem/Color-Detection.git\n   cd Color-Detection\n   ```\n\n2. Install the dependencies:\n   ```bash\n   pip install opencv-python Pillow numpy\n   ```\n\n## Usage 🚀\n\nMake sure the video file `Bouncing Red Ball (1).mp4` is in the same directory as the script, or update the path in the script accordingly.\n\nRun the script:\n\n```bash\npython script_name.py\n```\n\n### Description of the Code 📝\n\n- The script loads a video (`Bouncing Red Ball (1).mp4`) using OpenCV.\n- It converts each frame from the video to the **HSV color space**.\n- It defines a color range for yellow in the HSV space and creates a **mask** for pixels within this range.\n- The script finds the bounding box of the yellow object in the mask and draws a rectangle around it on the original frame.\n- The video is displayed with the bounding box, and you can press `q` to quit the video.\n\n### Example 🎬\n\nThe video will show the bounding box drawn around the yellow object as it moves through the frames.\n\n### Customizing the Color 🌈\n\nIf you want to track a different color, you can modify the `yellow` variable with a new color in the BGR color space. The `get_limits` function will automatically adjust the HSV range for the new color.\n\n```python\nyellow = [0, 0, 255]  # Change to a new BGR color if needed\n```\n\n### Example of `get_limits`:\n\nIf you have your custom function `get_limits` to return the lower and upper limits for HSV color detection, ensure it’s implemented in the `util.py` file as shown in the code.\n\n```python\n# Example get_limits function\ndef get_limits(color):\n    # Your implementation of HSV limits based on the input color\n    pass\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamaabdeldayem%2Fcolor-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamaabdeldayem%2Fcolor-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamaabdeldayem%2Fcolor-detection/lists"}