Tested on: Matlab 2012a, Microsoft VS 2010, Win 7 (64 bit), OpenCV 2.4.2

 

See below.

(1) Install and Compile OpenCV 2.4.2 , then set PATH variables to link to OpenCV DLLs. (how to? see here)

(2) Setup mex compiler in Matlab. Run “mex –setup”, and select VS 2010 compiler form the list.

(3) Check paths in “compile.m”, edit it. Mine looks like so:

include = ' -IE:\OpenCV\install\include\ -IE:\OpenCV\install\include\opencv';
libpath = 'E:\OpenCV\install\lib\';
files = dir(fullfile(libpath,'*.lib'));

相关文章: