Reputation: 11895
I have downloaded OpenCV-2.4.8-android-sdk and android-ndk-r9c. I followed a tutorial by Stanford university, which tells me to import all sample projects from the OpenCV SDK directory and then everything will work magically.
Obviously, that is not the case. Below is a screenshot of one of the sample projects (and its build path) that I imported to Eclipse:
Do you know of a valid and recent tutorial to make the OpenCV samples running?
I checked the tutorial on OpenCV website but it does not describe how to get the samples running. In particular, I am confused about these:
2) I can see that I am missing all android.*
and org.opencv.android.*
imports. Do I need to manually include these to the build paths of the projects?
3) Where does the Android NDK go in this process?
4) There is no ./jni/Andorid.mk
file in any of the projects. Do I have to manually add these?
Upvotes: 0
Views: 2999
Reputation: 13
You should follow these steps:
After that the error for the specific example should be gone.
Upvotes: 1
Reputation: 8904
Right click each sample project folder > Properties > Select Android from the left list of options:
1) Check if you have something for "Project Build target" (example: "Android 4.4.2").
2) Check if you have something in the "library" box and if it does not have a red X next to its path. If it has a red X, edit to select the correct path to where you placed the opencv library.
Also do step (1) for the Opencv Library project, if you imported it to your workspace like it is described in the installation tutorial.
Upvotes: 2
Reputation: 11895
The steps explained in the Android Development with OpenCV article helped me solve the problem:
Do take caution in using outdated tutorials on the web. In my case, the Stanford university tutorial was outdated and was therefore misleading.
Look for documents dated 2012-2013 when you are dealing with OpenCV.
Upvotes: 1