Inspiration
Santé Numérique Sans Frontières reuses donated lenses. Each recycled lens has its own shape, so a frame must be made to fit it, with nothing more than a phone and a 3D printer.
What it does
The user places a lens on a printed template and takes a photo with the phone. The app finds the template, corrects the perspective, traces the outline of the lens, and reports its width, height and perimeter. From two outlines, which can be different, it generates a frame front with a groove, bridge and hinge blocks, and exports an STL file that prints without supports. Everything runs in the browser: the photos never leave the phone, and the app works offline after the first visit.
How we built it
- Template with six ArUco markers and a 100 mm control ruler, to correct printer scaling.
- Measurement: marker detection, sub-pixel corner refinement, robust homography, parallax correction, then a sharp-edge map that ignores soft shadows.
- AI: a small U-Net trained on 540 synthetic images (edge F1 of 0.905), run in the browser, then refined with the image gradient. The classic method is the automatic fallback.
- Frame: a closed mesh generated in the browser, with a 3D preview and a check that re-cuts the mesh and compares it with the outline.
Challenges we ran into
- A transparent lens is only visible by its thin bevel; hard shadows can be mistaken for the edge. The hybrid of AI and gradient refinement handles this best.
- Real photos. None of our real photos had all six markers of the template in view, so the main pipeline is validated on synthetic photos only. A fallback that uses a bank card as the scale reference works but is not repeatable enough (about ±9 mm on the width).
Accomplishments that we're proud of
- On the synthetic benchmark (88 scenes with tilt, shadows, glare, blur and noise), the default method has a mean error of 0.06 to 0.07 mm on width and height, and every scene is within 1 mm.
- No installation, no account, no server, no API key.
- A frame that can be checked against the measured outline before printing.
What we learned
- Lighting from behind (the sheet on a white laptop screen) removes shadows and makes the edge sharp.
- Combining a learned edge detector with a classic refinement is more accurate than either alone.
What's next for OptiFrame
- Real photos with the full template in view, measured against a caliper.
- Publication on HTTPS with a QR code, and tests on Android and iPhone.
- A printed frame with real lenses.
Built With
- aruco
- javascript
- onnx
- python
- three.js
Log in or sign up for Devpost to join the conversation.