Skip to content

Commit

Permalink
Fixes to solve the issue related to OpenCV 4.2.0 andrewssobral#175 (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewssobral authored and Khan Schroder-Turner committed Feb 17, 2023
1 parent 0fbd9f5 commit 703d541
Show file tree
Hide file tree
Showing 20 changed files with 98 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/algorithms/LBP_MRF/MEDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "MEDefs.hpp"

#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

//using namespace bgslibrary::algorithms::lbp_mrf;

namespace bgslibrary
Expand All @@ -27,3 +29,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/LBP_MRF/MEDefs.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

namespace bgslibrary
{
namespace algorithms
Expand Down Expand Up @@ -58,3 +61,5 @@ namespace bgslibrary
}
}
}

#endif
4 changes: 4 additions & 0 deletions src/algorithms/LBP_MRF/MEHistogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "MEDefs.hpp"
#include "MEImage.hpp"

#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

using namespace bgslibrary::algorithms::lbp_mrf;

MEHistogram::MEHistogram() {
Expand Down Expand Up @@ -459,3 +461,5 @@ void MEHistogramTransform::SetStretchProcessingMode(ProcessingType new_channel_m
break;
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/LBP_MRF/MEHistogram.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

namespace bgslibrary
{
namespace algorithms
Expand Down Expand Up @@ -324,3 +327,5 @@ namespace bgslibrary
}
}
}

#endif
4 changes: 4 additions & 0 deletions src/algorithms/LBP_MRF/MEImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include "MEImage.hpp"
#include "MEDefs.hpp"

#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

//using namespace bgslibrary::algorithms::lbp_mrf;

#define ME_CAST_TO_IPLIMAGE(image_ptr) ((IplImage*)image_ptr)
Expand Down Expand Up @@ -1401,3 +1403,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/LBP_MRF/MEImage.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

namespace bgslibrary
{
namespace algorithms
Expand Down Expand Up @@ -975,3 +978,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BGS.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

// opencv legacy includes
#include "OpenCvLegacyIncludes.h"

Expand Down Expand Up @@ -168,3 +171,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BackgroundSubtractionAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

// opencv legacy includes
#include "OpenCvLegacyIncludes.h"

Expand Down Expand Up @@ -99,3 +102,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BlobExtraction.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "BlobResult.h"
#include "BlobExtraction.h"
#include "OpenCvLegacyIncludes.h"
Expand Down Expand Up @@ -1447,3 +1450,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BlobExtraction.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

namespace bgslibrary
{
namespace algorithms
Expand All @@ -24,3 +27,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BlobResult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include <functional>
#include <algorithm>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "BlobResult.h"
#include "BlobExtraction.h"

Expand Down Expand Up @@ -798,3 +801,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/BlobResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <vector>
#include <functional>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "BlobLibraryConfiguration.h"
// opencv legacy includes
#include "OpenCvLegacyIncludes.h"
Expand Down Expand Up @@ -143,3 +146,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/CMultiLayerBGS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <cmath>
#include <iostream>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "CMultiLayerBGS.h"
#include "OpenCvLegacyIncludes.h"

Expand Down Expand Up @@ -2099,3 +2102,5 @@ int CMultiLayerBGS::SetForegroundProbImage(IplImage* fg_prob_img) {
void CMultiLayerBGS::SetCurrentFrameNumber(unsigned long cur_frame_no) {
m_nCurImgFrameIdx = cur_frame_no;
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/CMultiLayerBGS.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ step. If you compile it under Linux, please uncomment it.

#include <opencv2/imgproc.hpp>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "LocalBinaryPattern.h"
#include "BlobResult.h"
#include "OpenCvDataConversion.h"
Expand Down Expand Up @@ -269,3 +272,5 @@ namespace bgslibrary
}
}
}

#endif
4 changes: 4 additions & 0 deletions src/algorithms/MultiLayer/LocalBinaryPattern.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "LocalBinaryPattern.h"

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

using namespace bgslibrary::algorithms::multilayer;

CLocalBinaryPattern::CLocalBinaryPattern() {
Expand Down Expand Up @@ -251,3 +254,4 @@ void CLocalBinaryPattern::CalImageDifferenceMap(IplImage *cent_img, IplImage *ne

}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/LocalBinaryPattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include <cstdio>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "BGS.h"
#include "OpenCvDataConversion.h"

Expand Down Expand Up @@ -57,3 +60,5 @@ namespace bgslibrary
}
}
}

#endif
6 changes: 6 additions & 0 deletions src/algorithms/MultiLayer/OpenCvDataConversion.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once

#include <stdio.h>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

// opencv legacy includes
#include "OpenCvLegacyIncludes.h"

Expand Down Expand Up @@ -182,3 +186,5 @@ namespace bgslibrary
}
}
}

#endif
6 changes: 6 additions & 0 deletions src/algorithms/MultiLayer/OpenCvLegacyIncludes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#pragma once

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

// opencv legacy includes
#include "opencv2/core/core_c.h"
#include "opencv2/core/types_c.h"
#include "opencv2/imgproc/imgproc_c.h"

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/blob.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include <limits.h>
#include "blob.h"

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

namespace bgslibrary
{
namespace algorithms
Expand Down Expand Up @@ -1092,3 +1095,5 @@ namespace bgslibrary
}
}
}

#endif
5 changes: 5 additions & 0 deletions src/algorithms/MultiLayer/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <vector>
#include <algorithm>

#include "opencv2/core/version.hpp"
#if CV_MAJOR_VERSION >= 2 && CV_MAJOR_VERSION <= 3

#include "BlobLibraryConfiguration.h"
// opencv legacy includes
#include "OpenCvLegacyIncludes.h"
Expand Down Expand Up @@ -790,3 +793,5 @@ namespace bgslibrary
}
}
}

#endif

0 comments on commit 703d541

Please sign in to comment.