kylemcdonald / ofxCv

Alternative approach to interfacing with OpenCv from openFrameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errror C2665: 'ofxCv::toCv' : none of the 9 overloads could convert all the argument types...

kennyallau opened this issue · comments

Good day Kyle,

I came across with this compile error, not sure how to fix it:

..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(230): error C2665: 'ofxCv::toCv' : none of the 9 overloads could convert all the argument types

2> ..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(225): could be 'cv::Mat ofxCv::toCv(cv::Mat &)'
2> ..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(232): or 'cv::Mat ofxCv::toCv(ofMesh &)'
2> C:\Users\Ascend\Desktop\NEX360\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(233): or 'cv::Point2f ofxCv::toCv(ofVec2f)'
2> ..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(234): or 'cv::Point3f ofxCv::toCv(ofVec3f)'
2> ..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(235): or 'cv::Rect ofxCv::toCv(ofRectangle)'
2> ..\openFrameworks\of_v0.8.3_vs_release\addons\ofxCv\libs\ofxCv\include\ofxCv/Utilities.h(236): or 'std::vector<_Ty> ofxCv::toCv(const ofPolyline &)'

hi, please share:

  • what platform and IDE you are using
  • what version of openFrameworks
  • what example you tried to compile
commented

Hello,

I'm getting the same error. I'm running:
-Windows7, Visual Studio 2012
-OpenFrameworks 8.4, got the same error running 8.2 and 8.3
-Attained the same error in every example I've tried, including gesture, threshold, and background.

From what I can gather, toCv() is trying to form a matrix from the array of getPixels when an image is passed in, but the compiler doesn't like it and is spitting out the error. The error redirects me here, in the "Utilities.h" header:

template <class T> inline Mat toCv(ofBaseHasPixels_<T>& img) {
    return toCv(img.getPixels());
}

Hey,

I'm using Windows 7 64bit, VS2010. Tried with VS2012 as well but same error popped up.
I'm also using OF0.74. Still no luck with 0.83 either.
All examples are affected.

sorry, this was my fault. please delete your copy of ofxCv and pull again.

the version of ofxCv that you're using is meant for the upcoming 0.9.0 release of OF, but i just switched things around so ofxCv/master is now meant for 0.8.4 and ofxCv/develop is for 0.9.0

Hey,I have got this error too. I'm using OF0.8.4 with VS2012 on Windows 8.1(64bit), and I run the ofxKinect2ProjectorCalibration addon with it.
Also have tried all the vision, but they all suffered the 'ofxCv::toCv' overloads errors. Could you please tell me which one is suitable,or should I change my OF vision?