简体   繁体   English

C ++:为什么我不能使用Opencv访问Node类?

[英]C++: Why can't I access the Node class using Opencv?

Hi I am writing a C++ program using OpenCV. 嗨,我正在使用OpenCV编写C ++程序。 I make sure to include the necessary files: 我确保包括必要的文件:

#include "opencv2/core/core.hpp"
#include "opencv2/ml/ml.hpp"

Everything using opencv works fine and dandy. 使用opencv的所有东西都可以正常工作。 But when I refer to Node in the following line: 但是当我在以下行中引用Node时:

    std::vector<Node> nodeList = forest->getNodes();

I get the following error: 我收到以下错误:

error: use of undeclared identifier 'Node'

I don't understand why, because it recognizes all the other opencv classes. 我不明白为什么,因为它可以识别所有其他opencv类。 There is probably a simple explanation for this but I don't see it right now. 对此可能有一个简单的解释,但我现在看不到。 Any help would be greatly appreciated! 任何帮助将不胜感激!

Try the full name of the node class cv::ml::DTrees::Node . 尝试节点类cv::ml::DTrees::Node的全名。 and if you want to define a vector with a certain size do this: 如果要定义具有一定大小的向量,请执行以下操作:

std::vector<Node> nodeList(forest->getNodes().size());

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM