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

Problem with libraries during make #152

Open sbarrufaldi opened 5 years ago

sbarrufaldi commented 5 years ago

I tried to install bgslibrary as it shows on README: Ubuntu / OS X installation.

I cloned repository. OK Ran cd build and cmake .. OK When I ran make for first time it showed this:

/home/pi/bgslibrary/package_bgs/IBGS.h:23:16: **fatal error: cv.h: No existe el fichero o el directorio

include **

(Sorry, I got it in spanish!)

... then have modified the file IBGS.h with the route to cv.h (I think was the right) file and it started to work, but then showed this:

pi@raspberrypi: /bgslibrary $ sudo make [ 1%] Building CXX object CMakeFiles/bgslibrary_core.dir/package_bgs/AdaptiveBackgroundLearning.cpp.o /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: In member function ‘virtual void bgslibrary::algorithms::AdaptiveBackgroundLearning::saveConfig()’: /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:87:3: error: ‘CvFileStorage’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), 0, CV_STORAGE_WRITE); ^~~~~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:87:18: error: ‘fs’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), 0, CV_STORAGE_WRITE); ^~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:87:64: error: ‘CV_STORAGE_WRITE’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), 0, CV_STORAGE_WRITE); ^~~~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:87:80: error: ‘cvOpenFileStorage’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), 0, CV_STORAGE_WRITE); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:89:33: error: ‘cvWriteReal’ was not declared in this scope cvWriteReal(fs, "alpha", alpha); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:90:32: error: ‘cvWriteInt’ was not declared in this scope cvWriteInt(fs, "limit", limit); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:95:27: error: ‘cvReleaseFileStorage’ was not declared in this scope cvReleaseFileStorage(&fs); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: In member function ‘virtual void bgslibrary::algorithms::AdaptiveBackgroundLearning::loadConfig()’: /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: 100:3: error: ‘CvFileStorage’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), nullptr, CV_STORAGE_READ); ^~~~~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: 100:18: error: ‘fs’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), nullptr, CV_STORAGE_READ); ^~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: 100:70: error: ‘CV_STORAGE_READ’ was not declared in this scope CvFileStorage fs = cvOpenFileStorage(config_xml.c_str(), nullptr, CV_STORAGE_READ); ^~~~~~~ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp: 100:85: error: ‘cvOpenFileStorage’ was not declared in this scope eStorage fs = cvOpenFileStorage(config_xml.c_str(), nullptr, CV_STORAGE_READ); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:102:54: error: ‘cvReadRealByName’ was not declared in this scope alpha = cvReadRealByName(fs, nullptr, "alpha", 0.05); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:103:51: error: ‘cvReadIntByName’ was not declared in this scope limit = cvReadIntByName(fs, nullptr, "limit", -1); ^ /home/pi/bgslibrary/package_bgs/AdaptiveBackgroundLearning.cpp:108:27: error: ‘cvReleaseFileStorage’ was not declared in this scope cvReleaseFileStorage(&fs); ^ CMakeFiles/bgslibrary_core.dir/build.make:62: fallo en las instrucciones para el objetivo 'CMakeFiles/bgslibrary_core.dir/package_bgs/AdaptiveBackgroundLearning.cpp.o' make[2]: [CMakeFiles/bgslibrary_core.dir/package_bgs/AdaptiveBackgroundLearning.cpp.o] Error 1 CMakeFiles/Makefile2:141: fallo en las instrucciones para el objetivo 'CMakeFiles/bgslibrary_core.dir/all' make[1]: [CMakeFiles/bgslibrary_core.dir/all] Error 2 Makefile:127: fallo en las instrucciones para el objetivo 'all' make: *** [all] Error 2

I tried to #include (route to cv modules) in IBGS.h but it doesn't works.

Anyone can help?

System information

Raspberry Pi 3 B+

andrewssobral commented 5 years ago

Hello @sbarrufaldi , I am sorry for my delayed feedback, I think this error:

/home/pi/bgslibrary/package_bgs/IBGS.h:23:16: fatal error: cv.h: No existe el fichero o el directorio
#include <cv.h>

was solved in my last commit https://github.com/andrewssobral/bgslibrary/commit/4aca9a30f89f40cf17dad1aa2e712bdfb55b2ac2

Can you test and validade if this error still occurs in the latest version of the master branch? Thanks in advance, Andrews

jafar-jabr commented 5 years ago

It still present, any result from investigation please ! @andrewssobral ................................................. UPDATE ................................................ it seems to have big conflict opencv4, many function in opencv4 their names changed since opencv3

jiapei100 commented 5 years ago

@andrewssobral Indeed, Andrews Sobral, it seems bgslibrary 2.0.0 conflicts against OpenCV4 ...