Skip to content

rect2d.py

rerun.components.rect2d

class RectFormat

Bases: Enum

How to specify rectangles (axis-aligned bounding boxes).

XYWH = 'XYWH' class-attribute

[x,y,w,h], with x,y = left,top.

YXHW = 'YXHW' class-attribute

[y,x,h,w], with x,y = left,top.

XYXY = 'XYXY' class-attribute

[x0, y0, x1, y1], with x0,y0 = left,top and x1,y1 = right,bottom.

YXYX = 'YXYX' class-attribute

[y0, x0, y1, x1], with x0,y0 = left,top and x1,y1 = right,bottom.

XCYCWH = 'XCYCWH' class-attribute

[x_center, y_center, width, height].

XCYCW2H2 = 'XCYCW2H2' class-attribute

[x_center, y_center, width/2, height/2].

class Rect2DArray

Bases: pa.ExtensionArray

def from_numpy_and_format(array, rect_format)

Build a Rect2DArray from an Nx4 numpy array.