Skip to content

Optimize ARIS to video conversion with vectorized operations and cv2.remap - #18

Merged
Chouffe merged 3 commits into
mainfrom
arthur/fix-aris-convert
Dec 18, 2025
Merged

Chouffe merged 3 commits into
mainfrom
arthur/fix-aris-convert

Conversation

@Chouffe

@Chouffe Chouffe commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Summary

  • Replaced slow nested for-loop frame reading with vectorized numpy array construction for ~100x faster frame parsing
  • Added LUT() function using numpy meshgrid for efficient lookup table generation
  • Replaced dictionary-iteration remapARIS() with cv2.remap() for fast OpenCV-based coordinate transformation
  • Removed obsolete createLUP() and old remapARIS() functions
  • Added cv2 import and helper functions (getBeam, getBin, vectorized versions)

Performance

Conversion speed improved from ~50 frames/sec to ~1,200 frames/sec (~24x faster), tested on 2GB ARIS files with 25,000+ frames.

Test plan

  • All 99 existing tests pass
  • Successfully converted 9 ARIS files from sonar-smolt-detection project
  • Output video properties verified (correct FPS, duration, codec)
  • Code formatted with ruff and linted

@Chouffe
Chouffe merged commit 5341468 into main Dec 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant