Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Measurement format

Every tracked frame produces one measurement. It is sent as one UDP datagram, written as one line of a JSONL file (output.jsonl_path, rekkefly track --jsonl), and summarised on ZMQ in the Kinefly format. The schema is defined by Measurement in src/tracker.rs; schema_version changes if a field’s meaning ever does.

Measurement

FieldTypeMeaning
schema_versionintegerCurrently 1
instancestringThe rig’s label
sequenceintegerThe source’s frame number
timestamp_nsintegerWhen the frame arrived, nanoseconds since 1970 (host time, not a camera timestamp)
elapsed_nsintegerTime since the rig started, nanoseconds (0 in rekkefly track)
width, heightintegerProcessing size, pixels
capture_fpsnumberThe source’s measured frame rate (0 in rekkefly track)
processing_usnumberTime spent tracking this frame, microseconds
background_subtractedbooleanWhether background subtraction was applied
left, right, head, abdomenobjectEach part’s state (below)
left_minus_right_radnumber or nullL − R, radians
left_plus_right_radnumber or nullL + R, radians

Part state

FieldTypeMeaning
enabledbooleanWhether the part is tracked
angle_radnumber or nullThe reported angle: relative to the body axis, wings positive toward the head
image_angle_radnumber or nullThe same edge as an image angle, clockwise from image-right
angles_radarray of numbersEvery detected edge, the reported one first (up to max_edges)
gradientsarray of numbersEach edge’s signed strength, in the same order
strengthnumberThe reported edge’s strength
peak_gradientnumberThe strongest edge before the threshold was applied: for setting threshold
coveragenumberFraction of the sector inside the image, 0–1
intensitynumberMean normalized intensity in the sector, 0–1
radius_pxnumber or nullCentroid method only: the mean radius

Missing or disabled angles are null, never zero or a stale value.

Example

One measurement from the Bogong moth, formatted:

{
  "schema_version": 1,
  "instance": "rig-a",
  "sequence": 0,
  "timestamp_ns": 1791859983969667394,
  "elapsed_ns": 0,
  "width": 640,
  "height": 480,
  "capture_fps": 0.0,
  "processing_us": 1242.68,
  "background_subtracted": false,
  "left": {
    "enabled": true,
    "angle_rad": -0.37081718,
    "image_angle_rad": -0.38192773,
    "angles_rad": [-0.37081718, 0.28641963],
    "gradients": [-0.033694424, 0.0050776303],
    "radius_px": null,
    "intensity": 0.34237066,
    "strength": 0.033694424,
    "peak_gradient": 0.033694424,
    "coverage": 1.0
  },
  "right": {
    "enabled": true,
    "angle_rad": -0.2743702,
    "image_angle_rad": 3.4048524,
    "angles_rad": [-0.2743702, 0.4193797],
    "gradients": [0.0647008, -0.0024671927],
    "radius_px": null,
    "intensity": 0.37786517,
    "strength": 0.0647008,
    "peak_gradient": 0.0647008,
    "coverage": 1.0
  },
  "head": {"enabled": false, "angle_rad": null, "image_angle_rad": null, "angles_rad": [], "gradients": [], "radius_px": null, "intensity": 0.0, "strength": 0.0, "peak_gradient": 0.0, "coverage": 0.0},
  "abdomen": {"enabled": false, "angle_rad": null, "image_angle_rad": null, "angles_rad": [], "gradients": [], "radius_px": null, "intensity": 0.0, "strength": 0.0, "peak_gradient": 0.0, "coverage": 0.0},
  "left_minus_right_rad": -0.09644699,
  "left_plus_right_rad": -0.6451874
}

(capture_fps is 0 here because rekkefly track processes a file as fast as possible; live sources report their rate.)

Kinefly ZMQ message

FieldSource
xleft.angle_rad, or 0.0 if missing
yright.angle_rad, or 0.0 if missing
yawx − y
z, pitch, roll0.0
frame_numbersequence
timestamp_unixtimestamp_ns in seconds

The message is one ZMQ frame of JSON, written byte for byte as the Kinefly Docker bridge writes it: the keys in the order timestamp_unix, pitch, y, x, yaw, z, roll, frame_number, with ", " and ": " between them, and numbers as Python writes them (0.0, 1e-05):

{"timestamp_unix": 1700000000.125, "pitch": 0.0, "y": -0.5, "x": 0.25, "yaw": 0.75, "z": 0.0, "roll": 0.0, "frame_number": 77}

CSV from rekkefly track

ColumnMeaning
frameFrame index in the video
secondsThe frame’s time in the video
left_deg, right_degWing angles, degrees
left_minus_right_deg, left_plus_right_degL − R and L + R, degrees
head_deg, abdomen_degHead and abdomen angles, degrees
processing_usTracking time, microseconds

Missing values are empty cells.