ObjectTracker

Computer-vision style object detection overlay — draws bounding boxes and labels around detected regions of the content below, with grid, quadtree and mosaic layouts.

Props

  • detectionMode

    What counts as a detectable object.

    Type
    "alpha" | "bright" | "dark" | "red" | "green" | "blue"
    Default
    bright
  • threshold

    Detection cut-off.

    Type
    number
    Default
    0.25
  • layout

    How the canvas is partitioned into detection cells.

    Type
    "grid" | "quadtree" | "mosaic"
    Default
    mosaic
  • cellSize

    Base cell size in pixels

    Type
    number
    Default
    400
  • maxDepth

    Maximum subdivision levels for Quadtree/Mosaic layouts (each level can quarter a cell).

    Type
    number
    Default
    2
  • boxStyle

    Bounding box outline style

    Type
    "full" | "corners"
    Default
    corners
  • lineWidth

    Thickness of the box outline in pixels.

    Type
    number
    Default
    1.5
  • cornerRadius

    Corner radius of the box outline in pixels

    Type
    number
    Default
    0
  • strokeColor

    Bounding box outline color.

    Type
    string
    Default
    #ffffff
  • fillColor

    Bounding box fill color.

    Type
    string
    Default
    #5a79911a
  • labelColor

    Label text color.

    Type
    string
    Default
    #000000
  • labelBackgroundColor

    Label pill background color.

    Type
    string
    Default
    #ffffff
  • labelMode

    What each label shows.

    Type
    "none" | "dimensions" | "percentage"
    Default
    none
  • labelPosition

    Which corner of the box the label anchors to.

    Type
    "bottom-left" | "bottom-right" | "top-left" | "top-right"
    Default
    bottom-right
  • labelRadius

    Corner radius of the label pill in pixels.

    Type
    number
    Default
    0
  • labelInset

    Place the label inside or outside the box.

    Type
    boolean
    Default
    true
  • fontFamily

    Google Fonts family used for label text.

    Type
    string
    Default
    Inter
  • fontWeight

    Font weight for label text.

    Type
    number
    Default
    500
  • fontSize

    Label text size as a fraction of canvas height.

    Type
    number
    Default
    0.015
  • letterSpacing

    Letter spacing for label text, in em units.

    Type
    number
    Default
    0

Usage

<Shader>
  <ObjectTracker>
    <Circle />
  </ObjectTracker>
</Shader>