Augmented Reality with Cordova, javascript

7.2k views Asked by At

I'm currently working on a project which consists to developing an application that allows us to visualize geolocated elements by using the camera device. So I have to implement an augmented reality based on geolocations services.

I have to fully develop this application with javascript/cordova including plugins. I don't have to modify things directly in the native code, only by using the cordova specifications.

I've made some research and I've found 3 things.

1) Wikitude: plugin for cordova, perfect for this kind of implementation. The only big problem: it is not free! Actually I'm developing not for myself but for a start-up so this is not applicable. Maybe there is a way to use completely wikitude without the "trial" text in the middle of the screen, but I didn't find it.

2) Intel XDK: the main problem here is that we have to install a new software that allows us to use the functionalities of the api and this is not very convenient if I want only use javascript/cordova. Moreover, the demos don't work for me (maybe a wrong manipulation)

3) Simulate video background by capturing the image from the camera every ms approximately (maybe every cs) and continusly update the canvas in the background (works like a film actually if we want). Problem: I don't know how to apply it without accessing the camera device. And this takes a lof of resource and the reactivity is, I think, really reduced.

Well, I really want to find a way to implement this augmented reality. Actually the main problem is to display the camera preview in the background.

So if you have any ideas, suggestions, FREE, it would be very helpful.

Thank you!

2

There are 2 answers

1
wbt11a On BEST ANSWER

I can pretty much guarantee what youre asking for will require writing your own plugins for Phonegap / Cordova.

Check out http://web.stanford.edu/class/ee368/Android/index.html . While that page is primarily concerned with document capture, the code examples demonstrate opening the camera and providing a real time overlay. This sounds like what you want and the code is available for modification.

Once you finish that, you can check out http://devgirl.org/2013/09/17/how-to-write-a-phonegap-3-0-plugin-for-android/ or http://docs.phonegap.com/en/3.5.0/guide_hybrid_plugins_index.md.html for how to create plugins.

I know it's not the answer you wanted to hear, but I hope it helps.

0
Wayne Parrott On

For #3 see the new ezAR Cordova plugin (free) http://ezartech.com which provides a camera view for rendering a live video feed under the Cordova WebView.