Fix touch input highlights and barcode camera focus
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 46s
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 46s
Remove field focus outlines. Preserve camera constraints across light and focus changes, fall back to one-shot autofocus, and offer supported manual focus, lens selection, and camera restart. Add scanner regression coverage.
This commit is contained in:
parent
40d9bc062b
commit
0ff7279cf6
5 changed files with 394 additions and 21 deletions
|
|
@ -35,6 +35,8 @@ The food sheet's **Quick entry** tab starts with **Scan barcode** and **Scan lab
|
|||
3. The server's copy of **Open Food Facts** (~3.4 million products worldwide, community-entered).
|
||||
4. The live Open Food Facts API, for products newer than the copies. Answers, including "not found", are cached on the server.
|
||||
|
||||
The scanner requests continuous autofocus when supported, with one-shot autofocus as a fallback. **Focus distance** appears only on cameras that expose manual lens control; adjusting it holds a fixed focus until you choose **Use autofocus** or restart. If the image stays blurry, move the package farther away, try **Restart camera**, or choose a different lens under **Camera** when multiple cameras are available. Browser and camera support determine which focus controls are available; the native **Take a photo instead** option remains available.
|
||||
|
||||
A find fills the form with the product's name, serving and every nutrient the source has: the seven tracked ones plus extras such as saturated fat, cholesterol, added sugars, vitamins and minerals, under **More nutrients**. **Save this food to my library** is pre-checked so the next scan is instant. When nothing is found, scan the label instead; the barcode stays attached to the food.
|
||||
|
||||
**Scan label** opens the iPhone camera app (full resolution, focus and flash, no permission prompt), or a file picker on desktop. The photo is downscaled on the device and read on the server with PaddleOCR PP-OCRv5 (server detection, English recognition) on ONNX Runtime, CPU only, typically in 1–3 seconds. A parser then pulls out the serving size and each nutrient, undoes common OCR confusions (O/0, l/1, a unit read as a digit), checks amounts against their printed %DV, and handles US/Canadian panels, linear labels, tilted photos, Spanish labels and EU "per 100 g" tables (salt → sodium). Values it found replace the form's values; check them against the package before saving. Fill the frame with the panel and keep it flat and sharp: curved containers and glare are the usual causes of misses.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue