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

Runtime enum-to-type mapping

Both Matlab array mxArray and OpenCV’s Mat can hold data any basic type.  I want to write code which essentially can handle any data type. My current solution is to write template based code for data processing.  I call this code with a switch/case statement. I wanted to avoid rewriting …

Continue reading