Mano Haran
Mano Haran

Reputation: 649

Difference Between opencv and Android opencv

I have been wondering if it is possible to use all the functions of opencv in android opencv. I am planning to do my PG project in android Open CV. Because i am familiar with android but not opencv. Is it possible to implement all the functions used in opencv (windows) to Android opencv?

Upvotes: 2

Views: 2145

Answers (2)

Vitt Volt
Vitt Volt

Reputation: 337

Yes it is definitely possible to use all funtions in OpneCV on Android. But you have to note that OpenCV4Android includes 2 parts: the Java part and the native part.

In fact the Java part provides most of the functions of the OpenCV library. If you would like to have access to more functionalities and faster speed, then just go for native development. The .so library in the OpenCV SDK pack provides all native functions. In fact if you are familiar with native development, you could even directly use the OpenCV c++ library, just like how people use FFMPEG on android.

Upvotes: 2

bikz05
bikz05

Reputation: 1605

Unfortunately, Java API doesn't provide access to all the functions as in the case of C++ API. First, I will discuss what all the toolkits that are needed for doing so and then how can we use the native(C / C++) in Android.

Toolkits Needed

To develop Android apps using OpenCV Library, we need the following tools (all of these are either Open Source or free software, or both) -

  1. Eclipse with ADT Bundle (You can choose any other IDE like Android Studio)
  2. OpenCV4Android (although, you can compile from source code, it is recommended for novice users to download the binaries.)
  3. CygWin (Only for Windows, not needed on Linux or Mac)
  4. Java JDK (JRE would not be sufficient)
  5. Android Native Development Toolkit (NDK) (needed to run native C/C++ code)

You will need to set environment variables on your OS for the tools to correctly configure.

Alternatively, nVidia also provides a suite of developing tools — TADP. The advantage of TADP over the piece-by-piece method is that you don’t need to follow the often perplexing task of setting up the development environment. The default installation will download a lot of superfluous packages that are not needed (The download size can be greater than 2GB and on slow internet connections, it can turn into a prolonged activity.), rather select the packages manually at the time of download (A dialog box will appear, asking you to select either Complete, Custom or Manually.)

Using C/C++ code in Android

You can get access to native C/ C++ functionality in Android by

  1. Here is the official OpenCV tutorial on setting up .
  2. Also, Check out the Mixed Processing Sample in the Samples folder of Android4OpenCV folder. This example shows how you can pass an image and its grayscale equivalent to a native function and detect features on the image using FAST features detection.

Useful books and tutorials

There is not much study material right now, but I guess these 2 source are the best -

  1. Android Application Programming with OpenCV by Packt Publishing.

  2. Sample programs in the OpenCV4Android folder.

Upvotes: 4

Related Questions