{"id":30019155,"url":"https://github.com/andyg2/bboxy","last_synced_at":"2025-08-06T00:51:12.438Z","repository":{"id":299455123,"uuid":"1003099292","full_name":"andyg2/bboxy","owner":"andyg2","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-16T16:12:16.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-16T17:39:44.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/andyg2.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,"zenodo":null}},"created_at":"2025-06-16T16:10:30.000Z","updated_at":"2025-06-16T16:12:20.000Z","dependencies_parsed_at":"2025-06-16T17:40:52.913Z","dependency_job_id":"5f3132f2-8fe2-4604-91de-e82a08aace1c","html_url":"https://github.com/andyg2/bboxy","commit_stats":null,"previous_names":["andyg2/bboxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andyg2/bboxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fbboxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fbboxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fbboxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fbboxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyg2","download_url":"https://codeload.github.com/andyg2/bboxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyg2%2Fbboxy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268999827,"owners_count":24342490,"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","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-06T00:51:08.174Z","updated_at":"2025-08-06T00:51:12.363Z","avatar_url":"https://github.com/andyg2.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rounded Bounding Boxes with Arms in OpenCV\n\nThis Python script allows you to draw aesthetically pleasing **rounded bounding boxes** with **arm-like extensions** on any image using [OpenCV](https://opencv.org/). It's especially useful for highlighting objects in UI mockups, computer vision demos, or presentations.\n\n---\n\n## ✨ Features\n\n* Smooth **anti-aliased rounded corners**\n* **Customizable arms** extending from the edges\n* Fully **parameterized**:\n\n  * Thickness\n  * Border radius\n  * Arm length\n  * Color\n* Easy integration into your OpenCV workflows\n\n---\n\n## 🖼️ Example Outputs\n\n| Example                      | Description                                |\n| ---------------------------- | ------------------------------------------ |\n| ![example\\_1](example_1.png) | Red box with 20px radius and arms          |\n| ![example\\_2](example_2.png) | Thick purple frame with long arms          |\n| ![example\\_3](example_3.png) | Green box with large corners and no arms   |\n| ![example\\_4](example_4.png) | Blue box with square corners and long arms |\n\n---\n\n## 📦 Requirements\n\n* Python 3.6+\n* OpenCV (cv2)\n* NumPy\n\nInstall dependencies via pip:\n\n```bash\npip install opencv-python numpy\n```\n\n---\n\n## 🚀 Usage\n\n```python\nfrom draw_box import draw_rounded_bounding_box\nimport cv2\nimport numpy as np\n\n# Create blank image\nimg = np.ones((300, 400, 3), dtype=np.uint8) * 255\n\n# Draw a custom box\ndrawn = draw_rounded_bounding_box(\n    img,\n    top_left=(50, 50),\n    bottom_right=(350, 250),\n    color=(0, 0, 255),\n    thickness=3,\n    border_radius=20,\n    arm_length=20\n)\n\ncv2.imwrite(\"custom_box.png\", drawn)\n```\n\n---\n\n## 🧠 Function Signature\n\n```python\ndraw_rounded_bounding_box(\n    image: np.ndarray,\n    top_left: Tuple[int, int],\n    bottom_right: Tuple[int, int],\n    color: Tuple[int, int, int],\n    thickness: int = 2,\n    border_radius: int = 10,\n    arm_length: int = 10\n) -\u003e np.ndarray\n```\n\n| Parameter       | Description                                                       |\n| --------------- | ----------------------------------------------------------------- |\n| `image`         | OpenCV image (`np.ndarray`) to draw on                            |\n| `top_left`      | Coordinates of top-left corner (x, y)                             |\n| `bottom_right`  | Coordinates of bottom-right corner (x, y)                         |\n| `color`         | RGB color tuple (B, G, R format for OpenCV)                       |\n| `thickness`     | Line thickness in pixels                                          |\n| `border_radius` | Radius of the rounded corners                                     |\n| `arm_length`    | Length of horizontal and vertical arms extending from each corner |\n\n---\n\n## 📂 Files\n\n* `draw_box.py` — Main script with function and examples\n* `example_1.png` to `example_4.png` — Sample output images\n\n---\n\n## 🛠️ Notes\n\n* Anti-aliasing is enabled via `cv2.LINE_AA` for smoother curves and lines.\n* Corner and arm dimensions are clamped to avoid overflow beyond the box.\n\n---\n\n## 📄 License\n\nMIT License\n\n---\n\n## 🙌 Contributing\n\nFeel free to fork and submit PRs for enhancements or bugfixes. Ideas for improvement include:\n\n* Support for dashed lines\n* Optional labels inside or outside the box\n* Batch annotation from bounding box arrays\n\n---\n\n## 👤 Author\n\n**Andy Gee**\n🏝️ Based in Malapascua, Philippines\n🔧 [@andyg](https://github.com/andyg2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyg2%2Fbboxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyg2%2Fbboxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyg2%2Fbboxy/lists"}