Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Python Android

Is it possible to code an Android application using the Python programming language with the OpenCV API?

I have coded an Android application using Python with the scripting layer for android (SL4A). Here is the website for SL4A:https://code.google.com/p/android-scripting/

However, using Python with the OpenCV API and the Android API is not something that I have done or read about when searching the Internet.

Python is so much more exciting than Java so I would rather use Python. It is more exciting because it is much more open-source and implicitly promotes more freedom.

like image 327
user_loser Avatar asked Oct 31 '22 11:10

user_loser


1 Answers

According to here:

there is sl4a / PythonForAndroid, unfortunately, it uses hardcoded java rmi invocations for anything os related. so - no opencv bindings there ;( i guess, you'll have to learn java.
-berak (Nov 20 '13)

Also, although further dated, this still open issue on github leads me to believe that there is still no Python-Android OpenCV implementation.

There is no camera implementation in Kivy right now. And we never said than opencv was available on python-for-android too.

But there is hope for the future:

I have a plan of writing a recipe for it, not now, currently I am quite overwhelmed by others ;-)
- ParokshaX (Jul 25, 2014)

QUIK EDIT:

Lol, there is a working implementation on the open issue, it just doesn't have a nice recipe:

Here I attach the Eclipse project I have made to build libcv2.so for Python on Android. It is a little bit messy because I really had a headache working it out, and I'm short on time right now. Just import it into Eclipse (I use ADT 22.0 and NDK r9c) and it should compile. I took libopencv_java.so into the project so it shall be a dependency. Also libpython2.7.so is a dependency too. If anyone can make this into a Python for Android recipe then that would be awesome.

like image 170
Dair Avatar answered Nov 04 '22 08:11

Dair