Sisay
Sisay

Reputation: 699

Difference between writing OpenCV for Android(Mobile devices) and writing openCV for Desktop Application(OpenCV 2.4.3 usingC++)

I was doing face detection and recognition project.I am about to finish the application which does detection and recognition. I want to make this application portable like a one that works on Mobile devices. I am new to writing codes using OpenCV on Androids. What is the difference between OpenCV codes for Android phones and OpenCV written for Desktop application using C++ on Visual Studio like VS 2010 with Open CV 2.4.3?(What is the difference between Codes between OpenCV on Android and OpenCV for Desktop.Do they both use the same language?) I am familiar with Android(basics) and true that Android applications are written with Java. And i read somewhere online that OpenCV native codes can be included to Android with Java Native Interface. I am a bit confused here that can i use the code i have written using C++ Open CV for my Android Application with out modification.If not what Kind of modification do i have to make on my face detection and recognition using C++ for Desktop to make it work for Android phones?

Upvotes: 1

Views: 2587

Answers (2)

Kumar Vaibhav
Kumar Vaibhav

Reputation: 71

I used OpenCV on Android using both Java and C++. From my experience, I can suggest to use Native C++ code for image processing application. C++ codes are more efficient and can give more identical result as compared to Java code.

Although OpenCV has the Java version also, but in the back-end, it is using Native code for running Java.

The speed of execution in Native code will be much high as compared to Java code.

Upvotes: 1

JonasVautherin
JonasVautherin

Reputation: 8033

First off, there exists an OpenCV4Android version of Android, with tutorials on how to use it.

Then, as you pointed out, you can code both in Java or C++ on Android. OpenCV4Android can be used in Java [1] or in C++ [2]. In your case, it would probably be more convenient to re-use your C++ code, using the Native Development Kit for Android. If you manage to use the NDK, you will be able to re-use your C++ code by calling it from your Android app.

Here are the few steps I would advise you to follow:

I hope it will help.

Upvotes: 6

Related Questions