Illegal call of non-static member function in C++ OpenCV

别来无恙 提交于 2019-12-11 18:29:02

问题


I'm trying to use this function, but I cannot find any examples. So I tried every possible way that I can think of, and each time I get a different error :

cv::Mat salMap;
cv::saliency::StaticSaliencySpectralResidual::computeSaliency(img, salMap);

this causes in error :

'cv::saliency::Saliency::computeSaliency': illegal call of non-static member function

Then I tried to instantiate the class like this :

cv::saliency::StaticSaliencySpectralResidual myObj;
myObj.computeSaliency(grayImg, salMap); // also tried "->" instead of "."

and here is the error I got :

Error   LNK2001 unresolved external symbol "public: bool __cdecl cv::saliency::Saliency::computeSaliency(class cv::_InputArray const &,class cv::_OutputArray const &)" (?computeSaliency@Saliency@saliency@cv@@QEAA_NAEBV_InputArray@3@AEBV_OutputArray@3@@Z)

Error   LNK2001 unresolved external symbol "public: virtual __cdecl cv::saliency::Saliency::~Saliency(void)" (??1Saliency@saliency@cv@@UEAA@XZ)

So how can I use this class?

Thanks for any help !

来源:https://stackoverflow.com/questions/32978963/illegal-call-of-non-static-member-function-in-c-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!