Giter VIP home page Giter VIP logo

pupillary-distance-analyzer's Introduction

Pupillary Distance Analyzer

This is the result of a couple days of attempting to solve an old optical industry problem: get a person's interpupillary distance without any mechanical aide.

The goal was to have the only requirement of the person be that they stand still for a picture and face the camera as directly as possible. However, if you know much about the human eye, you know already that this does not have a happy ending.

Despite utilizing the OpenCV v2.1 library for C++, there were just too many unknowns for this to work. The entire algorithm was based on the so-called "fact" that the average person's iris is somewhere around 11.8mm, a fact told to me by my boss. Only later did I find out that this vital piece of information was extrapolated from a circa 2004 study that barely had enough samples to constitute a significant sample size in its own little suburb.

Combine this with the fact that a person's iris size also changes based on if they are focusing near or far (aka "infinity"), the margin of error going from pixels to millimeters was incredibly ridiculous if the person wasn't at the "sweet spot" distance from the camera, and camera itself had to be constantly calibrated to compensate for lens variations and whatnot, it was basically trying to solve a system of equations that had about 20 or so unknowns with one constant and that one constant was the sort of constant Bowser might give you in the middle of a round of Mario Party.

Eventualy this got outsourced to a man named Larry Kite, a PhD computer science graduate from USC specializing in computer vision and AI. Not only that, but he is given the "out" that measurements may be grounded by a physical object, i.e. the person must hold up something like a checkerboard pattern or something against their face so the program has something to compare distances against.

Dr. Kite is a very smart fellow, but I feel that had I been given the chance to use something like this comparative measurement technique, this project would have given me much less trouble. As it stands, though, if the program is able to detect a person's eyes (which is dependent on the image quality and the fact that I'm using a supplied Haar cascade file with OpenCV), the success rate is somewhere around 60%. Not bad for my first attempt at computer vision problem solving.

The code is a mess, but since I wrote it all in the span of two days with little intention of it ever going past a folder on my desktop, I'd say it's amazing there are event comments in there.

Dr. Larry Kite - http://www.linkedin.com/in/lawrencekite/
OpenCV - http://opencv.willowgarage.com/wiki/
L. Maisonobe's paper on finding the best circle that fits a set of points - http://www.spaceroots.org/documents/circle/circle-fitting.pdf

pupillary-distance-analyzer's People

Contributors

mockenoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.