diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 08:33:37 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 14:07:16 +0200 |
commit | edd8680615e842375d8c9af25427784ed01f4fab (patch) | |
tree | ed3483692c46cad415e2ea54f6b088f124b5d777 | |
parent | 848fc5b13a7d76e89010781239d0dd701e51337d (diff) |
cv, tracker/pt: cleanup opencv includes
-rw-r--r-- | compat/correlation-calibrator.cpp | 1 | ||||
-rw-r--r-- | compat/math.hpp | 5 | ||||
-rw-r--r-- | cv/affine.hpp | 1 | ||||
-rw-r--r-- | cv/init.cpp | 3 | ||||
-rw-r--r-- | cv/numeric.hpp | 2 | ||||
-rw-r--r-- | cv/translation-calibrator.cpp | 2 | ||||
-rw-r--r-- | cv/translation-calibrator.hpp | 2 | ||||
-rw-r--r-- | cv/video-widget.cpp | 2 | ||||
-rw-r--r-- | cv/video-widget.hpp | 2 | ||||
-rw-r--r-- | tracker-easy/preview.cpp | 1 | ||||
-rw-r--r-- | tracker-pt/ftnoir_tracker_pt.h | 2 | ||||
-rw-r--r-- | tracker-pt/module/camera.cpp | 7 | ||||
-rw-r--r-- | tracker-pt/module/camera.h | 2 | ||||
-rw-r--r-- | tracker-pt/module/frame.cpp | 2 | ||||
-rw-r--r-- | tracker-pt/module/frame.hpp | 2 | ||||
-rw-r--r-- | tracker-pt/module/point_extractor.cpp | 3 | ||||
-rw-r--r-- | tracker-pt/module/point_extractor.h | 6 | ||||
-rw-r--r-- | tracker-pt/point_tracker.h | 4 | ||||
-rw-r--r-- | tracker-pt/pt-api.hpp | 4 | ||||
-rw-r--r-- | video-opencv/impl.hpp | 5 |
20 files changed, 19 insertions, 39 deletions
diff --git a/compat/correlation-calibrator.cpp b/compat/correlation-calibrator.cpp index 08fbcaa7..4f08ecd5 100644 --- a/compat/correlation-calibrator.cpp +++ b/compat/correlation-calibrator.cpp @@ -2,6 +2,7 @@ #include "variance.hpp" #include "compat/math.hpp" #include "compat/meta.hpp" +#include "compat/macros1.h" #include <cmath> #include <iterator> diff --git a/compat/math.hpp b/compat/math.hpp index f05ebdc8..c5981cc2 100644 --- a/compat/math.hpp +++ b/compat/math.hpp @@ -1,18 +1,15 @@ #pragma once -#include "macros.hpp" - #include <cmath> #include <type_traits> template<typename t> -inline auto iround(t val) -> std::enable_if_t<std::is_floating_point_v<remove_cvref_t<t>>, int> +inline auto iround(t val) -> std::enable_if_t<std::is_floating_point_v<std::decay_t<t>>, int> { return (int)std::round(val); } template <typename t> -force_inline constexpr int signum(const t& x) { return x < t{0} ? -1 : 1; diff --git a/cv/affine.hpp b/cv/affine.hpp index 882a1145..4640e24e 100644 --- a/cv/affine.hpp +++ b/cv/affine.hpp @@ -7,7 +7,6 @@ #pragma once -#include <opencv2/core.hpp> #include "numeric.hpp" namespace affine_impl { diff --git a/cv/init.cpp b/cv/init.cpp index c9c4650f..d883365b 100644 --- a/cv/init.cpp +++ b/cv/init.cpp @@ -1,6 +1,7 @@ #include "init.hpp" #include <type_traits> -#include <opencv2/core.hpp> +#include <opencv2/core/base.hpp> +#include <opencv2/core/utility.hpp> [[noreturn]] static diff --git a/cv/numeric.hpp b/cv/numeric.hpp index ce8f7e82..2050e8e4 100644 --- a/cv/numeric.hpp +++ b/cv/numeric.hpp @@ -1,7 +1,7 @@ #pragma once #include <type_traits> -#include <opencv2/core.hpp> +#include <opencv2/core/matx.hpp> namespace numeric_types { using f = float; diff --git a/cv/translation-calibrator.cpp b/cv/translation-calibrator.cpp index dd520ce6..8fe9a1b8 100644 --- a/cv/translation-calibrator.cpp +++ b/cv/translation-calibrator.cpp @@ -8,6 +8,8 @@ #include "translation-calibrator.hpp" #include "compat/euler.hpp" #include "compat/math.hpp" +#include "compat/macros1.h" +#include <opencv2/core.hpp> #include <tuple> diff --git a/cv/translation-calibrator.hpp b/cv/translation-calibrator.hpp index 406edb72..3912c938 100644 --- a/cv/translation-calibrator.hpp +++ b/cv/translation-calibrator.hpp @@ -7,7 +7,7 @@ #pragma once -#include <opencv2/core.hpp> +#include <opencv2/core/matx.hpp> #include <vector> //----------------------------------------------------------------------------- diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp index ea5e13ac..6d8c0be3 100644 --- a/cv/video-widget.cpp +++ b/cv/video-widget.cpp @@ -1,5 +1,5 @@ #include "video-widget.hpp" - +#include "compat/macros1.h" #include <opencv2/imgproc.hpp> void cv_video_widget::update_image(const cv::Mat& frame) diff --git a/cv/video-widget.hpp b/cv/video-widget.hpp index 54316d32..24f8d7f3 100644 --- a/cv/video-widget.hpp +++ b/cv/video-widget.hpp @@ -8,7 +8,7 @@ #pragma once #include "video/video-widget.hpp" -#include <opencv2/core.hpp> +#include <opencv2/core/mat.hpp> struct cv_video_widget final : video_widget { diff --git a/tracker-easy/preview.cpp b/tracker-easy/preview.cpp index 1dad7d84..f8025a64 100644 --- a/tracker-easy/preview.cpp +++ b/tracker-easy/preview.cpp @@ -9,6 +9,7 @@ #include "preview.h" #include "compat/math.hpp" +#include "compat/macros1.h" #include <opencv2/imgproc.hpp> #include <QDebug> diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index 416b0ebe..a793f94b 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -19,8 +19,6 @@ #include <memory> #include <vector> -#include <opencv2/core.hpp> - #include <QThread> #include <QMutex> #include <QLayout> diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp index 19c0c222..73c57f37 100644 --- a/tracker-pt/module/camera.cpp +++ b/tracker-pt/module/camera.cpp @@ -7,10 +7,7 @@ #include "camera.h" #include "frame.hpp" - -#include "compat/math-imports.hpp" - -#include <opencv2/core.hpp> +#include <opencv2/core/mat.hpp> namespace pt_module { @@ -158,7 +155,7 @@ bool Camera::get_frame_(cv::Mat& img) int stride = frame.stride; if (stride == 0) stride = cv::Mat::AUTO_STEP; - img = cv::Mat(frame.height, frame.width, CV_8UC(frame.channels), (void*)frame.data, stride); + img = cv::Mat(frame.height, frame.width, CV_8UC(frame.channels), (void*)frame.data, (size_t)stride); return true; } } diff --git a/tracker-pt/module/camera.h b/tracker-pt/module/camera.h index f9b62282..e4772178 100644 --- a/tracker-pt/module/camera.h +++ b/tracker-pt/module/camera.h @@ -13,8 +13,6 @@ #include <memory> -#include <opencv2/core.hpp> - #include <QString> namespace pt_module { diff --git a/tracker-pt/module/frame.cpp b/tracker-pt/module/frame.cpp index 8549e5fd..1a276f16 100644 --- a/tracker-pt/module/frame.cpp +++ b/tracker-pt/module/frame.cpp @@ -1,7 +1,5 @@ #include "frame.hpp" - #include "compat/math.hpp" - #include <opencv2/imgproc.hpp> namespace pt_module { diff --git a/tracker-pt/module/frame.hpp b/tracker-pt/module/frame.hpp index 239a3474..0569a323 100644 --- a/tracker-pt/module/frame.hpp +++ b/tracker-pt/module/frame.hpp @@ -2,7 +2,7 @@ #include "pt-api.hpp" -#include <opencv2/core.hpp> +#include <opencv2/core/mat.hpp> #include <QImage> #ifdef __clang__ diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp index be4823ad..42aafba6 100644 --- a/tracker-pt/module/point_extractor.cpp +++ b/tracker-pt/module/point_extractor.cpp @@ -9,10 +9,11 @@ #include "point_extractor.h" #include "point_tracker.h" #include "frame.hpp" - #include "cv/numeric.hpp" #include "compat/math.hpp" +#include <opencv2/imgproc.hpp> + #undef PREVIEW //#define PREVIEW diff --git a/tracker-pt/module/point_extractor.h b/tracker-pt/module/point_extractor.h index 124cb110..b1cc86d5 100644 --- a/tracker-pt/module/point_extractor.h +++ b/tracker-pt/module/point_extractor.h @@ -9,12 +9,10 @@ #pragma once #include "pt-api.hpp" - +#include <opencv2/core/mat.hpp> +#include <opencv2/core/types.hpp> #include <vector> -#include <opencv2/core.hpp> -#include <opencv2/imgproc.hpp> - namespace pt_module { using namespace numeric_types; diff --git a/tracker-pt/point_tracker.h b/tracker-pt/point_tracker.h index 05ff04bf..06388f49 100644 --- a/tracker-pt/point_tracker.h +++ b/tracker-pt/point_tracker.h @@ -13,13 +13,9 @@ #include "pt-api.hpp" #include "point-filter.hpp" -#include <cstddef> -#include <memory> #include <vector> #include <array> -#include <opencv2/core.hpp> - #include <QObject> namespace pt_impl { diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp index a0d3cd5d..1a6444e5 100644 --- a/tracker-pt/pt-api.hpp +++ b/tracker-pt/pt-api.hpp @@ -6,11 +6,9 @@ #include "options/options.hpp" #include <tuple> -#include <type_traits> +#include <vector> #include <memory> -#include <opencv2/core.hpp> - #include <QImage> #include <QString> diff --git a/video-opencv/impl.hpp b/video-opencv/impl.hpp index db569823..ed5499b0 100644 --- a/video-opencv/impl.hpp +++ b/video-opencv/impl.hpp @@ -8,18 +8,13 @@ #pragma once #include "video/camera.hpp" - #include <optional> - -#include <opencv2/core.hpp> #include <opencv2/videoio.hpp> namespace opencv_camera_impl { using namespace video::impl; -struct cam; - struct metadata : camera_ { metadata(); |