我正在尝试在我的代码中使用 NormalBayesClassifier
来应用词袋。预训练矩阵准备好,交给trainme
矩阵。我按如下方式使用它:
NormalBayesClassifier classifier;
classifier.train(trainme, labels);
我收到以下错误:
error C2065: 'NormalBayesClassifier' : undeclared identifier
我已经添加了所有正确的库和所有其他 opencv 函数,包括 features2d 函数。
这是我的图书馆:
#include <stdafx.h>
#include <stdlib.h>
#include <cv.hpp>
#include <cxcore.hpp>
#include <highgui.h>
#include <iostream>
#include "opencv2/nonfree/features2d.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/nonfree/nonfree.hpp"
#include <fstream>
#include <windows.h>
using namespace cv;
using namespace std;
那应该涵盖了 NormalBayesClassifier
函数,那我为什么会收到这个错误?
最佳答案
关于c++ - NormalBayesClassifier 在 opencv 代码中给出未声明的标识符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13778780/