Search code examples
androidopencvface-detection

Android API face detection vs. OpenCV/JavaCV face detection


I've used local Android face detection on an Android device, but it seems quite slow and I'm not so sure on the reliability. I've also used OpenCV's face detection but only on PC, as opposed to an Android device. For Android, I'm guessing I'll have to use JavaCV (or OpenCV4Android?).

Do you know what the speed differences are between Android API's facial detection and OpenCV's facial detection? I'm sure OpenCV/JavaCV is both more efficient/faster and more accurate, but cannot confirm.

Thanks!


Solution

  • Suggestion: If you are looking for face detection, I suggest you use platform specific APIs like FaceDetector rather than OpenCV Java wrapper. This is since those API's would be hardware accelerated(GPU) unlike OpenCV face detection which till version 3.0 relied on CPU only.

    The speed difference you perceive between desktop and mobile device should be for the difference in device hardware ( like CPU ) and not because of different libraries wrappers like JavaCV/OpenCV4Android. OpenCV is written is in C/C++. All processing intensive code is still in C/C++ and the Java libraries are just wrappers over JNI.

    1. OpenCV4Android - OpenCV.org maintained Android Java wrapper. Recommended.
    2. OpenCV Java - OpenCV.org maintained auto generated desktop Java wrapper.
    3. JavaCV - Popular Java wrapper maintained by independent developer(s). Not Android specific. This library might get out of sync with OpenCV newer versions.