KAIST-VCLAB / EgocentricReconstruction

EgocentricReconstruction
Other
121 stars 17 forks source link

About openvslam and demo.json #16

Open Followmeczx opened 1 year ago

Followmeczx commented 1 year ago

In demo.json, "openvslam_path":"./openvslam/build/video_pose", "orb_path":"./openvslam/build/orb_vocab/" I use stella_vslam which created to continue active development of OpenVSLAM on Jan 31, 2021. But I can't find "video_pose" and "orb_vocab/" in "stella_vslam/build". Can you tell me how to do so that I can run this project(EgocentricReconstruction)? Looking forward to your response, thank you very much.

Hyeonjoong-Jang commented 1 year ago

Hi, "video_pose" is just the name of the executable file, which is an output of the build. So, I guess it should be replaced by "run_camera_slam", according to "https://github.com/stella-cv/stella_vslam/blob/main/example/CMakeLists.txt". Also I uploaded an example code slam/video_pose_main.cc file. I think you can use this file by slightly modifying it.

The SLAM will require an orb vocabulary file. In the tutorial section in "https://github.com/stella-cv/stella_vslamhttps://github.com/stella-cv/stella_vslam", I can see that a link for downloading an ORB file exists. You can use the file for the orb_path.

Followmeczx commented 1 year ago

Hi,through several attempts I found that "video_pose" should be replaced by "run_video_slam". But when I run "run_video_slam" to test demo which you uploaded, I face some problem: Run 2-Pass OpenVSLAM... yaml-cpp: error at line 28, column 21: illegal map value Traceback (most recent call last): File "/data/S221000776-CZX/D2L/EgocentricReconstruction/main.py", line 46, in <module> main() File "/data/S221000776-CZX/D2L/EgocentricReconstruction/main.py", line 23, in main slam_util.run_two_pass_slam(config) File "/data/S221000776-CZX/D2L/EgocentricReconstruction/utils/slam_util.py", line 115, in run_two_pass_slam subprocess.check_output(openvslam_script, shell=True, universal_newlines=True) File "/data/S221000776-CZX/.conda/envs/egocentric/lib/python3.9/subprocess.py", line 424, in check_output return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/data/S221000776-CZX/.conda/envs/egocentric/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command './stella_vslam/build/run_video_slam -m ./demotest/input_video/sponza/video.mp4 -v ./stella_vslam/build/orb_vocab/orb_vocab.fbow --map-db-out ./demotest/input_video/sponza/map.msg --mask mask_img.png -c ./demotest/input_video/sponza/config.yaml' returned non-zero exit status 1. I don't know how to solve this error. I guess the problem could be from the first step: `python main.py --config demotest/config/demotest.json INFO:OpenGL.acceleratesupport:OpenGL_accelerate module loaded INFO:OpenGL.arrays.arraydatatype:Using accelerated ArrayDatatype Select mask Press "S" when you are done 视频文件路径: ./demotest/input_video/sponza/video.mp4 Mask img size: 2048 x 1024 Mask depth size: 1024 x 512 QObject::moveToThread: Current thread (0x5635742cdee0) is not the object's thread (0x56357757c8a0). Cannot move to target thread (0x5635742cdee0)

QObject::moveToThread: Current thread (0x5635742cdee0) is not the object's thread (0x56357757c8a0). Cannot move to target thread (0x5635742cdee0)

QObject::moveToThread: Current thread (0x5635742cdee0) is not the object's thread (0x56357757c8a0). Cannot move to target thread (0x5635742cdee0)` Can you give me some advice?

Followmeczx commented 1 year ago

Aslo, I try to modify your example code slam/video_posemain.cc file. But there still some error I don't know how to solve. Firstly, `// run tracking if (cfg->**camera->setuptype == stella_vslam::camera::setup_type_t**::Monocular) { if(mode == 0){ printf("mapping...\n"); mono_tracking(cfg, vocab_folder + "orb_vocab.fbow", video_folder + "video.mp4", mask_file, frame_limit, map_db_path); } else if(mode == 1){ printf("localizaing...\n"); mono_localizing(cfg, vocab_folder + "orb_vocab.fbow", video_folder + "video.mp4", mask_file, frame_limit, map_db_path, trajectory_db_path); }

}
else {
    throw std::runtime_error("Invalid setup type: " + cfg->camera_->get_setup_type_string());
}`

vscode reports error : Class "stellavslam::config" has no members "camera" and A name followed by "::" must be a class name or namespace name Secondly, // wait until the loop BA is finished while (SLAM.loop_BA_is_running()) { std::this_thread::sleep_for(std::chrono::microseconds(5000)); }

ifdef USE_PANGOLIN_VIEWER

// automatically close the viewer
viewer.request_terminate();

endif

**thread.join();**

// shutdown the SLAM process
SLAM.shutdown();
if (!traj_path.empty()) {
    // output the map database
    SLAM.save_frame_trajectory(traj_path, "KITTI");
}

vscode report an error: Undefined identifier "thread". But I already add '#include '. Can you give me some advice? Thank you very much!

Followmeczx commented 1 year ago

I have solved error. But when I 'g++ -o video_pose video_pose_main.cc', it report so many errors. Can you give me some advice or upload related CMakeList.txt?

Hyeonjoong-Jang commented 1 year ago

Hi, I uploaded CMakeLists.txt file. You might need to put CMakeLists.txt and video_pose_main.cc files to stella_vslam/src directory and then build the whole project. I hope this helps you.

Followmeczx commented 1 year ago

Hi, I uploaded CMakeLists.txt file. You might need to put CMakeLists.txt and video_pose_main.cc files to stella_vslam/src directory and then build the whole project. I hope this helps you. I have successfully built the "video_pose" executable, and I was able to run it to get the "map.msg" and "traj.csv" files for the sponza video. " files. But I have two problems: Firstly, the "traj.csv" file I got has only 12 elements of a 3*4 matrix in each row, which leads to a file read error during depth prediction. The "traj.csv" file in the demo you provided has 17 elements, with line numbers at the top of each line and "0 0 0 1" at the end. I'm not sure what the five added elements mean, but I modified the "traj.csv" file I generated after your demo to take the next step in depth prediction. Secondly, I had an error causing sponza_depth to be null when I did the depth prediction. Therefore the later reconstruction steps cannot be performed. The error is as follows: Feature.mask_rectangles: Run 2-Pass OpenVSLAM... 'Framebuffer with requested attributes not available. Using available framebuffer. You may see visual artifacts.Framebuffer with requested attributes not available. Using available framebuffer. You may see visual artifacts.Depth estimation Shape: 512 1024 3 Finding baseline condition... Cannot find good pairs Weight calculation' Finally, I ran your demo directly and encountered the same problem as question https://github.com/KAIST-VCLAB/EgocentricReconstruction/issues/12 texture mapping failed and reported an error. I hope you have time to help me with my problem. Thank you very much!