id — Camera identification ROI authoring tool

Interactive utility to author a JSON config that uniquely identifies each camera by checking fixed ROIs for the presence of ArUco markers. The resulting configs/camera_ident.config.json is used by s6.utils.camera_identifier_aruco.CameraIDIdentifierAruco to reorder images reliably.

Usage

# Ensure the stream server is running first (in another terminal)
s6 stream

# Launch the ROI authoring UI
s6 id
# or
python -m s6.app.id

How it works

  • Connects to the TCP stream (s6.utils.streamer.VideoStreamClient) using the host from ConnectionConfig.load_default().stream_server.

  • Displays one camera view at a time and lets you draw rectangular ROIs via mouse. Each ROI can be positive (must contain at least one detected ArUco center) or negative (must contain none) depending on a toggle.

  • Saves a JSON config with rule_config — mapping from camera roles to lists of region specs: {"type": "rect", "bbox": [x1, y1, x2, y2], "negate": bool}. When there are three cameras the default roles are R, B, and L; for other counts they are numeric strings ("0", "1", …).

  • At runtime, CameraIDIdentifierAruco.order(images) evaluates rules and returns a dict {camera_id: image}.

UI controls

  • Drag with left mouse button: draw a rectangular ROI for the current role.

  • m: toggle POSITIVE/NEGATIVE (negated) mode for new ROIs.

  • r: cycle camera role (R/B/L or numeric).

  • d: cycle which camera view is displayed.

  • c: clear all ROIs.

  • Enter or Space: finish and write configs/camera_ident.config.json.

Troubleshooting

  • Start s6 stream first; the tool waits for the first frame to size the UI.

  • If you don’t see markers, ensure your OpenCV build includes cv2.aruco (opencv-contrib) and that markers are visible in the scene.