Skip to content

Proposal: ObjectDetection utility class for detection + annotation in OpenCV #27467

Open
@MONY-STARK

Description

@MONY-STARK

Describe the feature and motivation

Proposal: Add a Utility Class for Object Detection Inference and Annotation

I propose to add a utility class named ObjectDetection under a new or existing module (e.g., objdetect) in OpenCV that simplifies the pipeline for:

Running object detection using a provided model

Annotating the prediction results on images or video

🎯 Key Features:
Accepts a pre-trained model (OpenCV cv2.dnn, ONNX, PyTorch, etc.)

Accepts image(s) or video stream as input

Automatically handles:

Inference

Drawing bounding boxes

Overlaying class labels and confidence scores

Outputs annotated image or video

🧩 Motivation:
Many users (especially beginners or prototyping engineers) perform object detection and then manually write repetitive code to draw results using OpenCV primitives like cv2.rectangle and cv2.putText. A clean abstraction that integrates model inference and result annotation would:

Improve productivity

Encourage best practices (e.g., consistent styling, confidence thresholding)

Reduce boilerplate code in object detection applications

🏗️ Possible Extension:
Built-in color mapping for labels

Optional saving/display of output

Confidence thresholding

Format-agnostic support (accepting detection outputs from YOLO, SSD, etc.)

I’d love to hear your thoughts on whether this feature aligns with OpenCV’s direction. If approved, I’m happy to begin working on a prototype and PR under guidance.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy