Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed MatrixProxy for OpenCV #33

merged 1 commit into from Jul 29, 2019


Copy link

commented Jul 29, 2019

OpenCV guards were renamed from __OPENCV_CORE_HPP__ to OPENCV_CORE_HPP. See OpenCV commit - opencv/opencv@a34fbf7#diff-114b24d27519ff9e8ece43faba55fc65L45-R46

So with fresh OpenCV (looks like starting from 3.1 or 3.2 version) you will encounter compilation error like this:

error: no matching function for call to ‘kgraph::MatrixProxy<unsigned char>::MatrixProxy(cv::Mat&)’
     kgraph::MatrixProxy<unsigned char> proxy(mat);
In file included from ...:
/usr/local/include/kgraph-data.h:206:9: note: candidate: ‘kgraph::MatrixProxy<DATA_TYPE, A>::MatrixProxy(const kgraph::Matrix<DATA_TYPE>&) [with DATA_TYPE = unsigned char; unsigned int A = 16]’
         MatrixProxy (Matrix<DATA_TYPE> const &m)
/usr/local/include/kgraph-data.h:206:9: note:   no known conversion for argument 1 from ‘cv::Mat’ to ‘const kgraph::Matrix<unsigned char, 16>&’
/usr/local/include/kgraph-data.h:200:11: note: candidate: ‘constexpr kgraph::MatrixProxy<unsigned char>::MatrixProxy(const kgraph::MatrixProxy<unsigned char>&)’
     class MatrixProxy {
/usr/local/include/kgraph-data.h:200:11: note:   no known conversion for argument 1 from ‘cv::Mat’ to ‘const kgraph::MatrixProxy<unsigned char>&’
/usr/local/include/kgraph-data.h:200:11: note: candidate: ‘constexpr kgraph::MatrixProxy<unsigned char>::MatrixProxy(kgraph::MatrixProxy<unsigned char>&&)’
/usr/local/include/kgraph-data.h:200:11: note:   no known conversion for argument 1 from ‘cv::Mat’ to ‘kgraph::MatrixProxy<unsigned char>&&’

Proposed fix is to check for CV_MAJOR_VERSION instead.

@aaalgo aaalgo merged commit 2c924aa into aaalgo:master Jul 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.