Using Converter class to use cv::undistort in Matlab

OpenCV function void undistort(const Mat& src, Mat& dst, const Mat& cameraMatrix, const Mat& distCoeffs, const Mat& newCameraMatrix=Mat()) Matlab dst=mexUndistort(src,cameraMatrix,distCoeffs) MEX function source To compile you need opencv and boost. Mex command I used with Matlab R2011a and VC9 goes like this: mex mexUndistort.cpp matcv.cpp -IC:OpenCV2.3buildinclude -ID:NinadToolsboost_1_47_0 -LC:OpenCV2.3buildx64vc9lib -lopencv_core230 -lopencv_imgproc230   …

Continue reading

Fixing the problem

Steps followed Check what Visual studio Matlab was compiled with. Browsed to C:Program FilesMATLABR2011abinwin64, I see boost dlls with vc90 in their names, so I am guessing Visual studio 2008 AKA VC9 was used. Just to be absolutely sure, I used Dependency Walker and opened libmex.dll in it. It shows VC9 …

Continue reading