Skip to content

feat(measure-anything): add calibrated OAK4 measurement app - #923

Draft
PetrNovota wants to merge 16 commits into
mainfrom
codex/parcel-measurement
Draft

PetrNovota wants to merge 16 commits into
mainfrom
codex/parcel-measurement

Conversation

@PetrNovota

@PetrNovota PetrNovota commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Why

Add Measure anything, an OAK4 app that calibrates a support surface and displays tracked objects with length, width, and height. Operators can recognize saved objects by RGB crops, inspect segmented clouds and cuboids, and refresh measurements while objects remain visible.

What changed

  • Use only public depthai-nodes APIs: MeasureAnythingDetector, MeasureAnythingDimensioner, SupportPlaneCalibrator, ImageAlignDepthCorrection, and ApplyDepthColormap. Pin PR #348 at ce406ed9bb8d5e6fde14694100a4000830da533f with DepthAI 3.12.0.
  • Create all nodes upfront in one device-backed pipeline. Build native Depth with only fps=10, leaving its algorithm, model, and source resolution at SDK defaults. Align and correct depth into RGB axial coordinates before cloud generation. Keep detector RGB at 2000 × 1500, stereo at 1280 × 800, and the aligned cloud at 768 × 480.
  • Use the standard static frontend with H.264 RGB and matched native annotations. Host nodes handle commands, processing, storage, and ten-second BenchmarkIn reports. Require 10 consecutive observations before displaying or saving an object.
  • Persist the latest 20 snapshots, including matching RGB crops, segmented clouds, cuboids, and provenance. One background writer saves at most one object per sequence without blocking measurement, schedules waiting objects, and atomically replaces requested updates. Put Update Measurement at the top of the detail dialog.
  • Show camera-to-cuboid-center distance in measurement details using existing saved coordinates. Keep Processing visible above the Calibration, Measurements, and Configuration tabs. Move both RGB overlay controls into Configuration.
  • Add mutually exclusive depth blending at 50% and support-plane-only highlighting. Verify the plane every five seconds; rejection pauses measurement and prompts recalibration.
  • Enable the dot projector at intensity 1.0 when IR drivers are available. Continue on devices without IR hardware.
  • Rename the example, UI, services, topics, app identifier, and repository references to Measure anything. Remove development planning and validation documents.

Scope and blast radius

Adds a self-contained example under apps/measure-anything, index entries, and an RVC2 test exclusion. Requires OAK4 RGB, stereo, and an accelerometer. History uses the app's storage mount. Existing records without RGB previews remain readable.

Verification

  • All 70 backend tests pass against the pinned dependency. Clean npm ci, TypeScript checks, production build, Biome, repository hooks, agent documentation validation, and generated-index checks pass.
  • Tested the packaged app on OAK4 and in Chrome: calibration, H.264 boxes and dimensions, RGB thumbnails, cloud and cuboid display, and snapshot replacement. Verified the replacement changed the revision, source sequence, cloud, and RGB crop. History survived restarts; all 20 records were checked before and after the identifier migration.
  • Verified the new distance against the center calculated from all eight saved cuboid corners. Scrolled the history to the bottom and confirmed Processing stayed fixed. Checked three-tab keyboard navigation and both relocated overlay controls on the packaged app.
  • Native Depth AUTO resolved to NEURAL_DEPTH_1056X660 on the test device. Six ten-second windows across plain RGB, depth overlay, and plane overlay delivered 9.94–10.03 FPS, with matching annotations, no missing source sequences, and no stream errors. The scene had one confirmed object. Final native detector and dimensioner reports had no failed batches. This is not a new three-object regression result.
  • Periodic plane acceptance passed on the final build. An earlier temporary test displaced the selected plane by 500 mm and verified rejection, paused admission, and the frontend recalibration prompt. No test hook or evidence capture remains enabled.
  • The device reported no IR drivers, so the projector-on path was not exercised. Physical dimension accuracy and holistic replay remain unvalidated. The pinned algorithm has a documented historical synthetic 5 mm tolerance failure; this app does not claim metrology accuracy.

@PetrNovota PetrNovota changed the title feat(parcel-measurement): add calibrated OAK4 parcel app feat(measure-anything): add calibrated OAK4 measurement app Nov 26, 2026
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