diff options
Diffstat (limited to 'cv')
-rw-r--r-- | cv/CMakeLists.txt | 2 | ||||
-rw-r--r-- | cv/affine.hpp | 1 | ||||
-rw-r--r-- | cv/init.cpp | 3 | ||||
-rw-r--r-- | cv/lang/de_DE.ts | 4 | ||||
-rw-r--r-- | cv/lang/zh_CN.ts | 2 | ||||
-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 | 16 | ||||
-rw-r--r-- | cv/video-widget.hpp | 2 |
10 files changed, 17 insertions, 19 deletions
diff --git a/cv/CMakeLists.txt b/cv/CMakeLists.txt index d5f33d44..3a8798cc 100644 --- a/cv/CMakeLists.txt +++ b/cv/CMakeLists.txt @@ -4,7 +4,7 @@ if(OpenCV_FOUND) try_compile(cv_use-ipp "${CMAKE_CURRENT_BINARY_DIR}" SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ocv-check.cxx" CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${OpenCV_INCLUDE_DIRS}" - "-DCXX_STANDARD=17" "-DCXX_STANDARD_REQUIRED=1" + "-DCXX_STANDARD=20" "-DCXX_STANDARD_REQUIRED=1" OUTPUT_VARIABLE krap) otr_module(cv STATIC) target_link_libraries(${self} opencv_core opentrack-video) 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/lang/de_DE.ts b/cv/lang/de_DE.ts new file mode 100644 index 00000000..1552582e --- /dev/null +++ b/cv/lang/de_DE.ts @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de_DE"> +</TS> diff --git a/cv/lang/zh_CN.ts b/cv/lang/zh_CN.ts index 6401616d..e5ca8aa9 100644 --- a/cv/lang/zh_CN.ts +++ b/cv/lang/zh_CN.ts @@ -1,4 +1,4 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> -<TS version="2.1"> +<TS version="2.1" language="zh_CN"> </TS> 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..6fb3e638 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/macros.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 289b9cee..7accd275 100644 --- a/cv/video-widget.cpp +++ b/cv/video-widget.cpp @@ -1,5 +1,5 @@ #include "video-widget.hpp" - +#include "compat/macros.h" #include <opencv2/imgproc.hpp> void cv_video_widget::update_image(const cv::Mat& frame) @@ -13,15 +13,8 @@ void cv_video_widget::update_image(const cv::Mat& frame) return; cv::Mat const* __restrict scaled = nullptr; - - if (frame3.cols != W || frame3.rows != H) - { - frame3 = cv::Mat(H, W, frame.type()); - frame2 = cv::Mat(H, W, CV_8UC4); - - if (!frame2.isContinuous() || !frame3.isContinuous()) - std::abort(); - } + frame3.create(H, W, frame.type()); + frame2.create(H, W, CV_8UC4); if (frame.cols != W || frame.rows != H) { @@ -37,7 +30,6 @@ void cv_video_widget::update_image(const cv::Mat& frame) scaled = &frame; int color_cvt = cv::COLOR_COLORCVT_MAX; - constexpr int nchannels = 4; switch (scaled->channels()) { @@ -47,7 +39,7 @@ void cv_video_widget::update_image(const cv::Mat& frame) case 3: color_cvt = cv::COLOR_BGR2BGRA; break; - case nchannels: + case 4: break; default: unreachable(); 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 { |