FangGet/ORB_SLAM2_Android

How to generate yaml & voc file?

Naylor95023 opened this issue · 10 comments

Hi, I'm a novice in this aspect.

I found TUM's dataset source Web:
http://vision.in.tum.de/data/datasets/rgbd-dataset

but I don't know how to build yaml & voc file,
and calibrate my cellphone camera, automatically generate the necessary files.

please help me ~~~thank you very much!!!
hope this problem won't be too idiot...

this is my email : naylor95023@gmail.com

1.yaml is a configuration file with camera parameters and other param like SIFT pyramid 。you can generate this file referred to provided TUMX.yaml inside the origin project.
2.As for voc file, It's also provided inside the origin project, if you'd like to generate your own voc file ,it may relate to ML.
3.To calibrate your cell phone ,you can download opencv android sdk and it's attachment where some calibration apk will be there.

FangGet - What do you mean by origin project. Are you referring to the original ORB_SLAM2 cpp project or some other thing. How did you calibrate your phone camera to run the apk?

I got the code built locally on my machine and got it deployed into the phone and tested it out. It works to some extent. Very laggy running at maybe 1 or 2 frames per sec.

@aivijay can you share the method to run this program?
I meet some problems by using eclipse.
Thank you!

Anyone want to build this project with eclipse needs to: download opencv4android and set it as reference library of course, download android NDK and deploy it to eclipse preference (window->preference->Android->NDK) (I use NDK r10, r11 somehow will stuck the project at building, I don't know why, I use updated eclipse neon), change the include directory of OpenCV.mk in jin's Android.mk file to your specific location, for me it is include E:/AndroidWorkSpace/OpenCV-2.4.9-android-sdk/sdk/native/jni/OpenCV.mk, and you should be able to build it successfully. To clear the syntax errors in eclipse editor, try follow this firstly (http://stackoverflow.com/questions/23122934/eclipse-adt-unresolved-inclusion-jni-h) and after this add related include directory to C/C++ general's path and symbols about NDK related files and opencv4android \sdk\native\jni\include directory, it will clear most of syntax errors, but I was not be able to clear all errors in editor. Note that the syntax errors in editor won't prohibit it from successfully building, it just means the editor can not parse the symbol. If you still can not understand this, try to read basic knowledge of Android NDK from google developer, Introduction to opencv4android setting in official opencv site and always refer to stackoverflow if you get any error.
P.S. import this project into workspace firstly, then opencv4android, and then set the reference correctly. If get opencv4android firstly, then the building will stuck at building workspace forever. Still I have not looked into eclipse stack dump to inverstigate the cause, but I guess it should be related to too much c++ dependency for index to search.

@aivijay have you already collected calibration info using opencv sample apks? if so, plz tell me in detail, thank you very much! i downloaded opencv3.1_android and install camera_calibartion_apl in my phone and it works, but i found it cannot provide persistence operation, that's confusing.

@eugenelyj I've collected output of the opencv camera_calibartion app in Android Studio's android monitor having logs filtered by "OCVSample::CalibrationResult" TAG:

I/OCVSample::CalibrationResult: Saved camera matrix: [1060.734674682828, 0, 639.5;
                                                                                                    0, 1060.734674682828, 359.5;
                                                                                                    0, 0, 1]
 I/OCVSample::CalibrationResult: Saved distortion coefficients: [0.02264976840468223;
                                                                                                    0.906495922558728;
                                                                                                    0;
                                                                                                    0;
                                                                                                    -3.78455027321318]

And I've constructed .yaml file by following this instruction: https://stackoverflow.com/questions/23397583/writing-camera-matrix-into-xml-yaml-file
Though I don't know if it worked cause I had no luck running slam after all)0)

I have tested the app with that file:

Asus.yaml

May be you are missing some parameters,

Best

@bouviervj is this one for RGB-D cameras? With what tool have you got it? Or have you filled it out manually?

This a file I found exactly where it points ;-)
Then if you do the calibration with opencv, you can replace your values for the camera in the file, appart from the specifics for the algorithm, i.e below "# ORB Parameters" .

*update: mono camera RGB