diff --git a/bgslibrary/algorithms/FuzzyChoquetIntegral.cpp b/bgslibrary/algorithms/FuzzyChoquetIntegral.cpp
index 18494f85dc9681f4f771856a281a9dc561e070a7..09e3b68a825471aa66ff98e0def46257fdd81e57 100644
--- a/bgslibrary/algorithms/FuzzyChoquetIntegral.cpp
+++ b/bgslibrary/algorithms/FuzzyChoquetIntegral.cpp
@@ -1,7 +1,5 @@
 #include "FuzzyChoquetIntegral.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 FuzzyChoquetIntegral::FuzzyChoquetIntegral() :
@@ -189,5 +187,3 @@ void FuzzyChoquetIntegral::load_config(cv::FileStorage &fs) {
   fs["smooth"] >> smooth;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/FuzzyChoquetIntegral.h b/bgslibrary/algorithms/FuzzyChoquetIntegral.h
index bc8c408349524fe0d400c2f6fa856aca25f6282d..ba4ae755f4d1003099a66eaab0e096b784764d95 100644
--- a/bgslibrary/algorithms/FuzzyChoquetIntegral.h
+++ b/bgslibrary/algorithms/FuzzyChoquetIntegral.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "../tools/FuzzyUtils.h"
 
 namespace bgslibrary
@@ -39,5 +35,3 @@ namespace bgslibrary
     bgs_register(FuzzyChoquetIntegral);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/FuzzySugenoIntegral.cpp b/bgslibrary/algorithms/FuzzySugenoIntegral.cpp
index ff03451130e898c102556eb9f52d8dd261d221fc..c4b96daacd7831309901b1f51547d61d6fa52f65 100644
--- a/bgslibrary/algorithms/FuzzySugenoIntegral.cpp
+++ b/bgslibrary/algorithms/FuzzySugenoIntegral.cpp
@@ -1,7 +1,5 @@
 #include "FuzzySugenoIntegral.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 FuzzySugenoIntegral::FuzzySugenoIntegral() :
@@ -188,5 +186,3 @@ void FuzzySugenoIntegral::load_config(cv::FileStorage &fs) {
   fs["smooth"] >> smooth;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/FuzzySugenoIntegral.h b/bgslibrary/algorithms/FuzzySugenoIntegral.h
index dbde2c36a3de96cee7f811539d43e6e8eda2a34a..0bb549085d5cfb4c461c071d0d4abe9cbe2ac4d1 100644
--- a/bgslibrary/algorithms/FuzzySugenoIntegral.h
+++ b/bgslibrary/algorithms/FuzzySugenoIntegral.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "../tools/FuzzyUtils.h"
 
 namespace bgslibrary
@@ -39,5 +35,3 @@ namespace bgslibrary
     bgs_register(FuzzySugenoIntegral);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/IndependentMultimodal.cpp b/bgslibrary/algorithms/IndependentMultimodal.cpp
index 10d3ccaba2497d565aeec55facdd710bfd14ae3f..6297f01ba797367ff478b91870af50dc72527f6e 100644
--- a/bgslibrary/algorithms/IndependentMultimodal.cpp
+++ b/bgslibrary/algorithms/IndependentMultimodal.cpp
@@ -1,7 +1,5 @@
 #include "IndependentMultimodal.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 IndependentMultimodal::IndependentMultimodal() : 
@@ -49,5 +47,3 @@ void IndependentMultimodal::load_config(cv::FileStorage &fs) {
   fs["fps"] >> fps;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/IndependentMultimodal.h b/bgslibrary/algorithms/IndependentMultimodal.h
index 0d05da265c0d37bdcdaa5c0530e213faf261145a..3af489edec359d7a955588652c8f6f214f5b49dc 100644
--- a/bgslibrary/algorithms/IndependentMultimodal.h
+++ b/bgslibrary/algorithms/IndependentMultimodal.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "IMBS/IMBS.hpp"
 
 namespace bgslibrary
@@ -31,5 +27,3 @@ namespace bgslibrary
     bgs_register(IndependentMultimodal);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/KDE.cpp b/bgslibrary/algorithms/KDE.cpp
index ac6832a1dcf63dec35f79c8901ca42dbd97c9229..faca1ef063bfcbaf208880a5be6bfb47fd20f37b 100644
--- a/bgslibrary/algorithms/KDE.cpp
+++ b/bgslibrary/algorithms/KDE.cpp
@@ -1,7 +1,5 @@
 #include "KDE.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 KDE::KDE() :
@@ -104,5 +102,3 @@ void KDE::load_config(cv::FileStorage &fs) {
   fs["alpha"] >> alpha;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/KDE.h b/bgslibrary/algorithms/KDE.h
index c5bfa05f1098bb91eb02be0476a1ed6e05bfe3ac..acb7acea9abfe709aab9a069ba3d87eed9fe2838 100644
--- a/bgslibrary/algorithms/KDE.h
+++ b/bgslibrary/algorithms/KDE.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "KDE/NPBGSubtractor.h"
 
 namespace bgslibrary
@@ -45,5 +41,3 @@ namespace bgslibrary
     bgs_register(KDE);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBAdaptiveSOM.cpp b/bgslibrary/algorithms/LBAdaptiveSOM.cpp
index 342d3804775cc7eccb63f1957c02331c21ab7f0d..ba986896eb0d30b930cc8f6406bd11d3399bcf85 100644
--- a/bgslibrary/algorithms/LBAdaptiveSOM.cpp
+++ b/bgslibrary/algorithms/LBAdaptiveSOM.cpp
@@ -1,7 +1,5 @@
 #include "LBAdaptiveSOM.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 LBAdaptiveSOM::LBAdaptiveSOM() :
@@ -76,5 +74,3 @@ void LBAdaptiveSOM::load_config(cv::FileStorage &fs) {
   fs["trainingSteps"] >> trainingSteps;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBAdaptiveSOM.h b/bgslibrary/algorithms/LBAdaptiveSOM.h
index 97ba8e280d3abb026023f1055a0d28d8cfa6f316..9faed791c83b404e8529e074d5682b82cbf6bb83 100644
--- a/bgslibrary/algorithms/LBAdaptiveSOM.h
+++ b/bgslibrary/algorithms/LBAdaptiveSOM.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "lb/BGModelSom.h"
 
 namespace bgslibrary
@@ -35,5 +31,3 @@ namespace bgslibrary
     bgs_register(LBAdaptiveSOM);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.cpp b/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.cpp
index 78d7121bef56cea2ea04859e77adbd7ea941f54c..e907f7c09fe600717dce1f997a57affb4b167153 100644
--- a/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.cpp
+++ b/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.cpp
@@ -1,7 +1,5 @@
 #include "LBFuzzyAdaptiveSOM.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 LBFuzzyAdaptiveSOM::LBFuzzyAdaptiveSOM() :
@@ -75,5 +73,3 @@ void LBFuzzyAdaptiveSOM::load_config(cv::FileStorage &fs) {
   fs["trainingSteps"] >> trainingSteps;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.h b/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.h
index c819b59e9eaf9689c12ebefb150f7f31807ecd21..02bc24d4ed2bbda206e11a4ec59518ae1b011e97 100644
--- a/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.h
+++ b/bgslibrary/algorithms/LBFuzzyAdaptiveSOM.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "lb/BGModelFuzzySom.h"
 
 namespace bgslibrary
@@ -35,5 +31,3 @@ namespace bgslibrary
     bgs_register(LBFuzzyAdaptiveSOM);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBFuzzyGaussian.cpp b/bgslibrary/algorithms/LBFuzzyGaussian.cpp
index 2dd081d392027bd1e657ad9c8e3d3ed7fd0e717c..a2846a170cf24b5a72467fae4b1e53fa121b7924 100644
--- a/bgslibrary/algorithms/LBFuzzyGaussian.cpp
+++ b/bgslibrary/algorithms/LBFuzzyGaussian.cpp
@@ -1,7 +1,5 @@
 #include "LBFuzzyGaussian.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 LBFuzzyGaussian::LBFuzzyGaussian() :
@@ -72,5 +70,3 @@ void LBFuzzyGaussian::load_config(cv::FileStorage &fs) {
   fs["noiseVariance"] >> noiseVariance;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBFuzzyGaussian.h b/bgslibrary/algorithms/LBFuzzyGaussian.h
index 84e965655f93504eae2c5ed2e320c969cca313fc..549b0984c5796ffc07a340804f50506217abf93d 100644
--- a/bgslibrary/algorithms/LBFuzzyGaussian.h
+++ b/bgslibrary/algorithms/LBFuzzyGaussian.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "lb/BGModelFuzzyGauss.h"
 
 namespace bgslibrary
@@ -34,5 +30,3 @@ namespace bgslibrary
     bgs_register(LBFuzzyGaussian);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBSimpleGaussian.cpp b/bgslibrary/algorithms/LBSimpleGaussian.cpp
index c9271bf7a4123bc479614619eb7434c13cb91e70..65e638f9cce59dd44520fb05c4a8c0e8d7478477 100644
--- a/bgslibrary/algorithms/LBSimpleGaussian.cpp
+++ b/bgslibrary/algorithms/LBSimpleGaussian.cpp
@@ -1,7 +1,5 @@
 #include "LBSimpleGaussian.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 LBSimpleGaussian::LBSimpleGaussian() :
@@ -68,5 +66,3 @@ void LBSimpleGaussian::load_config(cv::FileStorage &fs) {
   fs["learningRate"] >> learningRate;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/LBSimpleGaussian.h b/bgslibrary/algorithms/LBSimpleGaussian.h
index f7c2d392c67ba7d5f23d2a797507d4703acee132..e06762baa26c4ce89e7f89d053f4e8a74234d0dd 100644
--- a/bgslibrary/algorithms/LBSimpleGaussian.h
+++ b/bgslibrary/algorithms/LBSimpleGaussian.h
@@ -1,10 +1,6 @@
 #pragma once
 
 #include "IBGS.h"
-
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "lb/BGModelGauss.h"
 
 namespace bgslibrary
@@ -33,5 +29,3 @@ namespace bgslibrary
     bgs_register(LBSimpleGaussian);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/VuMeter.cpp b/bgslibrary/algorithms/VuMeter.cpp
index 032101510d59beb5865ce5736a32ec8d7a4892c2..e4803432913d26cefa918b186829d83a33e8dd81 100644
--- a/bgslibrary/algorithms/VuMeter.cpp
+++ b/bgslibrary/algorithms/VuMeter.cpp
@@ -1,7 +1,5 @@
 #include "VuMeter.h"
 
-#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3
-
 using namespace bgslibrary::algorithms;
 
 VuMeter::VuMeter() :
@@ -85,5 +83,3 @@ void VuMeter::load_config(cv::FileStorage &fs) {
   fs["threshold"] >> threshold;
   fs["showOutput"] >> showOutput;
 }
-
-#endif
diff --git a/bgslibrary/algorithms/VuMeter.h b/bgslibrary/algorithms/VuMeter.h
index 1157e4d55e4ef2b06bbd8cd11dae46554645b4be..b1992e9d57886f895a6568932c02b7687b4799f8 100644
--- a/bgslibrary/algorithms/VuMeter.h
+++ b/bgslibrary/algorithms/VuMeter.h
@@ -1,8 +1,5 @@
 #pragma once
 
-#include "opencv2/core/version.hpp"
-#if CV_MAJOR_VERSION == 2 || CV_MAJOR_VERSION == 3
-
 #include "IBGS.h"
 #include "VuMeter/TBackgroundVuMeter.h"
 
@@ -37,5 +34,3 @@ namespace bgslibrary
     bgs_register(VuMeter);
   }
 }
-
-#endif
diff --git a/bgslibrary/algorithms/algorithms.h b/bgslibrary/algorithms/algorithms.h
index 03d0527e077fe53dcd4e1bf0834f4a9576ac6f83..4a59bfaaee215f8d068a614d1864e73b55a8c2ac 100644
--- a/bgslibrary/algorithms/algorithms.h
+++ b/bgslibrary/algorithms/algorithms.h
@@ -44,6 +44,6 @@
 #include "ViBe.h"
 #include "CodeBook.h"
 
-//#include "_template_/MyBGS.h"
+// #include "_template_/MyBGS.h"
 
 using namespace bgslibrary::algorithms;
diff --git a/bgslibrary/algorithms/lb/BGModelSom.h b/bgslibrary/algorithms/lb/BGModelSom.h
index 9774fcab2d2c3a46c0cb2edd8d7a66b50144767c..6020537d3d7bbcf714370c8733ccd225e2aad0f2 100644
--- a/bgslibrary/algorithms/lb/BGModelSom.h
+++ b/bgslibrary/algorithms/lb/BGModelSom.h
@@ -12,7 +12,7 @@ namespace bgslibrary
         const int M = 3;         // width SOM (per pixel)
         const int N = 3;         // height SOM (per pixel)
         const int KERNEL = 3;    // size Gaussian kernel
-        const bool SPAN_NEIGHBORS = false; // true if update neighborhood spans different pixels			//
+        const bool SPAN_NEIGHBORS = false; // true if update neighborhood spans different pixels
         const int TRAINING_STEPS = 100;    // number of training steps
         const float EPS1 = 100.0; // model match distance during training
         const float EPS2 = 20.0;  // model match distance
@@ -43,8 +43,8 @@ namespace bgslibrary
         double m_alpha1;
         double m_alpha2;
 
-        DBLRGB** m_ppSOM;					// SOM grid
-        double** m_ppW;						// Weights
+        DBLRGB** m_ppSOM; // SOM grid
+        double** m_ppW; // Weights
 
         void Init();
         void Update();