Skip to main content

[PYTHON] cv2drawx

This is source code for the cv2drawx package project. This package includes new drawing features for opencv-python such as draw dash lines, rounded boxes, etc.

Sample code

Import packages

import cv2
import numpy as np
from cv2drawx.box import RoundedCornerBox
from cv2drawx.draw_line import draw_line

Setup a blank cv2 window

frame = np.zeros((720, 1280, 3), dtype=np.uint8)
frame.fill(200)

Draw elements

while True:
    # =======================================
    # DRAW ROUNDED CORNER BOX
    # WITH DASH BORDER
    # =======================================
    box = RoundedCornerBox(
        MatLike=frame,
        start_point=(50, 50),
        end_point=(500, 500),
        fill_color=(50, 50, 50),
        border_thickness=1,
        border_color=(0, 200, 230),
        border_radius=10,
        dash_size=15,
        dash_gap=10
    )
    box.draw()

    # =======================================
    # DRAW DIAGONAL DASH LINE
    # =======================================
    draw_line(
        frame,
        (0, 0),
        (frame.shape[1], frame.shape[0]),
        (0, 0, 0),
        1, 10, 10
    )

    cv2.imshow("frame", frame)

    if cv2.waitKey(1) & 0xFF == 27:
        break

cv2.destroyAllWindows()

Metadata

Release files for cv2drawx 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cv2drawx 0.1.0
File Size Uploaded
cv2drawx-0.1.0.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cv2drawx 0.1.0
File Interpreter ABI Platform
cv2drawx-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.1 kB

Release files / cv2drawx-0.1.0.tar.gz

Download URL cv2drawx-0.1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e0160df494bffeaa8d63d663a3e1bdcf735e2ad5d142279fae70220dd26864ed
BLAKE2b-256 checksum
How to use checksums
9bd7a86ce7c5b5781a3ac1941fe83110aecd7a16b431728a2a9f96eb0b7e8dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / cv2drawx-0.1.0-py3-none-any.whl

Download URL cv2drawx-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e1ed34c376568e24ee4a9ed87e8b35a490b11862c08ba7b6c372a8aae02caba
BLAKE2b-256 checksum
How to use checksums
20d2deef136d9e19827e78ff0b9dd0c867e29a389ef1c1f71c564fd310308b67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page