(1)

Ubuntu 12.04 + Eclipse Juno + android-sdk + android-ndk-r8b

I followed the instruction to build the latest OpenCV4Android 2.4.9. During
the building, it doesn't show any errors, at least at the end.

Then I import it into Eclipse as a library.

However, there is a sign of incorrect on the icon of the project.

But I can not find where the errors are.


Anyway, try to use the library in an Android project.

I build an Android project.

In the Android project, one of the commands are:

import org.opencv.android.BaseLoaderCallback;

However, it presents an error:

"The import org.opencv.android cannot be resolved"

(2) If I use the downloaded OpenCV-2.4.2-android-sdk, it can works well.


Thanks in advance!

--

Search Discussions

  • Andrey Pavlenko at Dec 14, 2012 at 7:42 am
    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'.

    --
  • Linda Li at Dec 17, 2012 at 8:32 am
    Thanks a lot.

    (1) I tried "Fix project properties" for the OpenCV library project. Now
    the cross error sign disappear.
    However,

    In the Android project, one of the commands are:

    import org.opencv.android.BaseLoaderCallback;

    However, it presents an error:

    "The import org.opencv.android cannot be resolved"

    (2) >> Did you run 'make install' to get a kind of SDK in the
    <build>/install folder?

    I did not.

    The instruction says:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    export ANDROID_NDK=~/android-ndk-r8b
    export ANDROID_STANDALONE_TOOLCHAIN=~/android-toolchain
    cd opencv/android
    sh ./scripts/cmake_android.sh
    cd build
    make -j8
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -

    Did you mean I need to install OpenCV following the instruction under the
    OpenCV document?
    And then follow the instruction of OpenCV4Android?

    I have installed OpenCV2.4.2 on the Ubuntu.
    Personally I am just trying OpenCV4Android 2.4.9, so I prefer not to
    replace 2.4.2 with 2.4.9 in the system library.

    (3) >> I would also suggest you use '2.4' git branch, not 'master'.

    The reason I want to try OpenCV4Android 2.4.9 is that I want to change the
    code in imread, because there is limitation in memory for Android
    development.
    For example, I hope the imread function can read in a downsample way, or I
    read a value for each pixel based on its RGB.

    On Friday, December 14, 2012 1:42:27 AM UTC-6, Andrey Pavlenko wrote:

    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 at Dec 17, 2012 at 12:05 pm
    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.

    --
  • Linda Li at Dec 18, 2012 at 7:00 am
    Thank you very much.
    I will try the commands you mentioned.
    I am just curious, why the instruction does not mention it, if it is
    necessary?
    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. >>>
    >>>

    I need one that I can build from the source so that I can change some code.
    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)

    Thanks!

    On Monday, December 17, 2012 6:05:45 AM UTC-6, Andrey Pavlenko wrote:

    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 at Dec 18, 2012 at 7:28 am
    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<https://github.com/Itseez/opencv>.
    Github creates archives <https://github.com/Itseez/opencv/tags> with all
    tags automatically.

    --
  • Linda Li at Dec 19, 2012 at 7:25 am
    Thanks.
    On Tuesday, December 18, 2012 1:28:22 AM UTC-6, Alexander Smorkalov wrote:

    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<https://github.com/Itseez/opencv>.
    Github creates archives <https://github.com/Itseez/opencv/tags> with all
    tags automatically.
    --
  • Andrey Pavlenko at Dec 18, 2012 at 8:11 am

    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.

    --
  • Linda Li at Dec 19, 2012 at 7:13 am

    On Tuesday, December 18, 2012 2:11:17 AM UTC-6, Andrey Pavlenko wrote:
    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?
    This one.
    Building OpenCV4Android from trunk
    http://code.opencv.org/projects/opencv/wiki/Building_OpenCV4Android_from_trunk

    Then would you please provide me a correct one?



    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupandroid-opencv @
categoriesandroid
postedDec 14, '12 at 7:23a
activeDec 19, '12 at 7:25a
posts9
users3
websiteandroid.com

People

Translate

site design / logo © 2017 Grokbase