Menu

One camera for QR codes and receipts with Apple Vision
📰

One camera for QR codes and receipts with Apple Vision

DEV Community: ios·Odd Eggs Studio·1 day ago
#eaGzkSrg
#devtoios#devto#dev#receipt#corners
Reading 0:00
15s threshold

6pm's Scan runs one AVCaptureSession with three outputs: the system metadata reader for QR codes, a video feed that Vision searches for paper ten times a second, and a photo output. A receipt held still for 0.9 s is taken, squared up with CIPerspectiveCorrection , and read on the phone. Only an unsure reading sends the photo, once.

The code is in apps/mobile/modules/scan-camera (a local Expo module, Swift and Kotlin) and packages/domain/src/capture (the receipt parser, TypeScript). The repo is Apache 2.0.

The product constraint

Scan has one job per moment: at a counter you want the QR read instantly; at home with a crumpled receipt you want it found, cut out and read. Two modes with a switch would be simpler to build. It would also mean a choice at the till.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.