Skip to content

Add PTZ calibration app and calibrated move parameters#335

Open
MateoLostanlen wants to merge 4 commits intodevelopfrom
calibrate_reolink_cam
Open

Add PTZ calibration app and calibrated move parameters#335
MateoLostanlen wants to merge 4 commits intodevelopfrom
calibrate_reolink_cam

Conversation

@MateoLostanlen
Copy link
Copy Markdown
Member

  • Add tools/ptz_calibration_app.py: a Streamlit app for calibrating PTZ camera parameters (speed/bias per axis, FOV per zoom level via QR-code chained-ratio method)
  • Update pyro_camera_api/pyro_camera_api/api/routes_control.py with calibrated values for both reolink-823S2 and reolink-823A16:
    • Pan/tilt speed and bias tables (open-loop move model: T = (target° - bias) / ω)
    • Per-adapter measured FOV lookup tables (42 entries, zoom 0–41) replacing the inaccurate model-based formula
    • _pick_speed() helper to select optimal speed level for a target displacement
    • POST /click_to_move endpoint: click a pixel in the image, camera pans/tilts to center on it

Calibration app features

  • Live View tab: capture, zoom, manual move
  • Click-to-Move tab: click on image to move camera, with before/after comparison
  • Zoom FOV tab: step-by-step QR-code-based FOV measurement with auto-retry, bridge support for QR repositioning
  • Calibration tab: impulse-response measurement (move at known speed/duration, measure pixel displacement)
  • Results & Export tab: linear regression of speed/bias, export to JSON
  • Presets tab: PTZ preset management

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.59%. Comparing base (f8b6e05) to head (0eda417).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #335      +/-   ##
===========================================
- Coverage    79.97%   72.59%   -7.39%     
===========================================
  Files            7        7              
  Lines          824      602     -222     
===========================================
- Hits           659      437     -222     
  Misses         165      165              
Flag Coverage Δ
unittests 72.59% <ø> (-7.39%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

When the target angle is below the calibrated bias at speed 1,
fire a 50ms impulse instead of skipping the move. Applies to both
/click_to_move and /move endpoints. Add micro-pulse calibration
section to the calibration app (zoom 41 default for precision).
Add duration parameter to /move endpoint so move+sleep+stop
happens on the Pi. Update calibration app to use single API
calls for all movements.
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