Skip to main content

No project description provided

Project description

opencv-table-plotter

opencv-table-plotter is a simple Python library designed to overlay tables on images or frames using OpenCV. This library helps in drawing and customizing tables, including features like background color, opacity, title, and more.

Features

  • Draw tables on images or video frames using OpenCV.
  • Customize the number of rows and columns.
  • Set table and cell dimensions.
  • Add titles to the tables.
  • Adjust font, colors, and opacity.

Installation

You can install the opencv-table-plotter library using pip:

pip install opencv-table-plotter

Usage

Here is a basic example of how to use opencv-table-plotter:

import cv2
import numpy as np
from opencv_table_plotter import plot_table

# Create a blank image
frame = np.ones((600, 1600, 3), dtype=np.uint8) * 255

# Data to be displayed in the table
cell_data = ["Cell 1", "Cell 2", "Cell 3", "Cell 4"]

# Draw table on the image
plot_table(
    frame,
    cell_data,
    num_rows=2,
    num_columns=2,
    title="Sample Table",
    col_width=400,
    row_height=60,
    font=cv2.FONT_HERSHEY_SIMPLEX,
    font_size=0.7,
    font_color=(0, 0, 0),
    border_color=(0, 0, 0),
    line_thickness=2,
    background_color=(200, 200, 200),
    opacity=0.5,
    start_x=100,
    start_y=20
)

# Display the image
cv2.imshow('Table', frame)
cv2.waitKey(0)
cv2.destroyAllWindows()

Function Parameters

plot_table

  • frame: The image or video frame on which the table will be drawn.
  • cell_data: List of strings to be displayed in the table cells.
  • num_rows: Number of rows in the table (default: 2).
  • num_columns: Number of columns in the table (default: 2).
  • title: Title of the table (default: "").
  • col_width: Width of each column (default: 400).
  • row_height: Height of each row (default: 60).
  • font: Font type for the text (default: cv2.FONT_HERSHEY_SIMPLEX).
  • font_size: Font size for the text (default: 0.7).
  • font_color: Font color in BGR (default: (0, 0, 0)).
  • border_color: Border color of the table in BGR (default: (0, 0, 0)).
  • line_thickness: Thickness of the table lines (default: 2).
  • background_color: Background color of the table in BGR (default: (200, 200, 200)).
  • opacity: Opacity of the background color (default: 0.5).
  • start_x: Starting x-coordinate of the table (default: 1100).
  • start_y: Starting y-coordinate of the table (default: 20).

License

This project is licensed under the MIT License.

Author

  • Sezin Arseven

Acknowledgments

  • OpenCV for providing an excellent computer vision library.
  • The Python community for continuous support and inspiration.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

opencv_table_plotter-0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

opencv_table_plotter-0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file opencv_table_plotter-0.1.tar.gz.

File metadata

  • Download URL: opencv_table_plotter-0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for opencv_table_plotter-0.1.tar.gz
Algorithm Hash digest
SHA256 2131c606b27ea3abe2eb34bc3e67873bb0c098c7c7fd3dedbcfbca53d5bd4a43
MD5 c0d1ba2a184d7d51f9aefc740fe2202f
BLAKE2b-256 b0d0d5db4bcf85247183fc06731ce6596bc89badecd6abf82214129a9b8579cf

See more details on using hashes here.

File details

Details for the file opencv_table_plotter-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for opencv_table_plotter-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 633fc04e66643ef74c0ecc4dd5290349a1ec2ef58c05919ef1a49b20ca4cac9d
MD5 d03dedec08861af910f095cbe5d0dd79
BLAKE2b-256 298e19b97a29e3a16185feecfc9eec1a1b4fd8702e429f5ad0fc524ef22c336d

See more details on using hashes here.

Supported by

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