Stylized OpenCV rectangle and frame drawing helpers for detection overlays.
Project description
drawcv
drawcv is a computer-vision helper library that upgrades plain OpenCV bounding boxes into polished, style-rich frames for detection overlays, demos, and dashboards.
It works directly with numpy images and OpenCV, so you can drop it into existing object detection pipelines with minimal code change.
Installation
pip install drawcv
Why drawcv
- Replace plain
cv2.rectangle(...)output with modern frame styles. - Keep your current OpenCV flow (
cv2.imread, model inference, draw,cv2.imwrite). - Choose style by name or index.
- Optionally add a custom color/line overlay on top of any style.
Quick Start
import cv2
from drawcv import drawcv
image = cv2.imread("resource/test.png")
drawcv(
image=image,
style_id="pro-clean-blue", # or style index like 0, 1, 2...
coords=(80, 60, 280, 220), # x1, y1, x2, y2
)
cv2.imwrite("output.jpg", image)
OpenCV Comparison
Standard OpenCV
cv2.rectangle(image, (x1, y1), (x2, y2), (0, 255, 0), 2)
drawcv Replacement
from drawcv import drawcv
drawcv(
image=image,
style_id="pro-clean-blue",
coords=(x1, y1, x2, y2),
)
With Optional Overlay Color/Line Width
drawcv(
image=image,
style_id="futuristic-hud",
coords=(x1, y1, x2, y2),
color=(255, 255, 255), # BGR
line_width=1,
)
Available Styles
from drawcv import list_visionframe_styles
print(list_visionframe_styles())
Style Gallery
Current preview of frame styles:
Generate this gallery again:
import cv2
from drawcv import create_visionframe_gallery
gallery = create_visionframe_gallery()
cv2.imwrite("resource/visionframe_styles_gallery.png", gallery)
Local Development
python -m venv .venv
.venv\Scripts\activate
pip install -e .[dev]
Build Package
python -m build
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drawcv-0.1.2.tar.gz.
File metadata
- Download URL: drawcv-0.1.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56341e77a6541974a8daea53cb26e4acec5418af097161ee5a6fa94bbdd4f4fb
|
|
| MD5 |
e42f76ca0d7ff0e78e2d862906e01b0b
|
|
| BLAKE2b-256 |
d9e5545001f8c631003041331d227885992184204b6432a617c7517ed3493cb7
|
File details
Details for the file drawcv-0.1.2-py3-none-any.whl.
File metadata
- Download URL: drawcv-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9ca2be7a5609d06a4c1d176859a7c1226f627783034b25f722b9566679fb045
|
|
| MD5 |
3520eafa8ad123201907c3f0b796cae7
|
|
| BLAKE2b-256 |
d96d44622056eeb1b1a5751fe2d816facece9ad2d66c1a06735739cfa87bbbd2
|