I tried using QPython, but had difficulties in installing numpy, let alone OpenCV . Is there anyway I can run my OpenCV code on android? I have read this answer, Is there a way to run Python on Android? , however, I need to know if OpenCV is supported in particular. If not, is it possible to run it on a rooted android phone?
Related
I have a complicated image processing script that runs in python with Numpy and OpenCV.
I want to run this script in Android but I couldn't find a way to do it.
After some research I found some frameworks that may help but I have some problems with them:
Kivy only generates full APK, but what I need is an AAR or some background service so I could use it from other apps
QPython only runs scripts, I didn't find a way to communicate with it from my app
cxfreeze I've tried to generate executable out of my script and then running it from my app, but I couldn't find a way to compile my script to an ARM processor so Android would be able to execute it
I will be happy to hear some ideas on how to run this script in Android.
Is it possible to maybe root the device and install Python, Numpy and OpenCV?
The best solution for me was using steveliles's OpenCv for Android and converting the Python scripts to Java. Turns out opencv had all the mat calculation functions I needed
Another solution would be using chroot:
https://technohackerblog.blogspot.co.il/2016/07/running-arch-linux-in-chroot-on-android.html
I would give a try to Kivy Launcher
you'll have to build it with opencv and numpy support
please see: How to run OpenCV in Kivy Launcher? for details on that.
after the first build you'll have an app that can run your script and you won't have to generate the APK again, just change the script :)
Another option is https://termux.com, but you'll have a bit of hard time getting cv2 to work on it.
I need to have some code to do some image processing in an existing Android app written in java. Currently my code is written in Python with OpenCV, and running on a PC.
Now I need it too run in the said app too.
I tried running it via sl4a with py4a, which for simple python scripts is OK, but I need to use OpenCV, and couldn't figure how to format it for py4a. (Any idea how to do this?)
What are my options for running Python code using OpenCV inside of an existing Java Android app?
I have a monitoring application that can be used to monitor devices using android. I currently have the code in python that I run from windows via ADB and get the results on windows in a CSV file.
I would like to create an android project that would behave as described above (an APK, in Java on eclipse), so I can run it without using ADB.
Is there a possibility that I can include the existing python code and call the methods from the old code (after installing the apk on an android device)?
Despite my online research - I could not get appropriate results. Can someone help me out here?
Thank you.
Did you check SL4A and Py4A ?
http://code.google.com/p/python-for-android/
You may check QPython too.
I am trying to develop my first OCR app using tesseract. I'm developing under Windows XP using Eclipse and targeting Android 2.1+
do i need cygwin?
do i need the android ndk?
--->Through vast research and consultation, I realize that you dont need cygwin or ndk either. But still, the code and procedure on Gautams blog gives error. I tried building the app and ended but with an application package file that does nothing but force closes when I press the "OCR!" button on the app. Any idea??
No, you do not need Cygwin.
Yes, you need to have the Android NDK installed.
Gautam's tutorial is the best tutorial for using Tesseract OCR on Android.
In order to develop an Android app using Python, I need to install Python for Android and SL4A on my computer to be used with the Android emulator. My question is, when I distribute this app to actual users/phones, do the phones need to get Python for Android and SL4A explicitly? Or is the supporting infrastructure built into Android devices? Or is there a way to package the Python application where the users do not have to get SL4A and Python for Android in order to run the application?
Instructions on redistributing your script to run on devices other than your development one are here:
http://code.google.com/p/android-scripting/wiki/SharingScripts
You can wrap them in a template project and build a stand alone apk.
Your users have to install SL4A and the language plugin (python?) on their phones, this is not a built-in functionality.
Since the source code is available, it's possible to create combined application, which includes your scripts and SL4A/python code, but in my opinion this defies the purpose of scripting in the first place.