gaoxiang12 / slambook2

edition 2 of the slambook
MIT License
5.41k stars 2k forks source link

ch5 rgbd Point cloud is empty! #183

Open JiaqiongLi opened 3 years ago

JiaqiongLi commented 3 years ago

Screenshot from 2021-07-31 23-22-40

idra79haza commented 3 years ago

Hi! I am getting through the same problem, did you solve it?!

dinvincible98 commented 3 years ago

In line 29 and 30, change 'color' and 'depth' to absolute paths. Also check the format of fmt: For example:

    boost::format fmt("%s/%d.%s"); // fmt format
    // read images here
    colorImgs.push_back(cv::imread((fmt % "/home/dinvincible98/slambook2/ch5/rgbd/color" % (i + 1) % "png").str()));
    depthImgs.push_back(cv::imread((fmt % "/home/dinvincible98/slambook2/ch5/rgbd/depth" % (i + 1) % "pgm").str(), -1)); 
ResearcherYan commented 2 years ago

The relative path will fail when your executable is in the build folder. So change the boost format into absolute path. boost::format fmt("/home/yan/Learning/slam/slambook2/ch5/rgbd/%s/%d.%s");