Closed Rodrigo-P closed 8 years ago
Hi @Rodrigo-P which version of OpenCV are you using?
3.1.0
Do you have tried the opencv3 branch of bgslibrary?
It gives the same error.
What OS and what version of g++ are you using?
Hi @gustavovelascoh I compiled successfully on a pre-built image with Ubuntu 14.04.4 LTS + OpenCV 3.1.0 + Python 2.7, and gcc 4.8.4. The docker image is available here: https://hub.docker.com/r/andrewssobral/bgslibrary_opencv3/
Hi @andrewssobral, I was asking to @Rodrigo-P, :).. BTW, I have successfully built it using Ubuntu 14.04.4/g++ 4.8.4 and Ubuntu 16.04./g++ 5.3
Thank you @gustavovelascoh ;)
My g++ is 4.8.4 and i'm using ubuntu 14.04 LTS
Hi @Rodrigo-P, one question, the errors when you compile the opencv3 branch are the same of posted initially? because the master branch of bgslibrary is only for opencv 2.4.x.
Usually if you compile the master branch with OpenCV 3 you will get:
[ 1%] Building CXX object CMakeFiles/bgs.dir/FrameProcessor.cpp.o In file included from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:29:0, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV1BGS.h:30:3: error: ‘BackgroundSubtractorMOG’ in namespace ‘cv’ does not name a type cv::BackgroundSubtractorMOG mog; ^
This is because the cv::BackgroundSubtractorMOG was removed from OpenCV 3 as you can see here:
cv has no member BackgroundSubtractorMOG
http://stackoverflow.com/questions/28213670/cv-has-no-member-backgroundsubtractormog
To fix this, you need to use the opencv3 branch of bgslibrary. In this branch the MixtureOfGaussianV1BGS algorithm was disabled (and some other issues was fixed also).
'[ 1%] Building CXX object CMakeFiles/bgs.dir/FrameProcessor.cpp.o In file included from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:29:0, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV1BGS.h:30:3: error: ‘BackgroundSubtractorMOG’ in namespace ‘cv’ does not name a type cv::BackgroundSubtractorMOG mog; ^ In file included from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:30:0, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV2BGS.h:30:32: error: cannot declare field ‘MixtureOfGaussianV2BGS::mog’ to be of abstract type ‘cv::BackgroundSubtractorMOG2’ cv::BackgroundSubtractorMOG2 mog; ^ In file included from /usr/local/include/opencv2/video.hpp:57:0, from /usr/local/include/opencv2/opencv.hpp:49, from /home/rodrigo/Downloads/bgslibrary/IFrameProcessor.h:19, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:20, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /usr/local/include/opencv2/video/background_segm.hpp:90:20: note: because the following virtual functions are pure within ‘cv::BackgroundSubtractorMOG2’: class CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor ^ /usr/local/include/opencv2/video/background_segm.hpp:72:26: note: virtual void cv::BackgroundSubtractor::apply(cv::InputArray, cv::OutputArray, double) CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:81:26: note: virtual void cv::BackgroundSubtractor::getBackgroundImage(cv::OutputArray) const CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:95:25: note: virtual int cv::BackgroundSubtractorMOG2::getHistory() const CV_WRAP virtual int getHistory() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:98:26: note: virtual void cv::BackgroundSubtractorMOG2::setHistory(int) CV_WRAP virtual void setHistory(int history) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:102:25: note: virtual int cv::BackgroundSubtractorMOG2::getNMixtures() const CV_WRAP virtual int getNMixtures() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:107:26: note: virtual void cv::BackgroundSubtractorMOG2::setNMixtures(int) CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization! ^ /usr/local/include/opencv2/video/background_segm.hpp:115:28: note: virtual double cv::BackgroundSubtractorMOG2::getBackgroundRatio() const CV_WRAP virtual double getBackgroundRatio() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:118:26: note: virtual void cv::BackgroundSubtractorMOG2::setBackgroundRatio(double) CV_WRAP virtual void setBackgroundRatio(double ratio) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:125:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarThreshold() const CV_WRAP virtual double getVarThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:128:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarThreshold(double) CV_WRAP virtual void setVarThreshold(double varThreshold) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:138:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarThresholdGen() const CV_WRAP virtual double getVarThresholdGen() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:141:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarThresholdGen(double) CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:145:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarInit() const CV_WRAP virtual double getVarInit() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:148:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarInit(double) CV_WRAP virtual void setVarInit(double varInit) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:150:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarMin() const CV_WRAP virtual double getVarMin() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:151:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarMin(double) CV_WRAP virtual void setVarMin(double varMin) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:153:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarMax() const CV_WRAP virtual double getVarMax() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:154:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarMax(double) CV_WRAP virtual void setVarMax(double varMax) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:162:28: note: virtual double cv::BackgroundSubtractorMOG2::getComplexityReductionThreshold() const CV_WRAP virtual double getComplexityReductionThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:165:26: note: virtual void cv::BackgroundSubtractorMOG2::setComplexityReductionThreshold(double) CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:172:26: note: virtual bool cv::BackgroundSubtractorMOG2::getDetectShadows() const CV_WRAP virtual bool getDetectShadows() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:175:26: note: virtual void cv::BackgroundSubtractorMOG2::setDetectShadows(bool) CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:182:25: note: virtual int cv::BackgroundSubtractorMOG2::getShadowValue() const CV_WRAP virtual int getShadowValue() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:185:26: note: virtual void cv::BackgroundSubtractorMOG2::setShadowValue(int) CV_WRAP virtual void setShadowValue(int value) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:194:28: note: virtual double cv::BackgroundSubtractorMOG2::getShadowThreshold() const CV_WRAP virtual double getShadowThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:197:26: note: virtual void cv::BackgroundSubtractorMOG2::setShadowThreshold(double) CV_WRAP virtual void setShadowThreshold(double threshold) = 0; ^ make[2]: * [CMakeFiles/bgs.dir/FrameProcessor.cpp.o] Erro 1 make[1]: * [CMakeFiles/bgs.dir/all] Erro 2 make: \ [all] Erro 2' This is the error with the opencv3 branch
There is something wrong. Can you please compare your /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV1BGS.h
file with this https://github.com/andrewssobral/bgslibrary/blob/opencv3/package_bgs/MixtureOfGaussianV1BGS.h
It's the same.
I updated the cmake files from bgslibrary for both opencv 2 and 3 branches. Please, can you delete your bgslibrary folder and try again by:
git clone https://github.com/andrewssobral/bgslibrary.git -b opencv3
cd bgslibrary/build/
cmake ..
make
cd ..
chmod +x run_video.sh run_camera.sh run_demo.sh
./run_video.sh
./run_camera.sh
./run_demo.sh
This is my output (without warnings):
root@9d932484f0d2:~# git clone https://github.com/andrewssobral/bgslibrary.git -b opencv3
Cloning into 'bgslibrary'...
remote: Counting objects: 1498, done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 1498 (delta 14), reused 0 (delta 0), pack-reused 1457
Receiving objects: 100% (1498/1498), 76.78 MiB | 3.45 MiB/s, done.
Resolving deltas: 100% (812/812), done.
Checking connectivity... done.
root@9d932484f0d2:~# cd bgslibrary/build/
root@9d932484f0d2:~/bgslibrary/build# cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- OpenCV library status:
-- version: 3.1.0
-- libraries: opencv_xphoto;opencv_xobjdetect;opencv_ximgproc;opencv_xfeatures2d;opencv_tracking;opencv_text;opencv_surface_matching;opencv_structured_light;opencv_stereo;opencv_saliency;opencv_rgbd;opencv_reg;opencv_plot;opencv_optflow;opencv_line_descriptor;opencv_hdf;opencv_fuzzy;opencv_face;opencv_dpm;opencv_dnn;opencv_datasets;opencv_ccalib;opencv_bioinspired;opencv_bgsegm;opencv_aruco;opencv_videostab;opencv_videoio;opencv_video;opencv_superres;opencv_stitching;opencv_shape;opencv_photo;opencv_objdetect;opencv_ml;opencv_imgproc;opencv_imgcodecs;opencv_highgui;opencv_flann;opencv_features2d;opencv_core;opencv_calib3d
-- include path: /usr/local/include/opencv;/usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /root/bgslibrary/build
root@9d932484f0d2:~/bgslibrary/build# make
[ 1%] Building CXX object CMakeFiles/bgs.dir/FrameProcessor.cpp.o
[ 2%] Building CXX object CMakeFiles/bgs.dir/PreProcessor.cpp.o
[ 3%] Building CXX object CMakeFiles/bgs.dir/VideoAnalysis.cpp.o
[ 4%] Building CXX object CMakeFiles/bgs.dir/VideoCapture.cpp.o
[ 5%] Building CXX object CMakeFiles/bgs.dir/package_bgs/StaticFrameDifferenceBGS.cpp.o
[ 7%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/LOBSTER.cpp.o
[ 8%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/BackgroundSubtractorLBSP.cpp.o
[ 9%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/LBSP.cpp.o
[ 10%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/BackgroundSubtractorSuBSENSE.cpp.o
[ 11%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/BackgroundSubtractorLOBSTER.cpp.o
[ 12%] Building CXX object CMakeFiles/bgs.dir/package_bgs/pl/SuBSENSE.cpp.o
[ 14%] Building CXX object CMakeFiles/bgs.dir/package_bgs/sjn/SJN_MultiCueBGS.cpp.o
[ 15%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/Eigenbackground.cpp.o
[ 16%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPMeanBGS.cpp.o
[ 17%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/MeanBGS.cpp.o
[ 18%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/ZivkovicAGMM.cpp.o
[ 20%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPPratiMediodBGS.cpp.o
[ 21%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPAdaptiveMedianBGS.cpp.o
[ 22%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/AdaptiveMedianBGS.cpp.o
[ 23%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPGrimsonGMMBGS.cpp.o
[ 24%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/GrimsonGMM.cpp.o
[ 25%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPEigenbackgroundBGS.cpp.o
[ 27%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPZivkovicAGMMBGS.cpp.o
[ 28%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/TextureBGS.cpp.o
[ 29%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/Error.cpp.o
[ 30%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/PratiMediodBGS.cpp.o
[ 31%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPTextureBGS.cpp.o
[ 32%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/WrenGA.cpp.o
[ 34%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/DPWrenGABGS.cpp.o
[ 35%] Building CXX object CMakeFiles/bgs.dir/package_bgs/dp/Image.cpp.o
[ 36%] Building CXX object CMakeFiles/bgs.dir/package_bgs/MixtureOfGaussianV2BGS.cpp.o
[ 37%] Building CXX object CMakeFiles/bgs.dir/package_bgs/db/IndependentMultimodalBGS.cpp.o
[ 38%] Building CXX object CMakeFiles/bgs.dir/package_bgs/db/imbs.cpp.o
[ 40%] Building CXX object CMakeFiles/bgs.dir/package_bgs/KNNBGS.cpp.o
[ 41%] Building CXX object CMakeFiles/bgs.dir/package_bgs/WeightedMovingVarianceBGS.cpp.o
[ 42%] Building CXX object CMakeFiles/bgs.dir/package_bgs/WeightedMovingMeanBGS.cpp.o
[ 43%] Building CXX object CMakeFiles/bgs.dir/package_bgs/my/MyBGS.cpp.o
[ 44%] Building CXX object CMakeFiles/bgs.dir/package_bgs/AdaptiveBackgroundLearning.cpp.o
[ 45%] Building CXX object CMakeFiles/bgs.dir/package_bgs/GMG.cpp.o
[ 47%] Building CXX object CMakeFiles/bgs.dir/package_bgs/AdaptiveSelectiveBackgroundLearning.cpp.o
[ 48%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ae/KDE.cpp.o
[ 49%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ae/NPBGSubtractor.cpp.o
[ 50%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ae/NPBGmodel.cpp.o
[ 51%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ae/KernelTable.cpp.o
[ 52%] Building CXX object CMakeFiles/bgs.dir/package_bgs/bl/sdLaMa091.cpp.o
[ 54%] Building CXX object CMakeFiles/bgs.dir/package_bgs/bl/SigmaDeltaBGS.cpp.o
[ 55%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/LBFuzzyAdaptiveSOM.cpp.o
[ 56%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModelFuzzyGauss.cpp.o
[ 57%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModelMog.cpp.o
[ 58%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModelFuzzySom.cpp.o
[ 60%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModelSom.cpp.o
[ 61%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/LBMixtureOfGaussians.cpp.o
[ 62%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/LBFuzzyGaussian.cpp.o
[ 63%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/LBAdaptiveSOM.cpp.o
[ 64%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModel.cpp.o
[ 65%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/BGModelGauss.cpp.o
[ 67%] Building CXX object CMakeFiles/bgs.dir/package_bgs/lb/LBSimpleGaussian.cpp.o
[ 68%] Building CXX object CMakeFiles/bgs.dir/package_bgs/MixtureOfGaussianV1BGS.cpp.o
[ 69%] Building CXX object CMakeFiles/bgs.dir/package_bgs/FrameDifferenceBGS.cpp.o
[ 70%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/LbpMrf.cpp.o
[ 71%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/graph.cpp.o
[ 72%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/MotionDetection.cpp.o
[ 74%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/MEImage.cpp.o
[ 75%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/maxflow.cpp.o
[ 76%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/MEDefs.cpp.o
[ 77%] Building CXX object CMakeFiles/bgs.dir/package_bgs/ck/MEHistogram.cpp.o
[ 78%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/PixelUtils.cpp.o
[ 80%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/MRF.cpp.o
[ 81%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FGMM.cpp.o
[ 82%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FGMM_UM.cpp.o
[ 83%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FMRF_UM.cpp.o
[ 84%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FMRF.cpp.o
[ 85%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FGMM_UV.cpp.o
[ 87%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/FuzzyUtils.cpp.o
[ 88%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/FuzzyChoquetIntegral.cpp.o
[ 89%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/FuzzySugenoIntegral.cpp.o
[ 90%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/PerformanceUtils.cpp.o
[ 91%] Building CXX object CMakeFiles/bgs.dir/package_bgs/tb/T2FMRF_UV.cpp.o
[ 92%] Building CXX object CMakeFiles/bgs.dir/package_bgs/av/TBackgroundVuMeter.cpp.o
[ 94%] Building CXX object CMakeFiles/bgs.dir/package_bgs/av/TBackground.cpp.o
[ 95%] Building CXX object CMakeFiles/bgs.dir/package_bgs/av/VuMeter.cpp.o
[ 96%] Building CXX object CMakeFiles/bgs.dir/package_analysis/ForegroundMaskAnalysis.cpp.o
Linking CXX shared library libbgs.so
[ 96%] Built target bgs
Scanning dependencies of target bgs_bin
[ 97%] Building CXX object CMakeFiles/bgs_bin.dir/Main.cpp.o
Linking CXX executable bgs
[ 97%] Built target bgs_bin
Scanning dependencies of target bgs_demo
[ 98%] Building CXX object CMakeFiles/bgs_demo.dir/Demo.cpp.o
Linking CXX executable bgs_demo
[ 98%] Built target bgs_demo
Scanning dependencies of target bgs_demo2
[100%] Building CXX object CMakeFiles/bgs_demo2.dir/Demo2.cpp.o
Linking CXX executable bgs_demo2
[100%] Built target bgs_demo2
root@9d932484f0d2:~/bgslibrary/build# cd ..
root@9d932484f0d2:~/bgslibrary# chmod +x run_video.sh run_camera.sh run_demo.sh
root@9d932484f0d2:~/bgslibrary# ./run_video.sh
Background Subtraction Library v1.9.2
Using OpenCV version 3.1.0
VideoAnalysis()
VideoCapture()
FrameProcessor()
PreProcessor()
FrameDifferenceBGS()
Openning: dataset/video.avi
OK
input->fps:30
loopDelay:33.3333
Press 'ESC' to stop...
root@9d932484f0d2:~/bgslibrary#
It gives this error now: `rodrigo@rodrigo-X451CA:~/Downloads/bgslibrary/build$ cmake .. -- OpenCV library status: -- version: 3.1.0 -- libraries: opencv_videostab;opencv_videoio;opencv_video;opencv_superres;opencv_stitching;opencv_shape;opencv_photo;opencv_objdetect;opencv_ml;opencv_imgproc;opencv_imgcodecs;opencv_highgui;opencv_flann;opencv_features2d;opencv_core;opencv_calib3d -- include path: /usr/local/include/opencv;/usr/local/include CMake Error at CMakeLists.txt:28 (message): OpenCV version is not compatible: 3.1.0
-- Configuring incomplete, errors occurred! See also "/home/rodrigo/Downloads/bgslibrary/build/CMakeFiles/CMakeOutput.log".`
That's what I thought: OpenCV version is not compatible: 3.1.0
You still compiling the wrong branch of the bgslibrary. This message appears when you are compiling the master branch of the bgslibrary with opencv 3.1.0.
https://github.com/andrewssobral/bgslibrary/blob/master/CMakeLists.txt
Note that the cmake file from the opencv3 branch is different:
https://github.com/andrewssobral/bgslibrary/blob/opencv3/CMakeLists.txt
There are something wrong in your machine, because you are always using the master branch instead of the opencv3 branch.
git clone https://github.com/andrewssobral/bgslibrary.git
git clone https://github.com/andrewssobral/bgslibrary.git -b opencv3
If you are running git clone https://github.com/andrewssobral/bgslibrary.git -b opencv3
and getting the master branch instead of the opencv3 branch is that there is something wrong with your git clone.
Note that OpenCV version is not compatible: 3.1.0
doesn't exists in the cmake file from opencv3 branch.
It's working now. I downloaded the zip file and got the right version.
Just one more thing. I'm going to play around with other videos, how can I make the window resizable?
You can change the parameter input_resize_percent
in the VideoCapture.xml file.
<input_resize_percent>100</input_resize_percent>
is for 100% (original video resolution).
<input_resize_percent>50</input_resize_percent>
is for resizing to 50% of the original video resolution.
Thank you.
I'm trying to install the library and I get this error during make
[ 1%] Building CXX object CMakeFiles/bgs.dir/FrameProcessor.cpp.o In file included from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:29:0, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV1BGS.h:30:3: error: ‘BackgroundSubtractorMOG’ in namespace ‘cv’ does not name a type cv::BackgroundSubtractorMOG mog; ^ In file included from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:30:0, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /home/rodrigo/Downloads/bgslibrary/package_bgs/MixtureOfGaussianV2BGS.h:30:32: error: cannot declare field ‘MixtureOfGaussianV2BGS::mog’ to be of abstract type ‘cv::BackgroundSubtractorMOG2’ cv::BackgroundSubtractorMOG2 mog; ^ In file included from /usr/local/include/opencv2/video.hpp:57:0, from /usr/local/include/opencv2/opencv.hpp:49, from /home/rodrigo/Downloads/bgslibrary/IFrameProcessor.h:19, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.h:20, from /home/rodrigo/Downloads/bgslibrary/FrameProcessor.cpp:17: /usr/local/include/opencv2/video/background_segm.hpp:90:20: note: because the following virtual functions are pure within ‘cv::BackgroundSubtractorMOG2’: class CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor ^ /usr/local/include/opencv2/video/background_segm.hpp:72:26: note: virtual void cv::BackgroundSubtractor::apply(cv::InputArray, cv::OutputArray, double) CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:81:26: note: virtual void cv::BackgroundSubtractor::getBackgroundImage(cv::OutputArray) const CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:95:25: note: virtual int cv::BackgroundSubtractorMOG2::getHistory() const CV_WRAP virtual int getHistory() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:98:26: note: virtual void cv::BackgroundSubtractorMOG2::setHistory(int) CV_WRAP virtual void setHistory(int history) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:102:25: note: virtual int cv::BackgroundSubtractorMOG2::getNMixtures() const CV_WRAP virtual int getNMixtures() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:107:26: note: virtual void cv::BackgroundSubtractorMOG2::setNMixtures(int) CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization! ^ /usr/local/include/opencv2/video/background_segm.hpp:115:28: note: virtual double cv::BackgroundSubtractorMOG2::getBackgroundRatio() const CV_WRAP virtual double getBackgroundRatio() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:118:26: note: virtual void cv::BackgroundSubtractorMOG2::setBackgroundRatio(double) CV_WRAP virtual void setBackgroundRatio(double ratio) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:125:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarThreshold() const CV_WRAP virtual double getVarThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:128:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarThreshold(double) CV_WRAP virtual void setVarThreshold(double varThreshold) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:138:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarThresholdGen() const CV_WRAP virtual double getVarThresholdGen() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:141:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarThresholdGen(double) CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:145:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarInit() const CV_WRAP virtual double getVarInit() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:148:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarInit(double) CV_WRAP virtual void setVarInit(double varInit) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:150:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarMin() const CV_WRAP virtual double getVarMin() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:151:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarMin(double) CV_WRAP virtual void setVarMin(double varMin) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:153:28: note: virtual double cv::BackgroundSubtractorMOG2::getVarMax() const CV_WRAP virtual double getVarMax() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:154:26: note: virtual void cv::BackgroundSubtractorMOG2::setVarMax(double) CV_WRAP virtual void setVarMax(double varMax) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:162:28: note: virtual double cv::BackgroundSubtractorMOG2::getComplexityReductionThreshold() const CV_WRAP virtual double getComplexityReductionThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:165:26: note: virtual void cv::BackgroundSubtractorMOG2::setComplexityReductionThreshold(double) CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:172:26: note: virtual bool cv::BackgroundSubtractorMOG2::getDetectShadows() const CV_WRAP virtual bool getDetectShadows() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:175:26: note: virtual void cv::BackgroundSubtractorMOG2::setDetectShadows(bool) CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:182:25: note: virtual int cv::BackgroundSubtractorMOG2::getShadowValue() const CV_WRAP virtual int getShadowValue() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:185:26: note: virtual void cv::BackgroundSubtractorMOG2::setShadowValue(int) CV_WRAP virtual void setShadowValue(int value) = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:194:28: note: virtual double cv::BackgroundSubtractorMOG2::getShadowThreshold() const CV_WRAP virtual double getShadowThreshold() const = 0; ^ /usr/local/include/opencv2/video/background_segm.hpp:197:26: note: virtual void cv::BackgroundSubtractorMOG2::setShadowThreshold(double) CV_WRAP virtual void setShadowThreshold(double threshold) = 0; ^ make[2]: ** [CMakeFiles/bgs.dir/FrameProcessor.cpp.o] Erro 1 make[1]: ** [CMakeFiles/bgs.dir/all] Erro 2 make: ** [all] Erro 2