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.1

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.1
File Size Uploaded
cv2drawx-0.1.1.tar.gz 2.5 kB Details

Built distribution (wheel)

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

Total release size: 5.7 kB

Release files / cv2drawx-0.1.1.tar.gz

Download URL cv2drawx-0.1.1.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
83a95bb3904d15f9eed4a5603a58e8ad02f953a827a3bff420aeff3150af5c4f
BLAKE2b-256 checksum
How to use checksums
ccfdd1b42ade0b23fb6f066bceced6903afa55b13a183d156c80ebd818ccddac
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.1-py3-none-any.whl

Download URL cv2drawx-0.1.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1123a4bea873e2a5875e4ab8408ac32dd6a86104e527da0029415d9acd644353
BLAKE2b-256 checksum
How to use checksums
d4cde918e0869ce420c17ade4eaff890179da1f8de252b80fae7b209686df1ff
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

This release

0.1.1 This release

2 release files

0.1.0

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