Ask Your Question

Revision history [back]

Compile MATLAB bindings for OpenCV

I am trying to compile the MATLAB bindings for OpenCV 3.0, i.e. the current build from Github. I keep getting the following errors:

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

This occurs for multiple files. I found this thread, Issue 3445, which discusses a couple of remedies, viz. adding some typedefs to the bridge.hpp file, but that results in even more errors while compiling. I also found this thread which suggested removing the problematic .cpp files and compiling. This resulted in error-free compilation followed by the usual make install. However, calling any OpenCV function from inside MATLAB now results in errors such as:

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

Another error example:

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

Any help on how to resolve these issues is much appreciated!

Compile MATLAB bindings for OpenCV

I am trying to compile the MATLAB bindings for OpenCV 3.0, i.e. the current build from Github. I keep getting the following errors:

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

This occurs for multiple files. I found this thread, Issue 3445, which discusses a couple of remedies, viz. adding some typedefs to the bridge.hpp file, but that results in even more errors while compiling. I also found this thread which suggested removing the problematic .cpp files and compiling. This resulted in error-free compilation followed by the usual make install. However, calling any OpenCV function from inside MATLAB now results in errors such as:

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

Another error example:

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

Any help on how to resolve these issues is much appreciated!