ORB-SLAM2-based-AR-on-Android icon indicating copy to clipboard operation
ORB-SLAM2-based-AR-on-Android copied to clipboard

How to compile it in android studio?

Open kolanski opened this issue 6 years ago • 5 comments

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

kolanski avatar Apr 24 '18 08:04 kolanski

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.

muziyongshixin avatar Apr 24 '18 08:04 muziyongshixin

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.

unanan avatar Dec 21 '18 07:12 unanan

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

lldavuull avatar Feb 28 '20 11:02 lldavuull

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?

NCHUPJ avatar Jul 14 '21 03:07 NCHUPJ

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.

maximaging avatar Oct 08 '21 09:10 maximaging