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.

makeInfo=rtwmakecfg()
function makeInfo=rtwmakecfg()
%RTWMAKECFG adds include and source directories to rtw make files.
%  makeInfo=RTWMAKECFG returns a structured array containing
%  following field:
%     makeInfo.includePath - cell array containing additional include
%                            directories. Those directories will be
%                            expanded into include instructions of rtw
%                            generated make files.
%
%     makeInfo.sourcePath  - cell array containing additional source
%                            directories. Those directories will be
%                            expanded into rules of rtw generated make
%                            files.

%
%       Copyright 2012 The MathWorks, Inc.
%

disp(['### Running rtwmakecfg from folder: ',pwd]);

%
% OpenCV
%

if strcmp(computer, 'PCWIN') || strcmp(computer, 'PCWIN64')
else
    error('ERROR: Point Cloud Viewer (OpenCV) unsupported platform.');
end

% Get OpenCV installation path
%  SIMULINKFORNIDOPENCVPATH
simulinkfornidopencvinfo;

% Append OpenCV header include path
makeInfo.includePath = ...
    { ...
        [SIMULINKFORNIDOPENCVPATH '\build\include'];
    };

% Append OpenCV library
if strcmp(computer, 'PCWIN')
    makeInfo.linkLibsObjs = ...
        { ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_calib3d231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_contrib231.lib' '"'], ... 
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_core231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_features2d231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_flann231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_gpu231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_highgui231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_imgproc231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_legacy231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_ml231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_objdetect231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_ts231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x86\vc10\lib\opencv_video231.lib' '"'] ...
        };
elseif strcmp(computer, 'PCWIN64')
    makeInfo.linkLibsObjs = ...
        { ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_calib3d231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_contrib231.lib' '"'], ... 
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_core231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_features2d231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_flann231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_gpu231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_highgui231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_imgproc231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_legacy231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_ml231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_objdetect231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_ts231.lib' '"'], ...
            ['"' SIMULINKFORNIDOPENCVPATH '\build\x64\vc10\lib\opencv_video231.lib' '"'] ...
        };
end

% Append S-Function source files for Point Cloud Viewer (OpenCV)
makeInfo.sources  = { 'sfun_pcv.cpp', 'openCV_pcv_wrapper.cpp' };

makeInfo.precompile = 1;

clear SIMULINKFORNIDOPENCVPATH;


% [EOF]

Contact us