Files
SlabUploader/docs/CAPTURE.md
T

1.7 KiB
Raw Blame History

Capture

Client-side. Phone and PC. This is the hard part of Slice 1.

Goal

Isolate just the slab, with quick visual feedback, then produce:

  1. A uniform inventory PNG for the product page
  2. Filterable sizes and board feet from that reference photo

The user’s eye on the overlay is the quality gate. There is no confidence score on the mask.

Controls (Slice 1)

  • Sheet: Auto / Green / Black, only if the background is not obvious
  • One sensitivity slider
  • Overlay on the source photo, live as the slider moves
  • No Apply button, no server round-trip to tune the cut

If the edge is still wrong after the slider, retake. Extra sliders (edge offset, feather, and so on) are a fallback after real slabs prove one control is not enough. Do not ship four sliders up front.

After the user approves the edge

Then — and only then — run the rest on the client:

  • Length axis from the mask; user can rotate / confirm if it is skewed
  • User length L (inches, 1/8") is the scale: scale = longest_axis_px / L
  • Width samples every 6" along that axis (min / max / avg for the listing, not for bdft)
  • sqft = (mask_pixels / scale²) / 144 (2 decimals)
  • bdft = sqft × thickness_in (2 decimals). Identity: 1 sqft at 1" = 1 bdft
  • Inventory PNG: transparent, 3:4 portrait, slab centered, 80% fill at the extremes, shorter side ≥ 1600px when the source allows
  • Undersized source: warn and require retake

User-entered length, thickness, SKU, and price always win over computed values.

Proof for this file

On a real phone, after Approve, the processed PNG and the numbers appear. If Approve does nothing, capture is not done.

Algorithm detail and test vectors: docs/archive/TECH-SPEC-PIPELINE.md (history). Live behavior is this file.