0

I'm developing an Android app and I have to use the openCV library. I was wondering if the openCV python sdk is equivalent to the openCV4Android? I already have some openCV code written in Python - everything that can be done using Python can also be accomplished with Java for Android?

Thanks.

Jeru Luke
  • 20,118
  • 13
  • 80
  • 87
Amir
  • 133
  • 3
  • 11

3 Answers3

1

Although I used OpenCV Java SDK for both Android and Java projects, I am not sure whether it supports all functionalities of python library. You can check which parts of the library is included in Java SDK from the documentation

If something is included but not have detailed description, you can check out c++/python equivalent for explanations.

unlut
  • 3,525
  • 2
  • 14
  • 23
1

OpenCVForAndroid usually only has the modules in the OpenCVMain repository:

If you want more than this, for example the OpenCV extra modules below, then you generally have to build from source. OpenCV extra modules

It is worth noting also that at the time of writing most of the official openCV Android documentation is based on using the Eclipse IDE, while most official Android documentation uses the newer Android Studio.

There are also two main ways to use OpenCV on Android - one is to use the Java SDK as you have noted and the other is to build your OpenCV functionality in c++ using the Android native NDE. The former is generally easier if the Java SDK covers the functionality you need.

I think it is fair to say that getting the latest release of OpenCV with the extra modules compiled and working with Android Studio is not trivial at this time - if you look on Stackoverflow you will see quite a few questions and discussions around this topic, for example look at this question and answers:

Mick
  • 24,231
  • 1
  • 54
  • 120
1

I'm planning to take a photo using the smartphone camera, then make some image processing. In case the Java SDK does not cover the functionality I need, a solution could also be sending the image to a remote server, do the processing (using Python) and send the processed image back to the application. Am I missing something? (of course I increase latency)

Amir
  • 133
  • 3
  • 11
  • 1
    Yes, if increase of delay is not a problem for you, that is a perfectly fine solution. – unlut Aug 14 '18 at 19:27