Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dfki-ric/uxo-dataset2024/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheMatchingContext class provides a unified interface for accessing and synchronizing multi-modal data from ARIS sonar recordings, GoPro video, and gantry positioning systems. It handles temporal alignment, metadata loading, and frame-by-frame data access across all three data sources.
Module Path: scripts/common/matching_context.py
Class: MatchingContext
Constructor
Path to the directory containing ARIS data files, including:
- Raw frames (
.pgmfiles) - Polar-transformed frames in
polar/subdirectory {basename}_metadata.yaml- File-level metadata{basename}_frames.csv- Per-frame metadata{basename}_marks.yaml- Optional motion onset markers
Path to the gantry CSV data file containing timestamp and position columns
Path to the GoPro video file (MP4, AVI, etc.). Pass empty string or None if no GoPro data available
Image format for polar-transformed ARIS frames (e.g., ‘png’, ‘jpg’)
Key Properties
ARIS Properties
Base name of the ARIS recording (derived from directory name)
Sorted list of file paths to raw ARIS frame images (.pgm format)
Sorted list of file paths to polar-transformed ARIS frames, or None if unavailable
File-level metadata loaded from YAML
Per-frame metadata with columns matching FrameHeaderFields enum
Manual marks/annotations, including motion onset frame if available
Total number of ARIS frames in the recording
Start timestamp of ARIS recording (microseconds since epoch)
Duration of ARIS recording in microseconds
Frame index where motion begins, if marked
Starting frame index for active region (defaults to onset if marked, else 0)
Ending frame index for active region (defaults to last frame)
Number of frames in the active region
Duration of active region in microseconds
Frame step size for playback/processing
Gantry Properties
Base name of the gantry data file
Metadata row for this gantry recording from the metadata CSV
Gantry position data with columns: timestamp_us, x, y, z
Start timestamp of gantry recording (microseconds since epoch)
Timestamp when motion begins (microseconds since epoch)
Duration of gantry recording in microseconds
Time offset from start to motion onset in microseconds
GoPro Properties
Whether GoPro video is available for this context
Base name of the GoPro video file
OpenCV video capture object for the GoPro recording
Current GoPro frame index
Total number of frames in the GoPro video
GoPro video frame rate
Frame offset for synchronizing GoPro with ARIS (adjustable)
Methods
get_aris_frametime
Frame index (0-based)
Frame timestamp in microseconds since epoch (from FrameTime field)
get_aris_frametime_ext
Frame index (can be negative or beyond recording)
Actual or extrapolated timestamp in microseconds since epoch
aristime_to_gopro_idx
ARIS frame timestamp in microseconds since epoch
Corresponding GoPro frame index, accounting for offset
get_gopro_frame
ARIS frame timestamp in microseconds since epoch
If True, returns None if exact frame positioning fails
GoPro frame as BGR image array, or None if unavailable/positioning failed
Actual GoPro frame index that was retrieved
get_usable_gopro_range
Minimum useful offset (negative value)
Maximum useful offset (total GoPro frames)
get_gantry_odom
ARIS frame timestamp in microseconds since epoch
Interpolated (x, y, z) position in meters
Actual gantry timestamp used for interpolation (clamped to valid range)
Helper Functions
folder_basename
get_aris_metadata
get_gopro_metadata
get_gantry_metadata
Usage Example
Common Workflows
Manual Synchronization
Position-Based Analysis
Related Modules
- ARIS Definitions - Frame header field definitions
- Optical Flow - Motion analysis on ARIS frames