public class BoundingBox : IComparable<BoundingBox>
Used for object detection results, containing detection information and spatial coordinates. Implements IComparable for sorting by confidence score (descending order).
用于物体检测结果,包含检测信息和空间坐标。 实现了IComparable接口以支持按置信度排序(降序)。
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 通过置信度分数将此边界框与另一个进行比较 |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
ToString | Returns a string that represents the current object. (继承自 Object。) |