Re: using OpenCV4Android 2.4.9, "The import org.opencv.android cannot be resolved"

4,198 views
Skip to first unread message

Andrey Pavlenko

unread,
Dec 14, 2012, 2:42:27 AM12/14/12
to android...@googlegroups.com
Did you run 'make install' to get a kind of SDK in the <build>/install folder?
Did you tried 'Fix project properties' for the OpenCV library project?
I would also suggest you use '2.4' git branch, not 'master'.

Andrey Pavlenko

unread,
Dec 17, 2012, 7:05:45 AM12/17/12
to android...@googlegroups.com
When you build OpenCV for Android you'd better use the command:

sh ./scripts/cmake_android.sh -DINSTALL_ANDROID_EXAMPLES=ON
cd build
make
-j8  install/strip

then you'll have build/install folder containing OpenCV4Android SDK structured files. This doesn't affect your host (Linux) system libraries.

What you call the `OpenCV4Android 2.4.9` is just one of the revisions of OpenCV 'master' branch. I suggest you use '2.4' branch instead of 'master' (aka 2.4.9) unless you're going to submit a pull-request to OpenCV 2.5.

Alexander Smorkalov

unread,
Dec 18, 2012, 2:28:22 AM12/18/12
to android...@googlegroups.com
Sources for all OpenCV versions are tagged by git. You need clone OpenCV git repo and then execute command "git checkout <opencv_version>" to checkout source code for exact release, i.e. "git checkout 2.4.2" for 2.4.2 release.
Also you can download source code archive from Github mirror. Github creates archives with all tags automatically.

Andrey Pavlenko

unread,
Dec 18, 2012, 3:11:17 AM12/18/12
to android...@googlegroups.com
I am just curious, why the instruction does not mention it, if it is necessary?
Looks like the instructions is a bit outdated, which one did you use?

Since OpenCV-2.4.2-android-sdk has been built, I need to find one with source code. However, from the website, there is only one instruction to git clone it, and it is `OpenCV4Android 2.4.9. Would you advise me where I could find other ones (not built)
The OpenCV git repository contains all the active branches, use `git checkout 2.4` command to switch to the '2.4' branch or like Alexander noted `git checkout <versions>` to the tag of the particular release.

Reply all
Reply to author
Forward
0 new messages