Permalink
Browse files

remove opencv1 dependencies.

bgslib now compiles on Linux systems without libcv-dev installed.
Almost all calls and incudes have been ported to opencv2, some are
still used via opencv2/legacy/compat.hpp (e.g. cvFillImage).
Hope I got everything fine also for mingw since I removed two
mingw related defines.
I don't have a mingw install to check it against.
  • Loading branch information...
1 parent 233a37e commit 5ed8f7797b543bd42511a19e7e4c1716eaf4e798 @holgerfriedrich holgerfriedrich committed Jul 22, 2014
Showing with 133 additions and 140 deletions.
  1. +2 −2 Demo.cpp
  2. +2 −2 Demo2.cpp
  3. +1 −0 FrameProcessor.cpp
  4. +1 −1 IFrameProcessor.h
  5. +2 −2 PreProcessor.h
  6. +2 −2 VideoCapture.h
  7. +2 −2 demos/DemoFrameDifferenceBGS.cpp
  8. +2 −2 demos/DemoMultiLayerBGS.cpp
  9. +2 −2 package_analysis/ForegroundMaskAnalysis.h
  10. +2 −2 package_bgs/AdaptiveBackgroundLearning.h
  11. +2 −2 package_bgs/AdaptiveSelectiveBackgroundLearning.h
  12. +2 −2 package_bgs/FrameDifferenceBGS.h
  13. +1 −1 package_bgs/IBGS.h
  14. +2 −2 package_bgs/MixtureOfGaussianV1BGS.h
  15. +2 −2 package_bgs/MixtureOfGaussianV2BGS.h
  16. +2 −2 package_bgs/StaticFrameDifferenceBGS.h
  17. +2 −2 package_bgs/WeightedMovingMeanBGS.h
  18. +2 −2 package_bgs/WeightedMovingVarianceBGS.h
  19. +2 −2 package_bgs/ae/KDE.h
  20. +4 −4 package_bgs/av/TBackground.cpp
  21. +2 −2 package_bgs/av/TBackground.h
  22. +5 −5 package_bgs/av/TBackgroundVuMeter.cpp
  23. +2 −2 package_bgs/av/VuMeter.h
  24. +2 −2 package_bgs/bl/SigmaDeltaBGS.h
  25. +1 −5 package_bgs/ck/MEHistogram.cpp
  26. +1 −7 package_bgs/ck/MEImage.cpp
  27. +1 −5 package_bgs/ck/MotionDetection.cpp
  28. +2 −2 package_bgs/db/IndependentMultimodalBGS.h
  29. +2 −2 package_bgs/dp/DPAdaptiveMedianBGS.h
  30. +2 −2 package_bgs/dp/DPEigenbackgroundBGS.h
  31. +2 −2 package_bgs/dp/DPGrimsonGMMBGS.h
  32. +2 −2 package_bgs/dp/DPMeanBGS.h
  33. +2 −2 package_bgs/dp/DPPratiMediodBGS.h
  34. +2 −2 package_bgs/dp/DPTextureBGS.h
  35. +2 −2 package_bgs/dp/DPWrenGABGS.h
  36. +2 −2 package_bgs/dp/DPZivkovicAGMMBGS.h
  37. +3 −3 package_bgs/dp/Image.h
  38. +1 −1 package_bgs/jmo/BGS.h
  39. +1 −1 package_bgs/jmo/BackgroundSubtractionAPI.h
  40. +1 −0 package_bgs/jmo/BlobExtraction.cpp
  41. +2 −1 package_bgs/jmo/BlobResult.h
  42. +1 −0 package_bgs/jmo/CMultiLayerBGS.cpp
  43. +1 −1 package_bgs/jmo/LocalBinaryPattern.h
  44. +2 −2 package_bgs/jmo/MultiLayerBGS.h
  45. +1 −1 package_bgs/jmo/OpenCvDataConversion.h
  46. +1 −1 package_bgs/jmo/blob.cpp
  47. +2 −2 package_bgs/jmo/blob.h
  48. +1 −1 package_bgs/lb/BGModel.h
  49. +2 −2 package_bgs/lb/LBAdaptiveSOM.h
  50. +2 −2 package_bgs/lb/LBFuzzyAdaptiveSOM.h
  51. +2 −2 package_bgs/lb/LBFuzzyGaussian.h
  52. +2 −2 package_bgs/lb/LBMixtureOfGaussians.h
  53. +2 −2 package_bgs/lb/LBSimpleGaussian.h
  54. +1 −1 package_bgs/lb/Types.h
  55. +2 −2 package_bgs/my/MyBGS.h
  56. +2 −2 package_bgs/sjn/SJN_MultiCueBGS.h
  57. +2 −1 package_bgs/tb/FuzzyChoquetIntegral.cpp
  58. +2 −2 package_bgs/tb/FuzzyChoquetIntegral.h
  59. +2 −1 package_bgs/tb/FuzzySugenoIntegral.cpp
  60. +2 −2 package_bgs/tb/FuzzySugenoIntegral.h
  61. +1 −1 package_bgs/tb/MRF.cpp
  62. +2 −1 package_bgs/tb/PerformanceUtils.cpp
  63. +2 −2 package_bgs/tb/PerformanceUtils.h
  64. +1 −1 package_bgs/tb/PixelUtils.cpp
  65. +2 −2 package_bgs/tb/PixelUtils.h
  66. +2 −2 package_bgs/tb/T2FGMM_UM.h
  67. +2 −2 package_bgs/tb/T2FGMM_UV.h
  68. +3 −3 package_bgs/tb/T2FMRF_UM.cpp
  69. +2 −2 package_bgs/tb/T2FMRF_UM.h
  70. +3 −3 package_bgs/tb/T2FMRF_UV.cpp
  71. +2 −2 package_bgs/tb/T2FMRF_UV.h
