Please use. NET 5,. NET 6, NET 7,. NET 8, NET Framework 4.6, NET Framework 4.61, NET Framework 4.7, NET Framework 4.72, NET Framework 4.8, NET Framework 4.81, and. NET Core 3.1 versions

BoundingBox 类

Represents a bounding box with confidence score, spatial coordinates, and metadata 表示具有置信度分数、空间坐标和元数据的边界框

Definition

命名空间: DeploySharp.Data
程序集: DeploySharp (在 DeploySharp.dll 中) 版本:0.0.4+6e8a2e904469617cd59619d666c0e272985c0e33
C#
public class BoundingBox : IComparable<BoundingBox>
Inheritance
Object    BoundingBox
Implements
IComparableBoundingBox

备注

Used for object detection results, containing detection information and spatial coordinates. Implements IComparable for sorting by confidence score (descending order).

用于物体检测结果,包含检测信息和空间坐标。 实现了IComparable接口以支持按置信度排序(降序)。

示例

Basic usage:
C#
var box = new BoundingBox {
    Confidence = 0.95f,
    Box = new RectF(10.5f, 20.5f, 100f, 150f),
    Index = 1,
    NameIndex = 42
};

// Sorting boxes
List<BoundingBox> boxes = GetDetections();
boxes.Sort(); // Sorts by confidence descending

构造函数

BoundingBox初始化 BoundingBox 类的一个新实例

属性

Angle Gets or sets the rotation angle (in degrees) 获取或设置旋转角度(以度为单位)
Box Gets or sets the rectangular bounding coordinates 获取或设置矩形边界坐标
Confidence Gets or sets the detection confidence score (0-1) 获取或设置检测置信度分数(0-1)
Index Gets or sets the detection index (tracking/association ID) 获取或设置检测索引(跟踪/关联ID)
NameIndex Gets or sets the class/label index reference 获取或设置类别/标签索引引用

方法

CompareTo Compares this bounding box to another by confidence score 通过置信度分数将此边界框与另一个进行比较
EqualsDetermines whether the specified object is equal to the current object.
(继承自 Object。)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(继承自 Object。)
GetHashCodeServes as the default hash function.
(继承自 Object。)
GetTypeGets the Type of the current instance.
(继承自 Object。)
MemberwiseCloneCreates a shallow copy of the current Object.
(继承自 Object。)
ToStringReturns a string that represents the current object.
(继承自 Object。)

参见