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
Actually, I have not been able to fix my problems yet with above suggestions. I will keep posting till I find some solution.
There are many things that may go wrong when you are mexing…starting from compiling issues to gateway function errors. Since matlab is crashing, you probably dont have a clu about what the error looks like. Try printing out your gateway mex function code by code adding enough number of pauses. I worked extensively with mex functions through my PhD, successfully mexed fortran code in matlab.
@ Bhushan, Thanks for the advise. I Was able to solve this problem eventually. You can refer to my more recent post “Fixing the problem”.