3

I am getting the following error while trying to build opencv with the contrib module

/opencv/opencv_contrib/modules/tracking/include/opencv2/tracking/tracker.hpp:577:11: error: ‘AlgorithmInfo’ does not name a type

The code is latest and pulled just now. After adding a forward declaration class AlgorithmInfo; to the file tracker.hpp that particular error is gone but I am getting other '‘AlgorithmInfo’ does not name a type' errors in other files. Probably AlgorithmInfo is not getting included somehow. Any ideas?

Investigation:

  1. After grepping AlgorithmInfo I found that there is no defination of AlgorithmInfo in the code base.

  2. Comparing to the previous version of code I found AlgorithmInfo is defined at opencv2/core.hpp line 3006. But in the latest code, it is not present there at all!

4

1 回答 1

0

这不是一个永久的解决方案,但我遇到了同样的问题,这就是我如何能够继续该项目的工作,直到有人找到更好的方法。

我查看了 Utkarsh 发布的链接How do I use SIFT in OpenCV 3.0 with c++?

总而言之,我必须获得 opencv_contrib repo 并重新制作 opencv。

这样做之后,我仍然遇到同样的错误,最终意识到你必须包括

#include "opencv2/xfeatures2d.hpp"
#include "opencv2/features2d/features2d.hpp"

但除非您也删除/注释掉,否则您仍然会得到相同的结果

//#include "opencv2/nonfree/features2d.hpp"
//#include "opencv2/nonfree/nonfree.hpp"

无论如何,这就是我暂时绕过错误的方法。

于 2015-10-28T17:50:01.543 回答