Error using mexOpenCV

asked 2018-12-13 07:18:58 -0600

ihssane gravatar image

hello guys I want to work on MATLAB in order to use bgslibrary in my research, using the wrapper_matlab files, which found in the bgslibrary folders on github. I followed the steps mentioned in the README but I got an error when I run the compile.m. Noted that I have installed the Microsoft Visual Studio 2015 and I am working with matlab 2018a. Hope I can find someone could help me in this and thanx in advance.

the command window on matlab was:

Building with 'Microsoft Visual C++ 2015'.
cl /c /Zp8 /GR /W3 /EHs /nologo /MD /O2 /Oy- /DNDEBUG /DMEX_COMPILE_FLAG  /DMATLAB_DEFAULT_RELEASE=R2017b  /DUSE_MEX_CMD   /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0   /DMATLAB_MEX_FILE -I"C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include" -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\toolbox\distcomp\gpu\extern\include" -I"..\package_bgs"  -I"C:\Program Files\MATLAB\R2018a\extern\include" -I"C:\Program Files\MATLAB\R2018a\simulink\include" "E:\BAW\study\doctoral\bgslibrary-master\wrapper_matlab\backgroundSubtractor_wrapper.cpp" /FoC:\Users\ihssane\AppData\Local\Temp\mex_62234284571999_12516\backgroundSubtractor_wrapper.obj
Error using mexOpenCV (line 136)
backgroundSubtractor_wrapper.cpp
e:\baw\study\doctoral\bgslibrary-master\wrapper_matlab\mxarray.h(591): warning C4267: 'argument': conversion from 'size_t' to
'int', possible loss of data
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(58): error
C2011: 'CvConnectedComp': 'struct' type redefinition
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(58): note: see
declaration of 'CvConnectedComp'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(69): error
C2011: 'SmoothMethod_c': 'enum' type redefinition
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(69): note: see
declaration of 'SmoothMethod_c'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(91): error
C2365: 'CV_GAUSSIAN_5x5': redefinition; previous definition was 'enumerator'
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(91): note: see
declaration of 'CV_GAUSSIAN_5x5'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(96): error
C2365: 'CV_SCHARR': redefinition; previous definition was 'enumerator'
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(96): note: see
declaration of 'CV_SCHARR'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(98): error
C2365: 'CV_MAX_SOBEL_KSIZE': redefinition; previous definition was 'enumerator'
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(98): note: see
declaration of 'CV_MAX_SOBEL_KSIZE'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(103): error
C2365: 'CV_BGR2BGRA': redefinition; previous definition was 'enumerator'
C:\Program Files\MATLAB\R2018a\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/imgproc/types_c.h(103): note: see
declaration of 'CV_BGR2BGRA'
E:/BAW/study/doctoral/bgslibrary-master/package_bgs/opencv-3.4.4/build/install/include/opencv2/imgproc/types_c.h(104 ...
(more)
edit retag flag offensive close merge delete

Comments

Good day! Did you manage to connect bgs library? I just get a very similar error, I don’t know how to solve it (mexopencv is not installed). It would be nice if you wrote how to solve the problem by mail [email protected]

lode_00 gravatar imagelode_00 ( 2019-05-24 01:03:55 -0600 )edit