Combining OpenCV, C++ and Matlab MEX-functions: Not as easy I thought!

OpenCV and Matlab are my favorite tools. Recently I decided to write a C++ interface between the two to take advantage of some of the neat features of OpenCV’s C++ interface. But alas, I was met with crash after crash of Matlab. Initially, I had no clue. After doing some digging, I found some information.

http://stackoverflow.com/questions/3363295/opencv-matlab-and-stl-containers

http://www.mathworks.com/matlabcentral/answers/9294-mex-dynamic-memory-management-issue-with-std-vector-in-linked-external-dll-segmentation-error

Actually, I have not been able to fix my problems yet with above suggestions. I will keep posting till I find some solution.