Custom ROI in Computer Vision Applications

Overview

stargazers issues forks license

EasyROI

Downloads PyPI version

Helper library for drawing ROI in Computer Vision Applications

demo

Table of Contents

About The Project

Tech Stack

File Structure

.  
├── EasyROI  
│   ├── __init__.py  
│   ├── easyROI.py  
│   └── utils.py  
├── input
│   ├── overpass.mp4   
├── output/  
├── dev_main.py             # Code for testing during developing phase
├── test_library.py         # Code for testing during testing phase
├── DEV_README.md           # README for developing phase 
├── LICENSE  
└── README.md 

Getting Started

Prerequisites

  • python>=3.6
  • pip

Installation

  1. Create virtual environment
python3 -m venv venv_easy_roi
source venv_easy_roi/bin/activate
  1. Install EasyROI
pip install EasyROI

Usage

  • Read the instruction in terminal while drawing roi

Using EasyROI in your project

  • Initializing
from EasyROI import EasyROI

roi_helper = EasyROI(verbose=True)

Rectangular roi

rectangle_demo

rect_roi = roi_helper.draw_rectangle(frame, 3)  # quantity=3 specifies number of rectangles to draw

frame_temp = roi_helper.visualize_roi(frame, rect_roi)

Line Roi

line_demo

line_roi = roi_helper.draw_line(frame, 3)  # quantity=3 specifies number of lines to draw

frame_temp = roi_helper.visualize_roi(frame, line_roi)
  • See roi format in - Line

Circle Roi

circle_demo

circle_roi = roi_helper.draw_circle(frame, 3)   # quantity=3 specifies number of circles to draw

frame_temp = roi_helper.visualize_roi(frame, circle_roi)

Polygon Roi

polygon_demo

polygon_roi = roi_helper.draw_polygon(frame, 3) # quantity=3 specifies number of polygons to draw

frame_temp = roi_helper.visualize_roi(frame, polygon_roi)

Formats of roi

Rectangle

quantity = 1

{
    'roi': {   
                0: {'br_x': 573,
                    'br_y': 443,
                    'h'   : 105,
                    'tl_x': 322,
                    'tl_y': 338,
                    'w'   : 251
                }
            },

    'type': 'rectangle'
}

Line

quantity = 2

{
    'roi': {
                0: {
                    'point1': (374, 395), 
                    'point2': (554, 438)
                },

                1: {
                    'point1': (555, 438), 
                    'point2': (830, 361)
                }
            },

    'type': 'line'
}

Circle

quantity = 2

{
    'roi': {
                0: {
                    'center': (330, 355), 
                    'point2': (552, 375), 
                    'radius': 222
                },

                1: {
                    'center': (702, 374), 
                    'point2': (700, 475), 
                    'radius': 101
                }
            },

    'type': 'circle'
}

Polygon

quantity = 2

{
    'roi': {
                0: {
                    'vertices': [
                        (586, 435), 
                        (534, 582), 
                        (200, 504), 
                        (356, 403)
                    ]
                },
                
                1: {
                    'vertices': [
                        (1108, 507),
                        (738, 662),
                        (709, 497),
                        (711, 494),
                        (927, 414)
                    ]
                }
            },

    'type': 'polygon'
}

Future Work

  • See TODO.md for seeing developments of this project

Contributors

Acknowledgements and Resources

License

You might also like...
Drug design and development team HackBio internship is a virtual bioinformatics program that introduces students and professional to advanced practical bioinformatics and its applications globally.
Drug design and development team HackBio internship is a virtual bioinformatics program that introduces students and professional to advanced practical bioinformatics and its applications globally.

-Nyokong. Drug design and development team HackBio internship is a virtual bioinformatics program that introduces students and professional to advance

These data visualizations were created for my introductory computer science course using Python
These data visualizations were created for my introductory computer science course using Python

Homework 2: Matplotlib and Data Visualization Overview These data visualizations were created for my introductory computer science course using Python

Voilà, install macOS on ANY Computer! This is really and magic easiest way!

OSX-PROXMOX - Run macOS on ANY Computer - AMD & Intel Install Proxmox VE v7.02 - Next, Next & Finish (NNF). Open Proxmox Web Console - Datacenter N

