andrewssobral / bgslibrary

A C++ Background Subtraction Library with wrappers for Python, MATLAB, Java and GUI on QT
MIT License
2.2k stars 740 forks source link

i have problems with my new project in BGS Library, help me! #76

Open hungsn96 opened 7 years ago

hungsn96 commented 7 years ago

Error 8 error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. E:\opencv\build\include\opencv2\legacy\blobtrack.hpp 187 1 bgslibrary

andrewssobral commented 7 years ago

Hi @hungsn96 , This seems to be an error from the opencv side. Which version of opencv you are using?

Jessiiii commented 7 years ago

Hello @andrewssobral, I got an error, desperately searching for help ! Thanks

Building with 'Microsoft Visual C++ 2012'. cl /c /GR /W3 /EHs /nologo /MD -IS:\Matlabtrial\toolbox\vision\builtins\src\ocvcg\opencv\include -IS:\Matlabtrial\extern\include -IS:\Matlabtrial\toolbox\distcomp\gpu\extern\include -I"../package_bgs" -I"S:\Matlabtrial\extern\include" -I"S:\Matlabtrial\simulink\include" /DTARGET_API_VERSION=700 /DMEX_COMPILE_FLAG /DUSE_MEX_CMD /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /O2 /Oy- /DNDEBUG S:\Matlabtrial\BGSlibrary\bgslibrary-master\wrapper_matlab\backgroundSubtractor_wrapper.cpp /FoC:\Users\LU\AppData\Local\Temp\mex_31313716062541_9884\backgroundSubtractor_wrapper.obj Error using mexOpenCV (line 131) backgroundSubtractor_wrapper.cpp s:\matlabtrial\bgslibrary\bgslibrary-master\wrapper_matlab\mxarray.h(591) : warning C4267: 'argument'ÿ: conversion de 'size_t' en 'int', perte possible de donn‚es ../package_bgs\IBGS.h(48) : error C2864: 'bgslibrary::algorithms::IBGS::firstTime'ÿ: seules les donn‚es membres static const int‚grales peuvent ˆtre initialis‚es dans une classe ../package_bgs\IBGS.h(49) : error C2864: 'bgslibrary::algorithms::IBGS::showOutput'ÿ: seules les donn‚es membres static const int‚grales peuvent ˆtre initialis‚es dans une classe

Jessiiii commented 7 years ago

@andrewssobral It may be useful to precise that I'm using Matlab Wrapper, version r2017a

andrewssobral commented 7 years ago

Hi @Jessiiii , I will take a look at this... Do you have tried this wrapper? https://github.com/andrewssobral/bgslibrary/releases/tag/bgslib_matlab_win64_2.0.0

Jessiiii commented 7 years ago

I tried it just now, and it didn't work.. I got an error always with mexOpenCV:

Error using mexOpenCV (line 131) backgroundSubtractor_wrapper.cpp s:\matlabtrial\bgslibrary\bgslibrary-master\bgslibrary2_matlab_opencv249_x64\mxarray.h(591) : warning C4267: 'argument'ÿ: conversion de 'size_t' en 'int', perte possible de donn‚es ..\package_bgs\IBGS.h(48) : error C2864: 'bgslibrary::algorithms::IBGS::firstTime'ÿ: seules les donn‚es membres static const int‚grales peuvent ˆtre initialis‚es dans une classe ..\package_bgs\IBGS.h(49) : error C2864: 'bgslibrary::algorithms::IBGS::showOutput'ÿ: seules les donn‚es membres static const int‚grales peuvent ˆtre initialis‚es dans une classe s:\matlabtrial\bgslibrary\bgslibrary-master\package_bgs\LBP_MRF/MotionDetection.hpp(48) : warning C4099: 'CvPoint2D32f'ÿ: nom de type d‚j… rencontr‚ avec 'struct' et utilisant maintenant 'class' S:\Matlabtrial\toolbox\vision\builtins\src\ocvcg\opencv\include\opencv2/core/types_c.h(894)ÿ: voir la d‚claration de 'CvPoint2D32f' s:\matlabtrial\bgslibrary\bgslibrary-master\package_bgs\multilayer\BlobResult.h(179) : warning C4267: 'return'ÿ: conversion de 'size_t' en 'int', perte possible de donn‚es

Error in compile (line 3) mexOpenCV -v -DMEX_COMPILE_FLAG -I"..\package_bgs" backgroundSubtractor_wrapper.cpp ...

Error in run_demo (line 2) compile;

Jessiiii commented 7 years ago

@andrewssobral see my last message please

andrewssobral commented 7 years ago

Hi @Jessiiii ,

I think the problem is that you are trying to compile it without some prerequisites.

If you are on Windows (or Linux / macOS), and you want to build MATLAB wrapper from source (please ignore https://github.com/andrewssobral/bgslibrary/releases/tag/bgslib_matlab_win64_2.0.0), and make the following steps:

Jessiiii commented 7 years ago

Hello @andrewssobral Thank you so much for your help but it still doesn't work. I got the same error as that of 6 days ago.

However I tried an exemple, function matchTemplateOCV.cpp . It compiled successfully and I can run this function with MATLAB. (So it means the OpenCV Toolbox Interface does work well right?)