This document was created as part of a final project for a BSc degree at the Academic College of Tel-Aviv Yaffo, by Rachely Esman and Yoad Snapir, under the supervision of Tal Hassner.
As part of the project, we used Intel's OpenCV library, calling its functions from MATLAB. We found the subject tricky and thus decided to share the experience of our work with others describing the common pitfalls.
You can use this document freely according to the copyrights noted below but under your sole responsibility.
First I copied your method without any modification but I failed. Then I found my directories are different from yours. I used Visual Studio 8.0 as the compiler and I built a debug and release version respectively. Then the .lib files should be in OPENCVDIR\VS2005\lib\debug,OPENCVDIR\VS2005\lib\release,OPENCVDIR\VS2005\bin\debug,OPENCVDIR\VS2005\bin\release respectively.
(Btw, the VS2005 directory is not there at first place, but was built when I used CMake to make the files, containing the built .sln and other files. You can name it differently, but the you should refer to compiled .libs.)
Also the .h files are in different places, possibly because I use a different version of OpenCV(I use 2.0). In this case it's in OPENCVDIR\include\opencv.
I still thank the author for making the principle right. All you have to pay attetion to is the concrete path names.
I have read this paper and try it. I use Matlab 2010, OpenCV1.1 and Visual Studio 2008. There is a big trouble: when I call mex-function, that contains a call of OpenCV functions ( such as cvNamedWindow, cvLoadImage and cvDestroyAllWindows, cvReleaseImage, etc. ) it's look all right, but there is a fail later, when I call matlab functions of Calibration Toolbox for Matlab. For example, I call one mex-function and after that the toolbox loads images and crush comes, but crush comes not at the momemnt of mex-function calling, but much later. In fact Matlab crushes on that code:
mask = exp(-((-wintx:wintx)'/(wintx)).^2) * exp(-((-winty:winty)/(winty)).^2);
In other words, it looks like crush happens, when there were computing intensive operations =)
It looks very strange that during the time after a calling mex-function and before crush, windows are creating and some matlab code works fine.
Could anybody help me solve this problem? Thanks