Android Computer Vision JavaCV OpenCV FastCV comparison

Peter picture Peter · May 20, 2012 · Viewed 10.1k times · Source

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.

Answer

Hakan Serce picture Hakan Serce · May 29, 2012

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.