From d280151a9e8715505dd9329800b9df38222870d0 Mon Sep 17 00:00:00 2001
From: Andrews Sobral <andrewssobral@gmail.com>
Date: Mon, 19 Aug 2019 23:57:00 +0200
Subject: [PATCH] Fix headers for MATLAB compilation

---
 src/algorithms/IBGS.h                                | 2 ++
 src/algorithms/IMBS/IMBS.hpp                         | 6 ++++--
 src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp     | 2 ++
 src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp    | 2 ++
 src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp  | 2 ++
 src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp    | 2 ++
 src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp | 2 ++
 src/tools/PixelUtils.h                               | 2 ++
 8 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/algorithms/IBGS.h b/src/algorithms/IBGS.h
index d9ba041..bbf835f 100644
--- a/src/algorithms/IBGS.h
+++ b/src/algorithms/IBGS.h
@@ -13,7 +13,9 @@
 // opencv legacy includes
 #include <opencv2/imgproc/types_c.h>
 #include <opencv2/imgproc/imgproc_c.h>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui_c.h>
+#endif
 
 #include "../utils/ILoadSaveConfig.h"
 
diff --git a/src/algorithms/IMBS/IMBS.hpp b/src/algorithms/IMBS/IMBS.hpp
index 9ddc66f..d17f051 100644
--- a/src/algorithms/IMBS/IMBS.hpp
+++ b/src/algorithms/IMBS/IMBS.hpp
@@ -4,13 +4,15 @@
 #include <vector>
 
 #include <opencv2/core/core.hpp>
-#include <opencv2/highgui/highgui.hpp>
 #include <opencv2/imgproc/imgproc.hpp>
 #include <opencv2/features2d/features2d.hpp>
 // opencv legacy includes
+#ifndef MEX_COMPILE_FLAG
+#include <opencv2/highgui/highgui.hpp>
+#include <opencv2/highgui/highgui_c.h>
+#endif
 #include <opencv2/imgproc/types_c.h>
 #include <opencv2/imgproc/imgproc_c.h>
-#include <opencv2/highgui/highgui_c.h>
 
 namespace bgslibrary
 {
diff --git a/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp b/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp
index 53dc0be..d844470 100644
--- a/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp
+++ b/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp
@@ -3,7 +3,9 @@
 #include <exception>
 
 #include <opencv2/imgproc/imgproc.hpp>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui.hpp>
+#endif
 
 #include "BackgroundSubtractorLBSP.h"
 #include "DistanceUtils.h"
diff --git a/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp b/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp
index 4bcdfb1..3a343d5 100644
--- a/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp
+++ b/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp
@@ -3,7 +3,9 @@
 #include <exception>
 
 #include <opencv2/imgproc/imgproc.hpp>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui.hpp>
+#endif
 
 #include "BackgroundSubtractorLBSP_.h"
 #include "DistanceUtils.h"
diff --git a/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp b/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp
index 330a1ac..58c81c5 100644
--- a/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp
+++ b/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp
@@ -2,7 +2,9 @@
 #include <iomanip>
 
 #include <opencv2/imgproc/imgproc.hpp>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui.hpp>
+#endif
 
 #include "BackgroundSubtractorLOBSTER.h"
 #include "RandUtils.h"
diff --git a/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp b/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp
index acb1a8f..19bc1e7 100644
--- a/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp
+++ b/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp
@@ -2,7 +2,9 @@
 #include <iomanip>
 
 #include <opencv2/imgproc/imgproc.hpp>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui.hpp>
+#endif
 
 #include "BackgroundSubtractorPAWCS.h"
 #include "RandUtils.h"
diff --git a/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp b/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp
index 9278354..31cd8df 100644
--- a/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp
+++ b/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp
@@ -2,7 +2,9 @@
 #include <iomanip>
 
 #include <opencv2/imgproc/imgproc.hpp>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui.hpp>
+#endif
 
 #include "BackgroundSubtractorSuBSENSE.h"
 #include "RandUtils.h"
diff --git a/src/tools/PixelUtils.h b/src/tools/PixelUtils.h
index fd08420..1522562 100644
--- a/src/tools/PixelUtils.h
+++ b/src/tools/PixelUtils.h
@@ -7,7 +7,9 @@
 //#include <opencv2/highgui/highgui_c.h>
 #include <opencv2/imgproc/types_c.h>
 #include <opencv2/imgproc/imgproc_c.h>
+#ifndef MEX_COMPILE_FLAG
 #include <opencv2/highgui/highgui_c.h>
+#endif
 
 namespace bgslibrary
 {
-- 
GitLab