← Perception Stack Independent project · Recorded vessel data

Camera geometry · World-space tracking · Uncertainty

Camera
Processing.

Read the scene.
Keep the uncertainty.

A camera supplies class and bearing. Turning those detections into useful maritime tracks also means accounting for waterline geometry, vessel attitude, timing, and the limits of monocular range.

01 / From image boxes to water-surface tracksMay 2025 vessel bag · October 2026 replay

01 / A semantic source in a larger system

Give every detection
a place in the world.

I built and maintain the camera repository, from its detector interface and geometry to tracking, occupancy, risk, and structured observations.

The pipeline is one part of my maritime perception stack. It turns pixel boxes into timestamped tracks in the same world frame as LiDAR and radar. The detector stays replaceable; the downstream system receives object classes, positions, motion states, and explicit uncertainty.

The central engineering problem is depth. A boat’s image bearing can be stable while its estimated range moves by metres. I made that difference part of the measurement model and carried it into the tracker and fusion layer.

My role
Developer & maintainer · pipeline, integration & validation
Core tools
ROS 2 · Python · NumPy · RViz · Docker
Recorded environment
Anping harbour channel, Tainan · May 16, 2025
Evidence
Replays October 21–22 · data audit October 25, 2026

02 / Be explicit about the input

A panorama.
A virtual camera.

The recorded vessel camera produces a stitched 180° panorama. Its lens and stitching geometry have no calibrated model in the stack. For this replay, a cylindrical approximation maps the forward 90° into a virtual pinhole view; cached YOLO11n boat boxes from that view enter the pipeline on the original image timestamps.

02 / Recorded panorama · the projection model is an approximation

YOLO11n is an upstream pipeline test model here. These recordings evaluate the processing path with cached detections; they do not establish the performance of a tuned maritime detector or live model inference.

From model output to a shared world frameAcquisition timestamps stay authoritative
Replaceable detector / segmenterPixel boxes + classes + confidence

CameraInfo describes the same image; masks supply optional surface evidence

Shared camera geometryWaterline ray + calibrated mount + vessel attitude

Boat-relative range and bearing, with random and correlated error terms

Object tracksDetection branch
Kalman filter + association

World position, covariance, class and motion → risk and prediction

Surface evidenceMask branch
Waterline contacts + stable water

Uncertainty-weighted occupied cells and cautious free-space evidence

Observation adapterTracks + risk + aligned grids → fusion

Missing or mismatched inputs are reported in observation quality and diagnostics

The recorded fixture publishes cached boxes, CameraInfo, and an obstacle mask filled from those boxes. General water-mask support is part of the implementation; the supplied replay does not demonstrate a trained water segmenter.

03 / Monocular depth has a direction

Trust the bearing.
Model the range.

The adapter projects the bottom centre of a detection box onto a horizontal water plane using the camera mount and the vessel’s roll and pitch at the image timestamp. The detector adapter, occupancy projection, and validation stub share the same geometry implementation.

Why far objects are difficult

For camera height H and a ray angle α below the horizon, range is H / tan(α). The sensitivity to a small angle error grows approximately as range² / H. A slight pitch error can move a distant waterline by metres.

01 / Different errors

Separate jitter from bias.

Box-edge jitter and timing error vary between images. Pitch, water height, mount yaw, and heading uncertainty remain correlated across a track. The model reports both parts so repeated observations do not erase a shared error.

02 / Directional covariance

Keep the long axis.

Range and bearing uncertainty become a 2 × 2 world-position covariance. Its ellipse extends along the line of sight. Association and filtering can accept a larger range residual while still requiring a close bearing match.

03 / Filter confidence

Retain persistent uncertainty.

The Kalman filter averages the measurement covariance. The published covariance adds back the estimated correlated part removed by repeated hits, using a 1 − 1 / hits correction. Fusion receives that covariance as well as a conservative scalar summary.

04 / Missing waterlines

Represent what is visible.

A box clipped at the image bottom only bounds its waterline range. The adapter uses a bounded estimate with extra uncertainty. Rays above the horizon and detections exceeding the configured range-error limit are rejected and counted.

The error model includes image-to-attitude timing scaled by angular velocity. The retained replay analysis found lower box jitter when attitude led the image by about 0.2 seconds. That informed the timing uncertainty; it does not establish a calibrated time offset for every camera.

04 / Preserve meaning between nodes

One timestamp.
One geometry contract.

01

Transform the measurement once.

The normalized default detection is already boat-relative. The tracker requires the matching frame and zero additional mounting offsets, then interpolates odometry at the detection stamp to place it in odom. This prevents a second camera transform from silently shifting every object.

02

Confirm tracks in source time.

The configured tracker requires three detections within five frames. A track can coast for one second without a detection. Reordered frames are dropped; clock rewinds and long gaps reset tracks. Motion is judged from measured position history and its scatter, so range jitter must be significant before it becomes a published velocity.

03

Keep unknown water unknown.

Occupancy uses the lowest valid waterline contact of an obstacle run. Pixels higher on an object do not paint a streak behind it. Contacts with projected standard deviation above 3 m contribute no evidence—roughly a 40 m useful reach under the default calibration. Stable water can add weak free space when water masks are available.

04

Assemble an observation once.

Tracks, risk, and predictive occupancy must share a batch stamp. Mask occupancy can use a nearby stamp within its tolerance. Bounded caches let the adapter assemble those inputs without repeatedly publishing the same track batch; incomplete batches explicitly become partial observations.

