openCV 3.0.0 cv :: vector丢失 [英] openCV 3.0.0 cv::vector missing

查看:99
本文介绍了openCV 3.0.0 cv :: vector丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从opencv 2.4.11升级到3.0.0,我在代码中使用了cv::vector <br>,但现在我得到了错误 向量不是'cv'

I'm upgrading from opencv 2.4.11 to 3.0.0 I have used cv::vector in my code <br> but now I get the error vector in not a member of 'cv'

我将开始使用std::vector代替<br> 但是我找不到它被删除或只是移到另一个头文件的任何地方?

I will start using std::vector instead <br> however I can't find anywhere was it removed or just moved to another header file?

推荐答案

在3.0之前的OpenCV中,您可以在core.hpp开头看到OpenCV在内部使用std::vector:

In OpenCV prior to 3.0, you can see at the beginning of core.hpp that OpenCV is using std::vector internally:

#ifndef __OPENCV_CORE_HPP__
#define __OPENCV_CORE_HPP__

...
#include <vector>
...

/*! \namespace cv
    Namespace where all the C++ OpenCV functionality resides
*/
namespace cv {
...
using std::vector;
...

因此,您也可以通过cv命名空间访问std::vector,例如:

So you can access std::vector also through cv namespace like:

cv::vector

实际上,内部OpenCV就像vector一样引用std::vector.

In fact, internally OpenCV refers to std::vector just as vector.

在OpenCV 3.0中,不存在#using std::vector,并且内部OpenCV始终引用std::vector.

In OpenCV 3.0 instead the #using std::vector is not present, and internally OpenCV refers always to std::vector.

您将可以使用cv::vector将此代码添加到您的代码中:

You'll be able to use cv::vector adding this into your code:

namespace cv
{
    using std::vector;
}

这篇关于openCV 3.0.0 cv :: vector丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