How to build FaceDetection example on AndroidStudio

asked 2016-04-19 11:34:22 -0500

dariocanto gravatar image

We are trying to learn how to use opencv, and to do so we would like to fiddle with the FaceDetection sample that comes with it. But we haven't been able to build it, as we have had a plethora of errors.

First, I built a new proyect, and followed all steps posted here:

Then, I copied all files inside the FaceDetection folder to the project in the folders they should go (res on src/main/res, src on the project package, jni on jni... etc). Then, I change any project specific value, like package names, and press build gradle.

This works with most apps, but here it gives me some erros. First, it says the ndk is deprecated, and then I should either use an experimental one, o turn the "useDeprecatedNdk=true". A new ndk doesn't fix the error, and the second option gives new errors on its own, specifically with DetectionBasedTracker_jni.cpp, as those includes are never, ever found.

Obviously, we are doing something wrong with the whole thing, ndk and all, so we are desperated. How can we make this thing run? We downloaded OpenCV 3.1.0, are using AndroidStudio on Ubuntu, SDK 23. We would be evergrateful if someone helped us, we are completely lost.

edit retag flag offensive close merge delete