muziyongshixin / ORB-SLAM2-based-AR-on-Android

This is a Android Augmented Reality APP based on ORB-SLAM2 and OpenGL,which can work well on both outdoor and indoor environments
216 stars 84 forks source link

How to compile it in android studio? #1

Open kolanski opened 6 years ago

kolanski commented 6 years ago

I get opencv2/core/core.hpp: No such file or directory error for dbow

muziyongshixin commented 6 years ago

Do you get the error when compile?or when run it on the phone? I forget some configuration file before , so you may get some errors when run the APP, I will update the profile soon. But if you get this when compile, may be there is something wrong with your environment or your opencv version is incorrect. I am not really sure.

unanan commented 5 years ago

Hi, @muziyongshixin In my Android Studio, it is built failed with errors like:

../../../../src/main/cpp\Eigen/Core:84:20: error: expected value in expression
#if EIGEN_COMP_MSVC
                   ^

Do you know how to deal with it? Thx in advance.

lldavuull commented 4 years ago

opencv2 is not included in the code. you can download opencv-3.2.0-android-sdk.zip https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.2.0/

put the folder (opencv2 folder) OpenCV-android-sdk\sdk\native\jni\include into app\src\main\cpp

NCHUPJ commented 3 years ago

opencv2 is not included in the code. you can download opencv-3.2.0-android-sdk.zip https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.2.0/

put the folder (opencv2 folder) OpenCV-android-sdk\sdk\native\jni\include into app\src\main\cpp Did you install OpenCV4Androi?

maximaging commented 2 years ago

Hi @NCHUPJ , in case you are still interested, I addressed the compilation issues related to OpenCV 3.2.0 on my fork and submitted a pull request with all the changes: https://github.com/muziyongshixin/ORB-SLAM2-based-AR-on-Android/pull/16. In fact, I updated the project to make it supported with the all recent Android Studio requirements, here is my fork: https://github.com/maximaging/ORB-SLAM2-based-AR-on-Android. And, I also shared my OpenCV 3.2.0 prebuilts (as static libraries) for NDK 21 Android LLVM C++ compiler with the instructions for integrating it with a Android project: https://github.com/maximaging/opencv-3.2.0-android-prebuilts.