feat(perception): appearance-based person re-identification (Issue #322) #330
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "sl-perception/issue-322-person-reid"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #322
PersonTrack.msg/PersonTrackArray.msginsaltybot_scene_msgs— carries stable cross-cameratrack_id,camera_id, last-knownbbox, cosineconfidence,first_seen/last_seentimestamps, andis_staleflag_person_reid.py— pure-Python appearance helper (no ROS2 deps):extract_hsv_histogram()— 2-D HS histogram (H=16, S=8 → 128-dim), Value channel excluded for illumination robustness, L2-normalisedcosine_similarity()— handles zero/non-unit vectors safelymatch_track()— best gallery match with strict>threshold; skips stale entriesTrackGallery—add/update(EMA blend α=0.3, re-normalised) /mark_stale/prune_staleperson_reid_node.py— subscribes/camera/color/image_raw+/saltybot/scene/objects(BEST_EFFORT); crops COCO person (class_id=0) ROIs; matches gallery; publishesPersonTrackArrayon/saltybot/person_tracksat 5 HzCross-camera re-id
Run one
person_reidinstance per camera (remap/camera/color/image_raw), each sharing the same gallery namespace via thecamera_idparam. The HSV appearance feature is camera-agnostic — the same person gets the sametrack_idregardless of which view they appear in.Parameters
camera_id"front"PersonTracksimilarity_threshold0.75stale_timeout_s30.0max_tracks20publish_hz5.0Test plan
test/test_person_reid.py— 50 tests, 0 failures (pure Python, no ROS2)extract_hsv_histogram: shape, dtype, None/empty guard, unit norm, size-invariance, colour distinctivenesscosine_similarity: identical, zero, anti-parallel, orthogonal, non-unit vectorsmatch_track: empty gallery, exact match, at-threshold boundary, below threshold, stale exclusion, best-of-many, all-staleTrackGallery: add ID sequence, copy-on-store, timestamps, EMA blend, unit-norm preservation, stale lifecycle, prune🤖 Generated with Claude Code
Adds PersonTrack/PersonTrackArray msgs and a PersonReidNode that matches individuals across camera views using HSV colour histogram appearance features and cosine similarity, with EMA gallery update and 30s stale timeout. New messages (saltybot_scene_msgs): msg/PersonTrack.msg — track_id, camera_id, bbox, confidence, first_seen, last_seen, is_stale msg/PersonTrackArray.msg — array wrapper with header New files (saltybot_bringup): saltybot_bringup/_person_reid.py — pure kinematics (no ROS2 deps) extract_hsv_histogram() 2-D HS histogram (H=16, S=8 → 128-dim, L2-norm) cosine_similarity() handles zero/non-unit vectors match_track() best gallery match above threshold (strict >) TrackGallery add/update/match/mark_stale/prune_stale TrackEntry mutable dataclass; EMA feature blend (α=0.3) saltybot_bringup/person_reid_node.py Subscribes /camera/color/image_raw + /saltybot/scene/objects (BEST_EFFORT) Crops COCO person (class_id=0) ROIs; extracts features; matches gallery Publishes PersonTrackArray on /saltybot/person_tracks at 5 Hz Parameters: camera_id, similarity_threshold=0.75, stale_timeout_s=30, max_tracks=20, publish_hz=5.0 test/test_person_reid.py — 50 tests, all passing Modified: saltybot_scene_msgs/CMakeLists.txt — register PersonTrack/Array msgs saltybot_bringup/setup.py — add person_reid console_script Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>071e577227to4dbb4c6f0d