{"id":14977671,"url":"https://github.com/saharshleo/easyroi","last_synced_at":"2025-06-26T08:35:49.702Z","repository":{"id":47730022,"uuid":"338385875","full_name":"saharshleo/easyROI","owner":"saharshleo","description":"Custom ROI in Computer Vision Applications","archived":false,"fork":false,"pushed_at":"2022-09-19T12:52:31.000Z","size":45748,"stargazers_count":52,"open_issues_count":2,"forks_count":9,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-25T15:05:48.194Z","etag":null,"topics":["computer-vision","custom-region-of-interest","line-roi","multiple-region-of-interest","multiple-roi","opencv","polygon","region-of-interest"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/EasyROI/","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/saharshleo.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}},"created_at":"2021-02-12T17:25:21.000Z","updated_at":"2024-11-26T22:02:26.000Z","dependencies_parsed_at":"2022-08-29T22:23:01.042Z","dependency_job_id":null,"html_url":"https://github.com/saharshleo/easyROI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saharshleo/easyROI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharshleo%2FeasyROI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharshleo%2FeasyROI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharshleo%2FeasyROI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharshleo%2FeasyROI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saharshleo","download_url":"https://codeload.github.com/saharshleo/easyROI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saharshleo%2FeasyROI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262030761,"owners_count":23247713,"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":["computer-vision","custom-region-of-interest","line-roi","multiple-region-of-interest","multiple-roi","opencv","polygon","region-of-interest"],"created_at":"2024-09-24T13:56:07.020Z","updated_at":"2025-06-26T08:35:49.662Z","avatar_url":"https://github.com/saharshleo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![stargazers](https://img.shields.io/github/stars/saharshleo/easyROI)\n![issues](https://img.shields.io/github/issues/saharshleo/easyROI)\n![forks](https://img.shields.io/github/forks/saharshleo/easyROI)\n![license](https://img.shields.io/github/license/saharshleo/easyROI)\n\n# [EasyROI](https://github.com/saharshleo/easyROI)\n\n\u003c!-- [![Downloads](https://pepy.tech/badge/easyroi)](https://pepy.tech/project/easyroi) --\u003e\n[![Downloads](https://pepy.tech/badge/easyroi/month)](https://pepy.tech/project/easyroi)\n[![PyPI version](https://badge.fury.io/py/EasyROI.svg)](https://badge.fury.io/py/EasyROI)\n  \n  \nHelper library for drawing ROI in Computer Vision Applications  \n**Now you can crop the drawn roi's**\n\n![demo](https://github.com/saharshleo/easyROI/blob/main/assets/run.gif)\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n\n- [EasyROI](#easyroi)\n  - [Table of Contents](#table-of-contents)\n  - [About The Project](#about-the-project)\n    - [Tech Stack](#tech-stack)\n    - [File Structure](#file-structure)\n  - [Getting Started](#getting-started)\n    - [Prerequisites](#prerequisites)\n    - [Installation](#installation)\n  - [Usage](#usage)\n    - [Using EasyROI in your project](#using-easyroi-in-your-project)\n      - [Rectangular roi](#rectangular-roi)\n      - [Line Roi](#line-roi)\n      - [Circle Roi](#circle-roi)\n      - [Polygon Roi](#polygon-roi)\n      - [Cropping drawn roi](#cropping-drawn-roi)\n  - [Formats of roi](#formats-of-roi)\n    - [Rectangle](#rectangle)\n    - [Line](#line)\n    - [Circle](#circle)\n    - [Polygon](#polygon)\n  - [Future Work](#future-work)\n  - [Contributors](#contributors)\n  - [Acknowledgements and Resources](#acknowledgements-and-resources)\n  - [License](#license)\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\n\n\n### Tech Stack\n\n* [Python](https://www.python.org/)\n* [OpenCV](https://opencv.org/)\n* [Numpy](https://numpy.org/)  \n\n### File Structure \n    .  \n    ├── EasyROI  \n    │   ├── __init__.py  \n    │   ├── easyROI.py  \n    │   └── utils.py  \n    ├── input\n    │   ├── overpass.mp4   \n    ├── output/  \n    ├── dev_main.py             # Code for testing during developing phase\n    ├── test_library.py         # Code for testing during testing phase\n    ├── DEV_README.md           # README for developing phase \n    ├── LICENSE  \n    └── README.md \n    \n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\n### Prerequisites\n\n* python\u003e=3.6\n* pip\n\n\n### Installation\n1. Create virtual environment\n\n```sh\npython3 -m venv venv_easy_roi\nsource venv_easy_roi/bin/activate\n```\n\n2. Install EasyROI\n\n```sh\npip install EasyROI\n```\n\nIf you already have opencv installed:\n```sh\npip install --no-dependencies EasyROI\n```\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n* Read the instruction in terminal while drawing roi\n\n\n### Using EasyROI in your project\n\n* Initializing\n\n```python\nfrom EasyROI import EasyROI\n\nroi_helper = EasyROI(verbose=True)\n```\n\n#### Rectangular roi\n\n![rectangle_demo](https://github.com/saharshleo/easyROI/blob/main/assets/rectangle.gif)\n\n```python\nrect_roi = roi_helper.draw_rectangle(frame, 3)  # quantity=3 specifies number of rectangles to draw\n\nframe_temp = roi_helper.visualize_roi(frame, rect_roi)\n```\n\n* See roi format in - [Rectangle](#rectangle)\n\n\n#### Line Roi\n\n![line_demo](https://github.com/saharshleo/easyROI/blob/main/assets/line.gif)\n\n```python\nline_roi = roi_helper.draw_line(frame, 3)  # quantity=3 specifies number of lines to draw\n\nframe_temp = roi_helper.visualize_roi(frame, line_roi)\n```\n\n* See roi format in - [Line](#line)\n\n\n#### Circle Roi\n\n![circle_demo](https://github.com/saharshleo/easyROI/blob/main/assets/circle.gif)\n\n```python\ncircle_roi = roi_helper.draw_circle(frame, 3)   # quantity=3 specifies number of circles to draw\n\nframe_temp = roi_helper.visualize_roi(frame, circle_roi)\n```\n\n* See roi format in - [Circle](#circle)\n\n\n#### Polygon Roi\n\n![polygon_demo](https://github.com/saharshleo/easyROI/blob/main/assets/polygon.gif)\n\n```python\npolygon_roi = roi_helper.draw_polygon(frame, 3) # quantity=3 specifies number of polygons to draw\n\nframe_temp = roi_helper.visualize_roi(frame, polygon_roi)\n```\n\n* See roi format in - [Polygon](#polygon)\n\n\n#### Cropping drawn roi\n\n```python\npolygon_roi = roi_helper.draw_polygon(frame, 3) # quantity=3 specifies number of polygons to draw\n\ncropped_polys = roi_helper.crop_roi(frame, polygon_roi)\n```\n\n* Can do similarly for rectangular, circle roi\n* Returns dictionary with `key` value same as roi_label and value as image of cropped version\n\n\u003c!-- FORMAT OF ROI --\u003e\n## Formats of roi\n\n### Rectangle\n\nquantity = 1\n\n```\n{\n    'roi': {   \n                0: {'br_x': 573,\n                    'br_y': 443,\n                    'h'   : 105,\n                    'tl_x': 322,\n                    'tl_y': 338,\n                    'w'   : 251\n                }\n            },\n\n    'type': 'rectangle'\n}\n```\n\n### Line\n\nquantity = 2\n\n```\n{\n    'roi': {\n                0: {\n                    'point1': (374, 395), \n                    'point2': (554, 438)\n                },\n\n                1: {\n                    'point1': (555, 438), \n                    'point2': (830, 361)\n                }\n            },\n\n    'type': 'line'\n}\n```\n\n### Circle\n\nquantity = 2\n\n```\n{\n    'roi': {\n                0: {\n                    'center': (330, 355), \n                    'point2': (552, 375), \n                    'radius': 222\n                },\n\n                1: {\n                    'center': (702, 374), \n                    'point2': (700, 475), \n                    'radius': 101\n                }\n            },\n\n    'type': 'circle'\n}\n```\n\n### Polygon\n\nquantity = 2\n\n```\n{\n    'roi': {\n                0: {\n                    'vertices': [\n                        (586, 435), \n                        (534, 582), \n                        (200, 504), \n                        (356, 403)\n                    ]\n                },\n                \n                1: {\n                    'vertices': [\n                        (1108, 507),\n                        (738, 662),\n                        (709, 497),\n                        (711, 494),\n                        (927, 414)\n                    ]\n                }\n            },\n\n    'type': 'polygon'\n}\n```\n\n\n\u003c!-- FUTURE WORK --\u003e\n## Future Work\n* See [TODO.md](TODO.md) for seeing developments of this project\n\n\n\n\u003c!-- CONTRIBUTORS --\u003e\n## Contributors\n* [saharshleo](https://github.com/saharshleo)\n\n\n\u003c!-- ACKNOWLEDGEMENTS AND REFERENCES --\u003e\n## Acknowledgements and Resources\n* [Packaging](https://www.codementor.io/@ajayagrawal295/how-to-publish-your-own-python-package-12tbhi20tf)\n\n\n\u003c!-- LICENSE --\u003e\n## [License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharshleo%2Feasyroi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaharshleo%2Feasyroi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaharshleo%2Feasyroi/lists"}