本文介绍了PCL,OpenCV和弗兰冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的程序中使用PCL 1.6,OpenCV 2.4.2(在Qt中),并且存在无法解决的flan(1.7.1)冲突.

I'm using PCL 1.6, OpenCV 2.4.2 for my program (in Qt) and there is this flann (1.7.1) conflict I cannot resolve.

我已经在互联网上阅读了很多有关它的内容,并尝试了大多数解决方案(不使用using namespace cv,更新了OpenCV的最新版本,并在OpenCV包含之前添加了PCL包含的内容,等等),但是无论何时我仍在使用PCL和OpenCV一起使用时,flann-lib(PCL使用)会引起问题,例如对于这行代码typedef flann::Index<Dist> FLANNIndex;

I have already read a lot about it on the internet, and tried most of the solutions (not using using namespace cv, update the latest version of OpenCV and put PCL includes before OpenCV inludes etc.), but still whenever I use PCL and OpenCV together, the flann-lib (which PCL uses) would cause problem and say e.g. for this line of code typedef flann::Index<Dist> FLANNIndex;

还有其他解决方法吗?

推荐答案

我似乎找到了一种解决方案,但是我不确定这是最好的解决方案.

I seemed to have found a solution, but I'm not sure it's the best one.

  1. 我在 ../include/pcl-1.6/pcl/kdtree/kdtree_flann.h 中添加了#include <flann/flann.h>,之后上述错误消失了.

  1. I added #include <flann/flann.h> to ../include/pcl-1.6/pcl/kdtree/kdtree_flann.h, afterwards the error mentioned above went away.

但是OpenCV找不到它的"flann/flann.h" ,所以我在 ../include/opencv2/flann ,当然,我也必须为每个包含该目录的.h文件执行此操作.

But then OpenCV was having trouble to find its "flann/flann.h", so I changed the directory in ../include/opencv2/flann to flanncv and of course I had also to do this for every .h file which includes this directory, too.

这不是一个很整洁的解决方案,但目前可以使用.

It's not a very neat solution, but it is working for now.

这篇关于PCL,OpenCV和弗兰冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-30 02:46