docs: runtime, one photo, empty mask, browsers

This commit is contained in:
Ty
2026-09-11 15:02:47 +00:00
parent 188905e778
commit daf03248c4
+19 -3
View File
@@ -1,8 +1,9 @@
# Milestone 1 — Capture
Runs in the browser on phone and PC as ordinary client code.
No inference URL. No model. Mask, rectangle, measurements, and PNG encode are deterministic functions of the photo and user inputs.
No inference URL. No model. No backend. Mask, rectangle, measurements, and PNG encode are deterministic functions of the photo and user inputs.
Milestone 1 uses one reference photo. Further angles are later milestones.
Milestone 1 ends when the user sees the inventory PNG and measurements. Milestone 2 is Review. Milestone 3 is Create. This file does not create a WooCommerce product.
## Setup
@@ -16,12 +17,18 @@ Photograph the slab on a green or black sheet.
The app expects that sheet. Background removal keys green or black. Other backgrounds are out of Milestone 1.
## Browsers
Phone: iOS Safari, Android Chrome.
PC: Chrome, Edge, Firefox.
Other clients get a hard stop.
## States
One photo component is reused. Each state advances on approve. Back returns to the previous state. A device draft restores the last approved state.
1. Resume — only when a device draft exists. Continue or Start fresh.
2. Add photo — camera or picker. Setup rules visible.
2. Add photo — camera or picker. One photo. Setup rules visible.
3. Mask — background removal on that photo.
4. Length axis — bounding rectangle and long-side axis on the same photo.
5. Measure — length, thickness, inventory PNG, widths, sqft, bdft. Milestone 1 stops here.
@@ -32,6 +39,13 @@ Preview fits the device width. Height is capped so Mask and Measure controls sta
The preview is display only. Mask, rectangle, `scale`, sqft, and PNG encode use the source photo pixels, not the CSS size of the preview.
## Runtime
Browser APIs: `createImageBitmap`, `canvas` / `OffscreenCanvas`, Web Worker, `convertToBlob({ type: "image/png" })`, IndexedDB.
`idb-keyval` may wrap IndexedDB.
No OpenCV, ONNX, U2Net, or image-editor kit.
Sensitivity 0–100 maps to green chroma tightness and black brightness cutoff in the worker.
## Mask
Overlay: slab remains the photograph. Removed pixels are a light gray checkerboard.
@@ -43,7 +57,9 @@ Controls on this state, with the photo visible:
The control value updates immediately. The overlay recomputes 2.0 seconds after the last sensitivity change. A sheet change may recompute on the change.
Mask work runs off the UI thread. The last good overlay stays visible while a pass runs. Show a busy mark only if a pass lasts more than a fraction of a second. If a pass fails, keep the last overlay; the user may retake.
Mask work runs in the worker. The last good overlay stays visible while a pass runs. Show a busy mark only if a pass lasts more than a fraction of a second. If a pass fails, keep the last overlay; the user may retake.
Approve is blocked when the mask has no slab pixels. User retakes.
User approves the mask when only the slab remains. That mask is the footprint for Length axis, measurements, and the inventory PNG.