我尝试运行视觉里程表示例。我从here安装libviso2。我有matlab 2011b。我使用的是Ubuntu 14.04。

libviso2的自述文件说对于c++安装:

- sudo apt-get install libpng12-dev
- sudo apt-get install libpng++-dev

Linux:

1) Move to libviso2 root directory
2) Type 'cmake .'
3) Type 'make'
4) Run './viso2 path/to/sequence/2010_03_09_drive_0019'

我在终端上成功运行libviso2。下一步,我尝试运行matlab包装器和演示。自述文件说关于matlab包装器:
In the MATLAB directory of libviso, simply run 'make.m' to generate the mex wrappers.
(Run mex -setup before to choose your desired compiler)

Now try to run the demo*.m files!

首先,我运行make.m,输出如下:
../src/triangle.cpp:1552:27: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
        printtri.orient);
                       ^
../src/triangle.cpp:1561:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
        printvertex[0], printvertex[1]);
                                      ^
../src/triangle.cpp:1568:42: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Wformat=]
        printvertex[0], printvertex[1]);

然后我运行mex -setup。我尝试运行示例演示,但出现错误。错误消息如下:
MATLAB/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version   `GLIBCXX_3.4.11' not found (required by
/MATLAB/bin/libviso2/matlab/visualOdometryMonoMex.mexa64)

我该如何解决这个错误?

最佳答案

我认为这是因为Matlab更改了64位API。因此,将'-compatibleArrayDims'添加到mex文件中。我做到了,而且有效。希望它也对您有用。

关于c++ - 如何使用libviso2?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/31262725/

10-12 19:45