Skip to content

Commit

Permalink
remove opencv1 dependencies.
Browse files Browse the repository at this point in the history
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
holgerfriedrich committed Jul 22, 2014
1 parent 233a37e commit 5ed8f77
Show file tree
Hide file tree
Showing 71 changed files with 133 additions and 140 deletions.
4 changes: 2 additions & 2 deletions Demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions Demo2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions FrameProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion IFrameProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions PreProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions VideoCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions demos/DemoFrameDifferenceBGS.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>


#include "package_bgs/FrameDifferenceBGS.h"

Expand Down
4 changes: 2 additions & 2 deletions demos/DemoMultiLayerBGS.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>


#include "package_bgs/jmo/MultiLayerBGS.h"

Expand Down
4 changes: 2 additions & 2 deletions package_analysis/ForegroundMaskAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/AdaptiveBackgroundLearning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/AdaptiveSelectiveBackgroundLearning.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/FrameDifferenceBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion package_bgs/IBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/MixtureOfGaussianV1BGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/MixtureOfGaussianV2BGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/StaticFrameDifferenceBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/WeightedMovingMeanBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/WeightedMovingVarianceBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/ae/KDE.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions package_bgs/av/TBackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/av/TBackground.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
10 changes: 5 additions & 5 deletions package_bgs/av/TBackgroundVuMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}
}

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/av/VuMeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/bl/SigmaDeltaBGS.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <iostream>
#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>


#include "../IBGS.h"

Expand Down
6 changes: 1 addition & 5 deletions package_bgs/ck/MEHistogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 1 addition & 7 deletions package_bgs/ck/MEImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 1 addition & 5 deletions package_bgs/ck/MotionDetection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/db/IndependentMultimodalBGS.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include <cv.h>
#include <highgui.h>
#include <opencv2/opencv.hpp>


#include "imbs.hpp"

Expand Down
4 changes: 2 additions & 2 deletions package_bgs/dp/DPAdaptiveMedianBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/dp/DPEigenbackgroundBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/dp/DPGrimsonGMMBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions package_bgs/dp/DPMeanBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 5ed8f77

Please sign in to comment.