How the same contracts extend to several cameras

Run each camera independently.

Each camera gets its own calibration sensor, detector adapter, tracker, and occupancy path. Stale or excessively skewed sources are excluded individually, with diagnostics.

Merge at a common time.

The track merger advances older tracks to the newest stamp, widens their uncertainty, and suppresses cross-camera duplicates using distance or covariance gates. Grid origins lie on a shared lattice so occupancy can merge by whole cells. This capability is implemented; the displayed vessel replay uses one virtual camera.

05 / Check uncertainty against another sensor

A more credible
measure of confidence.

Two retained replays contain 1,059 matched camera–radar pairs. Only two fall beyond three combined standard deviations.

The regression samples every third fused batch that contains both sensors. It compares the camera waterline position with the radar’s estimated near edge. The normalization includes camera covariance, assumed 2 m radar range noise, and radar-extent uncertainty.

Matched pairs beyond 3 sigma0.19%

2 / 1,059 across both retained replays

Repeated camera stamps0

Across 1,147 published observations

Camera risk entries remain52 / 55

HIGH or CRITICAL entries in runs 1 and 2

03 / Recomputed from the supplied recordings · October 25 audit

The documented review baseline was 8.6% beyond 3σ. The two retained runs give 0% and 0.37%. This is evidence that the reported uncertainty better accommodates matched range disagreement. It does not measure detector precision, absolute depth accuracy, or calibration on unseen data; fusion has already selected these pairs, and adjacent samples are correlated.

Recorded regression window · bag time 585–715 s · same scene, two runs
MeasureRun 1Run 2Interpretation
Pairs beyond 3σ0 / 5232 / 536Matched-sensor consistency
Repeated / partial observations0 / 00 / 0567 and 580 observations respectively
Exactly one camera track near AIS yacht91.7%92.1%Within 15 m of interpolated AIS position
Camera HIGH / CRITICAL entries5255Published entries, not distinct encounters

The October 25 audit recomputed pair, observation, and risk metrics from the retained NPZ recordings and matched the supplied reports exactly. The AIS shares are supplied report values: 386 and 392 batches with available truth, interpolated between sparse AIS reports. Each run also contains one stale camera observation.

04 / Different sensing geometry remains visible in the range traces

06 / Watch the processing path

The image changes.
The tracks respond.

The virtual view and RViz tracks follow the same recorded transit. Boxes change as the vessel moves and the stitched image shifts; their waterline projections become world-space objects. RViz renders the estimated extent and motion, including the remaining instability.

05 / Virtual camera beside its tracks120 s · bag time 600–720 s · silent · 10 fps
Read a description of the replay

The left panel shows the forward virtual camera, including curved blank borders from the panorama remapping. Green boat boxes appear on the yacht ahead and other detections. The right panel shows RViz from mast height: cuboids sit on the water plane with labels and velocity arrows. Orange marks moving or unknown tracks; light blue marks static tracks. The nearly empty camera grid reflects limited trusted projection range. This is an October 2026 replay of the May 16, 2025 bag.

Watch the virtual camera at a larger scale
06 / The complete virtual viewSame 120 s replay · full frame · silent

The remapped view preserves the forward 90° used by the cached detector fixture. Black borders and the panorama’s visible stitching are retained.

The video window is 600–720 s; the regression window is 585–715 s. They overlap but are not identical. Playback follows recorded bag time; detector inference was cached before replay.

07 / Better confidence still leaves errors

Keep the failures
in the picture.

07 / Every update remains visible, including camera risk entries
01

Uncertainty does not correct the range.

A more realistic covariance improves association and the meaning of confidence. The panorama approximation still introduces metre-scale drift, and camera tracks still generate HIGH or CRITICAL entries in this transit. The broader stack review identifies camera-only tracks as a main source of remaining fused false alarms.

02

One transit does not establish generalization.

The two recordings repeat one harbour window with the same cached detector input. Changes in illumination, weather, wave state, camera calibration, and unseen vessel types need separate evaluation. A calibrated camera model and a tuned maritime detector are the next inputs to validate.

03

Semantics, range, and occupancy deserve separate tests.

The supplied replay exercises the track path, but supplies no detector precision/recall benchmark and no dense water-segmentation evaluation. Multi-camera merging is implemented without a multi-camera field recording on this page. Those capabilities remain distinct from the evidence shown here.

A complementary perception source

The fusion layer uses camera class and bearing while limiting its influence on velocity and extent. Camera occupancy defaults to occupied-only contribution, so weak camera free-space evidence cannot erase LiDAR occupancy. Radar provides the complementary range evidence used in this diagnostic.

08 / Keep claims traceable

The recording.
The code. The conditions.

Materials identify perception-stack fa1d765 and camera-processing ef5a3a5 as the replay revisions. The reviewed camera checkout, ae35de7, adds README text and media only. Its runtime is unchanged from the camera revision used for the supplied recordings.

Credits

Camera pipeline development and maintenance: Jerry Chang. The replay uses upstream YOLO11n detector weights as a test fixture. ROS 2 supplies communication and message infrastructure; NumPy supports numerical computation; RViz renders the tracks. Images and videos come from the supplied vessel-bag replays. The residual histogram was redrawn from their recorded outputs.

Camera Processing / Part of the Perception Stack

Bring the meaning.
Carry the uncertainty.

Explore Sensor Fusion Back to the complete stack