Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch8中direct_method编译没问题,运行的时候显示段错误,请问可能是什么原因? #46

Closed
vo8zhaoyao opened this issue Nov 18, 2019 · 4 comments

Comments

@vo8zhaoyao
Copy link

No description provided.

@gaoxiang12
Copy link
Owner

请描述现象或给出报错结果,方便别人帮你分析原因。
如果什么信息都没有,请用gdb或其他工具自行调试。

@vo8zhaoyao
Copy link
Author

高博您好,感谢您的回复,我运行段结果如下,应该属于什么信息也没有,可能我需要自己找原因,很困惑。
xlab@xlab:/slambook2/ch8/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xlab/slambook2/ch8/build
xlab@xlab:
/slambook2/ch8/build$ make
[ 50%] Built target direct_method
[100%] Built target optical_flow
xlab@xlab:~/slambook2/ch8/build$ ./direct_method
段错误 (核心已转储)

@gaoxiang12
Copy link
Owner

如果你有IDE,可以使用IDE里的断点调试功能。没有的话,用gdb命令也行,不过使用方法需要自学一下。
我推测应该是目录不对或者找不到文件一类的问题。

@vo8zhaoyao
Copy link
Author

十分感谢,我已经找到了问题所在,是图片路径的问题,我将例程里的相对路径改为绝对路径之后就可以了!
// paths
string left_file = "/home/xlab/slambook2/ch8/left.png";
string disparity_file = "/home/xlab/slambook2/ch8/disparity.png";
boost::format fmt_others("/home/xlab/slambook2/ch8/%06d.png"); // other files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants