Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Computer Vision JavaCV OpenCV FastCV comparison

I am working on school project and part of it should be about current situation about computer vision libraries for Android. I went to it with large enthusiasm because computer vision seems like fascinating subject but I have been searching for more then a week and I did not find much. I would like to be able to provide information about libraries themselves and about comparison between them.

I will share what I found so far.

OpenCV

  • seems like the most advanced one and the most popular.

  • provide the biggest number of functions

  • it had problem with backward compatibility

  • is fast(at least so I heard but I have zero information about it)

  • does have biggest amount of books about it(at least for C++ version)

JavaCV

  • is wrapper for few other libraries including opencv

FastCv

  • new with Qualcomm behind it.

Wikitude

  • this is more for augmentedreality but in its core is still computer vision.

As you can see I have a little information about it and doing my own tests for every library is far beyond my current computer vision skills.

Kind regards, Peter.

like image 733
Peter Avatar asked May 20 '12 11:05

Peter


3 Answers

Basically there are two options: OpenCV and FastCV

OpenCV is a more mature library with a lot more functionality than FastCV. For many computer vision tasks you can find only the most basic functionality in FastCV, whereas you can have almost all popular alternatives available in OpenCV. Check the available feature detectors for instance. OpenCV has Harris, SURF, SIFT, FAST, etc. FastCV, on the other hand, has only Harris and FAST. OpenCV contains hardware optimizations for different HW including desktop computers and mobile computing devices. The ability to use OpenCV in desktop provides you a more flexible development option, as you can tweak and test the code on a fast desktop computer before you start working the mobile development. Also OpenCV is considered as part of a Khronos Computer Vision Group Proposal. So, if this gets approved OpenCV can become the standard API for computer vision. As far as I can see, FastCV provides superior optimizations for Snapdragon CPUs. This might play an important role in the decision in the short term, but I'm sure OpenCV will close the gap very fast, if any.

If you choose the OpenCV path, then there are two sub-paths: OpenCV with Android NDK vs. JavaCV with Android SDK. JavaCV is a wrapper around OpenCV based on JavaCpp. JavaCV mostly wraps C API, although OpenCV provides an Object Oriented C++ API as well. The C++ API handles releasing of unused memory automatically, for instance. However, C API (hence JavaCV) requires you to handle releasing of unused imagery manually. Also when you face a problem in JavaCV, it is difficult to tackle the problem, because there are too many indirections to check. Problems are easier to locate when you use OpenCV directly. However, in case of Android, the added difficulty of NDK should not be forgotten.

If available OpenCV functionality is necesary for the specific application, and no custom pixel level processing code is needed, JavaCV is the way to go. However, if a considerable amount of custom image processing code is required, Java code will slow you down, and you will need to switch to NDK, anyway. In the latter case, OpenCV is the alternative to choose.

like image 184
Hakan Serce Avatar answered Oct 16 '22 20:10

Hakan Serce


I would use OpenCV as it is the best computer vision library right now. You'll program your functions in C++, and then you compile the Android aplication using the JNI library. You have information on how to do that on the official documentation.

I have worked with this configuration and OpenCV performance in android is really nice. You will notice benefits if you make some functions in fixed-point arithmetic. Good luck

like image 25
Jav_Rock Avatar answered Oct 16 '22 18:10

Jav_Rock


For a android based project, it is easy to start with JavaCV. It contain almost all the functions that are available on OpenCV.

But there are no rich documentation on JavaCV, but OpenCV has. So you can find the relevant methods from OpenCV documentation and use those in JavaCV(same method names).

There is a complete document at here. That is discuss about how to setup JavaCV on eclipse - android environment.

like image 5
Keshan De Silva Avatar answered Oct 16 '22 19:10

Keshan De Silva