Skip to main content

a simple library to input various shapes like polygon rectangle and so on.

Project description

cv2operator

cv2operator is a simple library to input various shapes like polygon rectangle and so on.

Features

  • LineOperator: input a line by mouse draggin
  • PolylineOperator: input a polyline by click
  • PolygonOperator: input a polygon by click
  • RectOperator: input a rectangle by draggin
  • BrushOperator: paint mask region by draggin
  • KeyOperator: key management

Usage

Here is a simple example.

import cv2
from cv2operator import KeyOperator, OperartorWindow, LineOperator

def line_cb(p1, p2):
    print(f"line: p1={p1}, p2={p2}")

image = cv2.imread("goru.jpg")
window = OperartorWindow("example", image)

line_op = LineOperator(window, callback=line_cb)

key_op = KeyOperator()
print(key_op.help())
key_op.main_loop()

Operators

all operators are used in a example code. see demo.py in examples.

RectOperator

image

LineOperator

image

PolylineOperator

image

PolygonOperator

image

BrushOperator

image

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cv2operator-1.0.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file cv2operator-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: cv2operator-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0.post20191030 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.2

File hashes

Hashes for cv2operator-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09ebd48ac98069209549e63551722c93a3d8c2e89e5ba209fc3fcc257e469dc8
MD5 daf92d421cd5440fadc4181bb05cbe91
BLAKE2b-256 b657100c8d3e44a1c5dadafd6ed72cdbdb3ada216cb6e5ec70f8110afad97b11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page