image thumbnail

Simulink for PCV (Point Cloud Viewer)

by

 

12 Jun 2012 (Updated )

Simulink for PCV is a block for 3D Point Cloud View and wrapped native OpenCV library.

makecmexfile4pcv
function makecmexfile4pcv
% makecmexfile4pcv
% This function creates a C MEX S-Function for the Point Cloud Viewer using OpenCV 
%

%
% Copyright 2012 The MathWorks, Inc.
%

% Get path information of OpenCV 2.3.1
simulinkfornidopencvinfo;

if strcmp(computer, 'PCWIN')
    OpenCvPathLib=[SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib'];
elseif strcmp(computer, 'PCWIN64')
    OpenCvPathLib=[SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib'];
end

OpenCvPathInclude=[SIMULINKFORNIDOPENCVPATH '\build\include'];

clear SIMULINKFORNIDOPENCVPATH;
clear mex;

mex('sfun_pcv.cpp', 'openCV_pcv_wrapper.cpp', ...
    ['-L' OpenCvPathLib], ...
    '-lopencv_calib3d231', ...
    '-lopencv_contrib231', ...
    '-lopencv_core231', ...
    '-lopencv_features2d231', ...
    '-lopencv_flann231', ...
    '-lopencv_gpu231', ...
    '-lopencv_highgui231', ...
    '-lopencv_imgproc231', ...
    '-lopencv_legacy231', ...
    '-lopencv_ml231', ...
    '-lopencv_objdetect231', ...
    '-lopencv_ts231', ...
    '-lopencv_video231', ...
    ['-I' OpenCvPathInclude]);

%
% Mex command to use OpenMP (never tested)
%
% mex('COMPFLAGS=/openmp $COMPFLAGS', ...
%     'sfun_pcv.cpp', 'openCV_pcv_wrapper.cpp', ...
%     ['-L' OpenCvPathLib], ...
%     '-lopencv_calib3d231', ...
%     '-lopencv_contrib231', ...
%     '-lopencv_core231', ...
%     '-lopencv_features2d231', ...
%     '-lopencv_flann231', ...
%     '-lopencv_gpu231', ...
%     '-lopencv_highgui231', ...
%     '-lopencv_imgproc231', ...
%     '-lopencv_legacy231', ...
%     '-lopencv_ml231', ...
%     '-lopencv_objdetect231', ...
%     '-lopencv_ts231', ...
%     '-lopencv_video231', ...
%     '-lvcomp', ...
%     ['-I' OpenCvPathInclude]);

% EOF

Contact us