Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
期望最大化get covs函数在OpenCV 2.4.6上不起作用,且在训练功能后集群数量发生变化_Opencv_Expectation Maximization - Fatal编程技术网

期望最大化get covs函数在OpenCV 2.4.6上不起作用,且在训练功能后集群数量发生变化

期望最大化get covs函数在OpenCV 2.4.6上不起作用,且在训练功能后集群数量发生变化,opencv,expectation-maximization,Opencv,Expectation Maximization,我有两个问题。第一个是为什么在列车运行后,ncluster从10切换到80。 第二:我用OpenCV把代码从C传递到C++,但是似乎有一些问题。当我尝试获取模型的COV时出现异常,代码如下: int nclusters = 10; // Here nclusters is 10 EM em_model(nclusters, EM::COV_MAT_GENERIC); bool isTrained = em_model.train(samples); // Here nclusters is 80

我有两个问题。第一个是为什么在列车运行后,ncluster从10切换到80。 第二:我用OpenCV把代码从C传递到C++,但是似乎有一些问题。当我尝试获取模型的COV时出现异常,代码如下:

int nclusters = 10; // Here nclusters is 10
EM em_model(nclusters, EM::COV_MAT_GENERIC);
bool isTrained = em_model.train(samples);
// Here nclusters is 80

Mat means = em_model.get<Mat>("means");    
Mat weights = em_model.get<Mat>("weights");
const vector<Mat>& covs  = em_model.get<vector<Mat>>("covs"); // Here I have the exception. I have tried with and without &.
int-nclusters=10;//这里的nclusters是10
EM模型(nclusters,EM::COV_MAT_GENERIC);
bool isTrained=em_模型列车(样本);
//这里的nclusters是80
Mat means=em_model.get(“means”);
材料重量=em_模型。获取(“重量”);
const vector&covs=em_model.get(“covs”);//这里我有个例外。我试过有和没有&。
调试后,错误显示在最后一行之后。该系统显示了一个带有MyPoal.EXE的窗口,它触发了断点,如果我单击“继续”,我将得到微软VisualC++调试库窗口,其中的文件是:f:\De\vcToo\CRTYBLD\Selfxx8\CRT\Src\dBGHEAP.c;线路:1322;表达式:_CrtIsValidHeapPointer(pUserData)


几乎相同的代码适用于这个家伙:

我已经修复了它。我使用VS2012编译了OpenCV 2.4.6的源代码库,它运行正常。编译后的版本中似乎有一些bug。

我已经修复了它。我使用VS2012编译了OpenCV 2.4.6的源代码库,它运行正常。在编译的版本中似乎有一些bug