Detection<T>

Models & Types · AiDotNet.ComputerVision.Detection.ObjectDetection

Represents a single detected object.

For Beginners

This represents one object found in the image. It tells you:

  • Where the object is (bounding box)
  • What type of object it is (class ID and name)
  • How confident the model is (0.0 to 1.0)
  • Optionally, a pixel mask for instance segmentation

Constructors

Constructor Summary
Detection() Creates a new detection with default numeric operations.
Detection(BoundingBox<T> box, int classId, T confidence, string className) Creates a new detection with specified values.

Properties

Property Summary
BoundingBox<T> Box { get; set; } The bounding box defining the object’s location.
List<Keypoint<T>> Keypoints { get; set; } Optional keypoints for pose estimation.
SegmentationMask<T> Mask { get; set; } Optional instance segmentation mask for this object.
T Confidence { get; set; } Confidence score from 0 to 1 indicating detection certainty.
double Area { get; } Gets the area of the bounding box.
double CenterX { get; } Gets the center X coordinate of the bounding box.
double CenterY { get; } Gets the center Y coordinate of the bounding box.
int ClassId { get; set; } The class ID (index) of the detected object.
int? TrackId { get; set; } Optional track ID for object tracking across frames.
string ClassName { get; set; } The human-readable name of the class (e.g., “person”, “car”).

Methods

Method Summary
string ToString() Gets a string representation of this detection.