3D Vision functions with end-to-end support for deep learning developers, written in Ivy.
3D Vision functions with end-to-end support for deep learning developers, written in Ivy.

Ivy vision focuses predominantly on 3D vision, with functions for camera geometry, image projections, co-ordinate frame transformations, forward warping, inverse warping, optical flow, depth triangulation, voxel grids, point clouds, signed distance functions, and others. Check out the docs for more info!

View part of your screen in grayscale or simulated color vision deficiency.
View part of your screen in grayscale or simulated color vision deficiency.

monolens View part of your screen in grayscale or filtered to simulate color vision deficiency. Watch the demo on YouTube. Install with pip install mo

kyle's vision of how datadog's python client should look

kyle's datadog python vision/proposal not for production use See examples/comprehensive.py for a mostly working example of the proposed API. 📈 🐶 ❤️

This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.
This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.

This is a repository to learn and get more computer vision skills, make robotics projects integrating the computer vision as a perception tool and create a lot of awesome advanced controllers for the robots of the future.

Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Buy early bsc gems with custom gas fee, slippage, amount. Auto approve token after buy. Sell buyed token with custom gas fee, slippage, amount. And more.

Pancakeswap Sniper bot Full version of Pancakeswap sniping bot used to snipe during fair coin launches. With advanced options and a graphical user int

Custom Weapons 3 attribute support for Custom Weapons X

CW3toX Allows use of Custom Weapons 3 attributes in Custom Weapons X. Requiremen

Nautobot-custom-jobs - Custom jobs for Nautobot

nautobot-custom-jobs This repo contains custom jobs for Nautobot. Installation P

Example-custom-ml-block-keras - Custom Keras ML block example for Edge Impulse

Custom Keras ML block example for Edge Impulse This repository is an example on

HyperPose is a library for building high-performance custom pose estimation applications.
HyperPose is a library for building high-performance custom pose estimation applications.

HyperPose is a library for building high-performance custom pose estimation applications.

 Object recognition using Azure Custom Vision AI and Azure Functions
Object recognition using Azure Custom Vision AI and Azure Functions

Step by Step on how to create an object recognition model using Custom Vision, export the model and run the model in an Azure Function

Open Source Differentiable Computer Vision Library for PyTorch
Open Source Differentiable Computer Vision Library for PyTorch

Kornia is a differentiable computer vision library for PyTorch. It consists of a set of routines and differentiable modules to solve generic computer

Open source Python module for computer vision

About PCV PCV is a pure Python library for computer vision based on the book "Programming Computer Vision with Python" by Jan Erik Solem. More details

PyTorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision.
PyTorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision.

PyTorchCV: A PyTorch-Based Framework for Deep Learning in Computer Vision @misc{CV2018, author = {Donny You ([email protected])}, howpubl

Build fully-functioning computer vision models with PyTorch
Build fully-functioning computer vision models with PyTorch

Detecto is a Python package that allows you to build fully-functioning computer vision and object detection models with just 5 lines of code. Inferenc

The open-source tool for building high-quality datasets and computer vision models
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Comments
  • Problem in loop

    Problem in loop

    Hello I have a Problem ! I putted the rectangle ROI in a loop but, it works only once, for the second time : i got the message for selecting ROI, but the window didn't show. Capture d’écran 2022-04-14 à 16 10 14

    opened by zizouk59 5
  • Install on current manjaro

    Install on current manjaro

    Hi, i got the following error when installing with pip:

    Collecting easyroi
      Using cached EasyROI-1.0.2.tar.gz (5.7 kB)
      Using cached EasyROI-1.0.0-py3-none-any.whl (5.2 kB)
    ERROR: Cannot install easyroi==1.0.0, easyroi==1.0.2 and easyroi==1.0.3 because these package versions have conflicting dependencies.
    
    The conflict is caused by:
        easyroi 1.0.3 depends on opencv-python==4.5.1.48
        easyroi 1.0.2 depends on opencv-python==4.5.1.48
        easyroi 1.0.0 depends on opencv-python==4.5.1.48
    
    [marvin@thinkpad ~]$ python --version
    Python 3.10.1
    [marvin@thinkpad ~]$ uname -a
    Linux thinkpad 5.10.93-1-MANJARO #1 SMP PREEMPT Thu Jan 20 09:46:07 UTC 2022 x86_64 GNU/Linux
    [marvin@thinkpad ~]$ pip --version
    pip 20.3.4 from /usr/lib/python3.10/site-packages/pip (python 3.10)
    [marvin@thinkpad ~]$
    

    Any suggestions, or could you update the requirements of easyroi?

    Cheers Marvin

    opened by youcann 3
  • Bump numpy from 1.19.5 to 1.22.0

    Bump numpy from 1.19.5 to 1.22.0

    Bumps numpy from 1.19.5 to 1.22.0.

    Release notes

    Sourced from numpy's releases.

    v1.22.0

    NumPy 1.22.0 Release Notes

    NumPy 1.22.0 is a big release featuring the work of 153 contributors spread over 609 pull requests. There have been many improvements, highlights are:

    • Annotations of the main namespace are essentially complete. Upstream is a moving target, so there will likely be further improvements, but the major work is done. This is probably the most user visible enhancement in this release.
    • A preliminary version of the proposed Array-API is provided. This is a step in creating a standard collection of functions that can be used across application such as CuPy and JAX.
    • NumPy now has a DLPack backend. DLPack provides a common interchange format for array (tensor) data.
    • New methods for quantile, percentile, and related functions. The new methods provide a complete set of the methods commonly found in the literature.
    • A new configurable allocator for use by downstream projects.

    These are in addition to the ongoing work to provide SIMD support for commonly used functions, improvements to F2PY, and better documentation.

    The Python versions supported in this release are 3.8-3.10, Python 3.7 has been dropped. Note that 32 bit wheels are only provided for Python 3.8 and 3.9 on Windows, all other wheels are 64 bits on account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit support. All 64 bit wheels are also linked with 64 bit integer OpenBLAS, which should fix the occasional problems encountered by folks using truly huge arrays.

    Expired deprecations

    Deprecated numeric style dtype strings have been removed

    Using the strings "Bytes0", "Datetime64", "Str0", "Uint32", and "Uint64" as a dtype will now raise a TypeError.

    (gh-19539)

    Expired deprecations for loads, ndfromtxt, and mafromtxt in npyio

    numpy.loads was deprecated in v1.15, with the recommendation that users use pickle.loads instead. ndfromtxt and mafromtxt were both deprecated in v1.17 - users should use numpy.genfromtxt instead with the appropriate value for the usemask parameter.

    (gh-19615)

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
Information Technology Student at VJTI, Mumbai
null
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 209 Feb 17, 2021
Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Statistics and Visualization of acceptance rate, main keyword of CVPR 2021 accepted papers for the main Computer Vision conference (CVPR)

Hoseong Lee 78 Aug 23, 2022
A script written in Python that generate output custom color (HEX or RGB input to x1b hexadecimal)

ColorShell ─ 1.5 Planned for v2: setup.sh for setup alias This script converts HEX and RGB code to x1b x1b is code for colorize outputs, works on ou

Riley 4 Oct 31, 2021
Custom Plotly Dash components based on Mantine React Components library

Dash Mantine Components Dash Mantine Components is a Dash component library based on Mantine React Components Library. It makes it easier to create go

Snehil Vijay 239 Jan 8, 2023
This is Pygrr PolyArt, a program used for drawing custom Polygon models for your Pygrr project!

This is Pygrr PolyArt, a program used for drawing custom Polygon models for your Pygrr project!

Isaac 4 Dec 14, 2021
A custom qq-plot for two sample data comparision

QQ-Plot 2 Sample Just a gist to include the custom code to draw a qq-plot in python when dealing with a "two sample problem". This means when u try to

null 1 Dec 20, 2021
Piglet-shaders - PoC of custom shaders for Piglet

Piglet custom shader PoC This is a PoC for compiling Piglet fragment shaders usi

null 6 Mar 10, 2022
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 3.1k Jan 8, 2023
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 2.3k Feb 13, 2021
Fast data visualization and GUI tools for scientific / engineering applications

PyQtGraph A pure-Python graphics library for PyQt5/PyQt6/PySide2/PySide6 Copyright 2020 Luke Campagnola, University of North Carolina at Chapel Hill h

pyqtgraph 2.3k Feb 17, 2021