View
@@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License
along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "package_bgs/FrameDifferenceBGS.h"
#include "package_bgs/StaticFrameDifferenceBGS.h"
View
@@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License
along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "package_bgs/FrameDifferenceBGS.h"
#include "package_bgs/StaticFrameDifferenceBGS.h"
View
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#include "FrameProcessor.h"
+#include <iomanip>
namespace bgslibrary
{
View
@@ -16,7 +16,7 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
-#include <cv.h>
+#include <opencv2/opencv.hpp>
namespace bgslibrary
{
View
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
namespace bgslibrary
{
View
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "Config.h"
#include "IFrameProcessor.h"
@@ -1,6 +1,6 @@
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "package_bgs/FrameDifferenceBGS.h"
@@ -1,6 +1,6 @@
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "package_bgs/jmo/MultiLayerBGS.h"
@@ -18,8 +18,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#include <iostream>
#include <string>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
namespace bgslibrary
{
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
View
@@ -16,7 +16,7 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
-#include <cv.h>
+#include <opencv2/opencv.hpp>
class IBGS
{
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include <opencv2/video/background_segm.hpp>
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include <opencv2/video/background_segm.hpp>
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "IBGS.h"
View
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "NPBGSubtractor.h"
#include "../IBGS.h"
@@ -70,22 +70,22 @@ int TBackground::Init(IplImage * pSource)
bool TBackground::isInitOk(IplImage * pSource, IplImage *pBackground, IplImage *pMotionMask)
{
- bool bResult = TRUE;
+ bool bResult = true;
int nbl, nbc;
if(pSource == NULL || pSource->nChannels != 1 || pSource->depth != IPL_DEPTH_8U)
- bResult = FALSE;
+ bResult = false;
if(bResult)
{
nbl = pSource->height;
nbc = pSource->width;
if(pBackground == NULL || pBackground->width != nbc || pBackground->height != nbl || pBackground->imageSize != pSource->imageSize)
- bResult = FALSE;
+ bResult = false;
if(pMotionMask == NULL || pMotionMask->width != nbc || pMotionMask->height != nbl || pMotionMask->imageSize != pSource->imageSize)
- bResult = FALSE;
+ bResult = false;
}
return bResult;
@@ -24,8 +24,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
class TBackground
{
@@ -227,24 +227,24 @@ int TBackgroundVuMeter::Init(IplImage * pSource)
bool TBackgroundVuMeter::isInitOk(IplImage * pSource, IplImage *pBackground, IplImage *pMotionMask)
{
- bool bResult = TRUE;
+ bool bResult = true;
int i;
int nbl, nbc;
bResult = TBackground::isInitOk(pSource, pBackground, pMotionMask);
if(pSource == NULL)
- bResult = FALSE;
+ bResult = false;
if(m_nBinSize == 0)
- bResult = FALSE;
+ bResult = false;
if(bResult)
{
i = (m_nBinSize != 0) ? 256 / m_nBinSize : 0;
if(i != m_nBinCount || m_pHist == NULL)
- bResult = FALSE;
+ bResult = false;
}
if(bResult)
@@ -255,7 +255,7 @@ bool TBackgroundVuMeter::isInitOk(IplImage * pSource, IplImage *pBackground, Ipl
for(i = 0; i < m_nBinCount; ++i)
{
if(m_pHist[i] == NULL || m_pHist[i]->width != nbc || m_pHist[i]->height != nbl)
- bResult = FALSE;
+ bResult = false;
}
}
View
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "TBackgroundVuMeter.h"
#include "../IBGS.h"
@@ -1,8 +1,8 @@
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "../IBGS.h"
@@ -27,11 +27,7 @@
#include "MEHistogram.hpp"
-#if defined(__MINGW32__) || defined(__MINGW64__)
-#include <cv.h>
-#else
-#include <opencv/cv.h>
-#endif
+#include <opencv2/opencv.hpp>
#include "MEDefs.hpp"
#include "MEImage.hpp"
@@ -21,13 +21,7 @@
#include "MEImage.hpp"
-#if defined(__MINGW32__) || defined(__MINGW64__)
-#include <cv.h>
-#include <highgui.h>
-#else
-#include <opencv/cv.h>
-#include <opencv/highgui.h>
-#endif
+#include <opencv2/opencv.hpp>
#include "MEDefs.hpp"
@@ -25,11 +25,7 @@
#include "graph.h"
-#if defined(__MINGW32__) || defined(__MINGW64__)
-#include <cvaux.h>
-#else
-#include <opencv/cvaux.h>
-#endif
+#include <opencv2/opencv.hpp>
#include "MEHistogram.hpp"
#include "MEImage.hpp"
@@ -1,7 +1,7 @@
#pragma once
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "imbs.hpp"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "../IBGS.h"
#include "AdaptiveMedianBGS.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "../IBGS.h"
#include "Eigenbackground.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "../IBGS.h"
#include "GrimsonGMM.h"
@@ -17,8 +17,8 @@ along with BGSLibrary. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <iostream>
-#include <cv.h>
-#include <highgui.h>
+#include <opencv2/opencv.hpp>
+
#include "../IBGS.h"
#include "MeanBGS.h"
Oops, something went wrong.

0 comments on commit 5ed8f77

Please sign in to comment.