★ TouchArcade needs your help. Click here to support us on Patreon.

Eye tracking code for iPhone and Android

09-12-2015, 10:02 PM
#1
Joined: Nov 2014
Location: China / Canadian
Posts: 605
Send a message via Skype™ to 1stSPIN
Eye tracking code for iPhone and Android

I need some help to find information how to incorporate eye tracking code in a game. We want to track where the player is looking.
09-13-2015, 01:17 AM
#2
Joined: Aug 2013
Posts: 1,065
This isn't trivial so a few lines of code won't cut it.

This plugin does it well http://www.faceshift.com/#1 and even has a unity wrapper.

If you are looking to code yourself I reckon he limiting factor will be he camera on the phone. I have a 6+ and even taking a frame of he live video isn't that great and would hard to image processing around the eye.

Unless you are planning to put a lot of effort and time into this I would look for a plugin and then you need to expect it won't work all the time and have a backup plan for when tracking is lost. Part of the issue of holding a phone is it moves a lot as you play. Also your eyes don't move as much as you think so it could end up very jittery in a lot of implementations.

Please follow me on twitter @JamesDestined I post lots of development from both my game creation and professional development.
Time to measure - Brain challenge https://itunes.apple.com/us/app/time...820864672?mt=8
The light box, can you solve it (free) (on google play too)
https://itunes.apple.com/us/app/the-...6300?ls=1&mt=8

09-13-2015, 11:20 PM
#3
Joined: Nov 2014
Location: China / Canadian
Posts: 605
Send a message via Skype™ to 1stSPIN
Thank you. The demo is very interesting. But I am looking for eye tracking. Open source software that tracks the direction you are looking in.
09-13-2015, 11:37 PM
#4
So you really think a few "open-source" lines of code can track where a user is looking at?
09-14-2015, 12:48 AM
#5
Joined: Nov 2014
Location: China / Canadian
Posts: 605
Send a message via Skype™ to 1stSPIN
Quote:
Originally Posted by SpiritBomb Studios View Post
So you really think a few "open-source" lines of code can track where a user is looking at?
I am sure there is very complex code which has to pick up the data from the front video, detect the eyes and then the pupils then have a test screen that has a dot moving tp different positions on the screen and record the data. Then it will be fairly accurate and can be used for various applications.
09-14-2015, 02:19 AM
#6
If you want the easy way, wait for Apple to implement this into iOS SDK
http://appleinsider.com/articles/15/...os-mac-devices

AFAIK, all existing solutions that work accurately enough require some special hardware (like glasses), and they are just not free.
09-14-2015, 10:43 PM
#7
Joined: Nov 2014
Location: China / Canadian
Posts: 605
Send a message via Skype™ to 1stSPIN
Umove has developed some software that allows your phone to be all the hardware you need. The program I am sure is complex but the method is easy. All you need to do is connect with your front camera, pickup the data of the users face, especially the eyes. Then put up on the screen different positions and pickup the eye movement and you have all that is needed to know where the users is looking on the screen. It may not be a 100% accurate but it is a good start.
09-15-2015, 03:39 AM
#8
Joined: Aug 2013
Posts: 1,065
link for those interested
http://umoove.me/technology.html

doesn't seem to be available to developers yet.

Please follow me on twitter @JamesDestined I post lots of development from both my game creation and professional development.
Time to measure - Brain challenge https://itunes.apple.com/us/app/time...820864672?mt=8
The light box, can you solve it (free) (on google play too)
https://itunes.apple.com/us/app/the-...6300?ls=1&mt=8

Last edited by Destined; 09-15-2015 at 03:43 AM.
09-15-2015, 07:28 AM
#9
Joined: Nov 2014
Location: China / Canadian
Posts: 605
Send a message via Skype™ to 1stSPIN
I think your right. The method looks simple, not sure if the coding is that hard.
09-15-2015, 04:27 PM
#10
Joined: Aug 2013
Posts: 1,065
Quote:
Originally Posted by 1stSPIN View Post
I think your right. The method looks simple, not sure if the coding is that hard.
A good API always looks simple. It also depends on if it is reliable. It is easy to make something work with a known set of conditions. When you open it to the world you start to see how limited it actually can be.

Please follow me on twitter @JamesDestined I post lots of development from both my game creation and professional development.
Time to measure - Brain challenge https://itunes.apple.com/us/app/time...820864672?mt=8
The light box, can you solve it (free) (on google play too)
https://itunes.apple.com/us/app/the-...6300?ls=1&mt=8