Heribert
Heribert

Reputation: 613

Developing and testing an OpenCV application on desktop which should later run on Android

I want to build an Android application using openCV and tesseract. For this I set up an Android project with openCV4android and tesseract as libraries and am able to run it on android devices.

As the application became more powerful the build and deployment times increased significantly (about 5 minutes). Since I want to test alternatives, select the most suitable parameters, evaluate different approaches, etc. this is definitively too long for proper developement.

So it would be nice to develop and test the whole cv part on my desktop with images captured by the phone in order to build faster and have better debugging possibilities. How can this be achieved?

Options I found so far:

  1. Develop in C++, use Android NDK in the end to port it to the application

    Advantage: less overhead so it is faster

    Disadvantage: I would need to port my openCV4android code to C++ first

  2. Use an OpenCV Java implementation

    E.g. http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html or JavaCV.

    But I do not know if these java wrappers are easily compatible with openCV4Android

Are there other approaches? What would you recommend?

Thank you in advance

Upvotes: 3

Views: 240

Answers (2)

Heribert
Heribert

Reputation: 613

In case someone else is interested:

I decided to use C++ and the Android NDK. It took me a while to get to know the Android NDK, but since I am able to run my C++ code on Android I am happy with that decision.

Upvotes: 0

sonic
sonic

Reputation: 1904

I think you miss some point in your reflexion about C++ and NDK.

Did you want to build a library based on OpenCV that you will use for an android app but also for other platform ? If so, you should write your library in C++ and add some java wrapper for android use. Then if one day you decide to use your library to do an iOS app, you will have a less painfull job to do.

I don't know about OpenCV Java implementation, so i can not add anything to what you said.

Upvotes: 1

Related Questions