我有这个问题,
当我运行vs2010(调试)(打开cv 2.4.0)时facerec_demo.cpp给我程序这个错误
OpenCV错误:图像步骤错误(矩阵不连续,因此其行数无法更改)在未知函数中,文件......\src\opencv\modul es\core>\src\matrix. cpp,801行
这个错误导致我在facerec.cpp中的这一行
(Fisherfaces :: train(InputArray src,InputArray _lbls)
Mat data = asRowMatrix(src, CV_64FC1); <-- this gets a exeption, not handled.
Run Code Online (Sandbox Code Playgroud)
和ai在pgm img数据库中使用,这是我原来的*facerec_demo.cpp*文件
#include "stdafx.h"
#include <opencv2/opencv.hpp>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <sstream>
using namespace cv;
using namespace std;
vector<string> split_at_commas(const string& row)
{
vector<string> res;
istringstream buf(row);
string s;
while (getline(buf, s, ';'))
res.push_back(s);
return res;
}
Mat toGrayscale(InputArray _src) {
Mat src = _src.getMat();
// only allow one channel
if(src.channels() != …Run Code Online (Sandbox Code Playgroud)