I did this as a fun project a while back http://dittokey.com/ .
I open sourced the app:
https://github.com/andrewseddon/dittokey-iphone
and computer vision:
https://github.com/andrewseddon/keyify
No production ready, complete hack, but it does work. The vision side is an interesting problem. This was a while back and i was dealing with older cameras. I should imagine with modern phone cameras it's a pretty simple problem.