如何把opencv编译到matlab,c – 为OpenCV编译MATLAB绑定

我正在尝试编译OpenCV 3.0的MATLAB绑定,即

Github的当前版本.我一直收到以下错误:

CMake Error at /opencv/modules/matlab/compile.cmake:47 (message):

Failed to compile createCalibrateDebevec:

/opencv/build/modules/matlab/src/createCalibrateDebevec.cpp:

In function ‘void mexFunction(int, mxArray**, int, const mxArray**)’:

/opencv/build/modules/matlab/src/createCalibrateDebevec.cpp:46:3:

error: ‘Ptr_CalibrateDebevec’ was not declared in this scope

多个文件会发生这种情况.我发现这个thread,讨论了几种补救措施,即.将一些typedef添加到bridge.hpp文件中,但在编译时会导致更多错误.我还发现这个thread建议删除有问题的.cpp文件和编译.这导致无错编译,然后是通常的make install.但是,从MATLAB内部调用任何OpenCV函数现在会导致错误,例如:

If = cv.dft(I, 'flags', cv.DFT_COMPLEX_OUTPUT);

Error using dft

cv::exception caught:

/home/xxx/opencv-master/modules/core/src/dxt.cpp:1760: error: (-215)

type == CV_32FC1 || type == CV_32FC2 || type == CV_64FC1 || type == CV_64FC2

in function dft

另一个错误示例:

im_denoise = cv.fastNlMeansDenoising(im_noise, 18);

Error using fastNlMeansDenoising

cv::exception caught:

/home/xxx/opencv-master/modules/photo/src/fast_nlmeans_denoising_invoker.hpp:146:

error: (-215) almost_dist2weight_[0] == fixed_point_mult_ in function

FastNlMeansDenoisingInvoker

任何有关如何解决这些问题的帮助非常感谢!

你可能感兴趣的:(如何把opencv编译到matlab,c – 为OpenCV编译MATLAB绑定)