Skip to content

feat: add ROI selection from web UI - #12

Merged
johnoct merged 1 commit into
mainfrom
feat/roi-web-selection
Feb 6, 2026
Merged

feat: add ROI selection from web UI#12
johnoct merged 1 commit into
mainfrom
feat/roi-web-selection

Conversation

@johnoct

@johnoct johnoct commented Feb 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds the ability to select, reselect, or clear the motion detection Region of Interest (ROI) directly from the web UI
  • Users draw a rectangle on the live stream via a canvas overlay (mouse + touch), then confirm/cancel/clear
  • Backend receives coordinates via POST /roi, detection loop picks up changes each frame via thread-safe FrameBuffer
  • ROI button in status bar highlights amber when active; coordinate mapping handles object-fit: cover scaling

Test plan

  • 70 tests pass (8 new: FrameBuffer ROI methods, POST /roi set/clear/validation, GET /status includes ROI, HTML includes ROI UI elements)
  • Manual: open web UI, tap ROI button, draw rectangle on stream, confirm — verify green rectangle appears on stream
  • Manual: tap ROI button again, tap Clear — verify full-frame detection resumes
  • Manual: test on mobile (touch draw) and desktop (mouse draw)
  • Manual: resize browser while in ROI mode — verify overlay exits cleanly

Allow users to select, reselect, or clear the motion detection region
of interest directly from the web UI by drawing on the live stream.

- Add thread-safe get_roi/set_roi to FrameBuffer
- Add POST /roi endpoint with validation, extend GET /status with roi
- Add canvas-based ROI drawing overlay with mouse+touch support
- Handle object-fit:cover coordinate mapping (CSS to frame pixels)
- Detection loop reads ROI from FrameBuffer each iteration
- 70 tests passing (8 new)
@johnoct
johnoct merged commit 2494879 into main Feb 6, 2026
1 check 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