gpt4 book ai didi

opencv - 在opencv 2.4.2中使用EM

转载 作者:行者123 更新时间:2023-12-02 17:52:55 24 4
gpt4 key购买 nike

我正在寻求帮助。
由于EM类,我无法构建我的项目。我使用opencv 2.4.2

我找不到问题所在。有人可以建议吗?

cv::TermCriteria Termination;
Termination.type=CV_TERMCRIT_ITER;
Termination.maxCount=num_numIter;
cv::EM model=cv::EM(NClusters,cv::EM::COV_MAT_SPHERICAL,Termination);
model.train(groupped_one_person_features);

最后一行获得LINK ERR,我不知道如何创建EM类的对象。
NClusters是int,还有什么可能是错误的?

我用过: #include "opencv2/ml/ml.hpp"
此代码导致以下错误:

2 error LNK2019: unresolved external symbol "public: virtual bool __cdecl cv::EM::train(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &)" (?train@EM@cv@@UEAA_NAEBV_InputArray@2@AEBV_OutputArray@2@11@Z) referenced in function "void __cdecl compute_LBPH_patterns_EM(struct ArrayData *,struct Pattern *,int,int)" (?compute_LBPH_patterns_EM@@YAXPEAUArrayData@@PEAUPattern@@HH@Z) D:\Work\EBIS2012CPlusPlus\Imet_v1.0_x64\Imet_v1.0_x64\compute_patterns.obj AND Error 1 error LNK2019: unresolved external symbol "public: virtual __cdecl cv::EM::~EM(void)" (??1EM@cv@@UEAA@XZ) referenced in function "void __cdecl compute_LBPH_patterns_EM(struct ArrayData *,struct Pattern *,int,int)" (?compute_LBPH_patterns_EM@@YAXPEAUArrayData@@PEAUPattern@@HH@Z) D:\Work\EBIS2012CPlusPlus\Imet_v1.0_x64\Imet_v1.0_x64\compute_patterns.obj AND Error 3 error LNK2019: unresolved external symbol "public: __cdecl cv::EM::EM(int,int,class cv::TermCriteria const &)" (??0EM@cv@@QEAA@HHAEBVTermCriteria@1@@Z) referenced in function "void __cdecl compute_LBPH_patterns_EM(struct ArrayData *,struct Pattern *,int,int)" (?compute_LBPH_patterns_EM@@YAXPEAUArrayData@@PEAUPattern@@HH@Z) D:\Work\EBIS2012CPlusPlus\Imet_v1.0_x64\Imet_v1.0_x64\compute_patterns.obj



非常感谢

最佳答案

尝试使用此-

using namespace cv;
EM em_model;
const TermCriteria term_crit = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS,
100, FLT_EPSILON);
em_model = EM(clustercount, EM::COV_MAT_DIAGONAL, term_crit);
em_model.train(samples, loghood, labels, probs);

关于opencv - 在opencv 2.4.2中使用EM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15796886/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com