Giter VIP home page Giter VIP logo

pythoneyedetection's Introduction

Python Eye Detection

This is my simple and hackish eye/retina/pupil detector.

Disclaimer: I have absolutely no formal training or education in computer vision, and this is my first project to do anything of the sort. There is probably a lot to be improved upon here.

Operation is simple. Plug in a webcam and run python eye_detect.py. It will show the webcam image. If it sees your iris, it will superimpose a blue dot over it. It will also show (in a box in the upper left) what it thinks your eye is. It will show in another box to the upper slightly-less-left if it thinks it sees a pupil or an iris, and where it thinks the pupil (green) and iris (blue) are (at 2x magnification). If it thinks it sees a sensible pupil/iris combo, it will save a picture with a date stamp in the running directory. Go to the GUI window and push any key to exit (or control-c in the terminal).

Be sure to bring your eye pretty close to the camera, and to be well-lit.

It uses OpenCV cv2 (which uses numpy) to do all the matrix math, camera, and display stuff.

It's not very well-structured (I wrote this just for fun), but it works surprisingly well. On my computer, it captures a few good iris shots every second, and a decent number of them are very accurate in terms of delineating the iris and pupil boundaries. I'm not sure which eyes this will work with. I doubt it will work with very dark or very light irises.

Unfortunately, due to the hackish nature of this program, it will probably only work out of the box on webcams with a similar resolution to mine. If you want it to work on a different resolution (or angle) camera, you will have to tweak it.

pythoneyedetection's People

Contributors

wyager avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pythoneyedetection's Issues

Program eye_detect.py exits

root@beaglebone:~/Project/PythonEyeDetection# python eye_detect.py
Xlib: extension "RANDR" missing on display ":1".
Traceback (most recent call last):
File "eye_detect.py", line 147, in
main()
File "eye_detect.py", line 138, in main
finished, iris_pic = draw(photo)
File "eye_detect.py", line 122, in draw
image_to_show[0:iris_circles_to_show.shape[0], 200:200+iris_circles_to_show.shape[1]] = iris_circles_to_show
ValueError: operands could not be broadcast together with shapes (240,120,3) (240,240,3)

What was the resolution of the camera you used when testing? I am testing with 320x240 and 640x480 resolutions.

version of open cv

What version of open cv did you use?

Look like the version used in the repository is way out of date :)

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.