Inspiration

Millions of donated corrective lenses sit unused in medical deserts simply because they don't fit standard, mass-produced frames, especially when a patient needs two completely different lens shapes. We wanted to fix this without relying on expensive optical machinery. OptiFrame lets anyone with a smartphone digitize a lens in the field and 3D print a custom frame for pennies, giving second-hand glasses a new life.

What it does

OptiFrame lets users scan a lens using their phone, automatically detect its shape and dimensions, and generate a custom 3D-printable frame. The goal is to give old donated lenses a second life without expensive optical equipment.

How we built it

We built a mobile-first web app using TypeScript and Vite. Capture: We use the HTML5 Camera API and ArUco markers to guide the user during scanning. Vision: We use the markers to calculate a homography and correct perspective distortion. Segmentation: An AI segmentation model detects the lens outline, even with reflections and difficult lighting. 3D Generation: We turn the detected outline into a 3D frame, add a small offset for the lens fit, connect the two sides, and export an STL file for 3D printing.

Challenges we ran into

The biggest challenge was detecting transparent lenses. Normal OpenCV edge detection struggled with reflections and shadows, so we moved to AI-based segmentation. We also had to deal with perspective distortion from the phone camera and performance issues when running computer vision and 3D rendering directly in a mobile browser.

Accomplishments that we're proud of

We're proud that we were able to build the full pipeline from scanning a real lens to generating a printable 3D frame. Getting computer vision, AI segmentation, and 3D generation to work together in a mobile browser was especially rewarding.

What we learned

We learned a lot about combining computer vision with real-world hardware constraints. More importantly, we learned that something that works perfectly in a controlled environment can behave very differently on an actual phone, so testing in real conditions was really important.

What's next for SaraVision

Next, we want to improve the segmentation accuracy, make the scanning process more reliable across different phones and lighting conditions, and test the generated frames with more real lenses. We'd also like to make the frame designs more customizable and easier to print.

Built With

Share this project:

Updates

Submission history