summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy
diff options
context:
space:
mode:
Diffstat (limited to 'tracker-easy')
-rw-r--r--tracker-easy/CMakeLists.txt19
-rw-r--r--tracker-easy/ocv-check.cxx18
-rw-r--r--tracker-easy/point-extractor.cpp2
-rw-r--r--tracker-easy/tracker-easy-dialog.cpp2
4 files changed, 36 insertions, 5 deletions
diff --git a/tracker-easy/CMakeLists.txt b/tracker-easy/CMakeLists.txt
index 7b776c9b..2bc773d7 100644
--- a/tracker-easy/CMakeLists.txt
+++ b/tracker-easy/CMakeLists.txt
@@ -1,6 +1,19 @@
+include(opentrack-opencv)
find_package(OpenCV QUIET)
+
if(OpenCV_FOUND)
- otr_module(tracker-easy)
- target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
- target_link_libraries(${self} opencv_core opencv_imgproc opencv_calib3d opencv_video opentrack-cv opentrack-video)
+ try_compile(tracker-easy_ocv-check "${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"
+ OUTPUT_VARIABLE krap)
+ if(tracker-easy_ocv-check)
+ foreach(k video highgui)
+ otr_install_lib("opencv_${k}" "${opentrack-hier-pfx}")
+ endforeach()
+
+ otr_module(tracker-easy)
+ target_include_directories(${self} SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
+ target_link_libraries(${self} opencv_core opencv_imgproc opencv_calib3d opencv_video opencv_highgui opentrack-cv opentrack-video)
+ endif()
endif()
diff --git a/tracker-easy/ocv-check.cxx b/tracker-easy/ocv-check.cxx
new file mode 100644
index 00000000..90c2d6c9
--- /dev/null
+++ b/tracker-easy/ocv-check.cxx
@@ -0,0 +1,18 @@
+#include <opencv2/calib3d.hpp>
+void check_solvep3p()
+{
+ cv::Mat x;
+ cv::solveP3P(x, x, x, x, x, x, 0);
+}
+
+#include <opencv2/video/tracking.hpp>
+void check_kf()
+{
+ [[maybe_unused]] cv::KalmanFilter kf;
+}
+
+#include <opencv2/highgui.hpp>
+void check_highgui()
+{
+ cv::imshow("foo", {});
+}
diff --git a/tracker-easy/point-extractor.cpp b/tracker-easy/point-extractor.cpp
index b7cf7356..4b54fd25 100644
--- a/tracker-easy/point-extractor.cpp
+++ b/tracker-easy/point-extractor.cpp
@@ -143,7 +143,7 @@ namespace EasyTracker
while (aPoints.size() > aNeededPointCount) // Until we have no more than three points
{
int maxY = 0;
- size_t index = -1;
+ unsigned index = (unsigned)-1;
// Search for the point with highest Y coordinate
for (size_t i = 0; i < aPoints.size(); i++)
diff --git a/tracker-easy/tracker-easy-dialog.cpp b/tracker-easy/tracker-easy-dialog.cpp
index 8c8356d1..4a49e194 100644
--- a/tracker-easy/tracker-easy-dialog.cpp
+++ b/tracker-easy/tracker-easy-dialog.cpp
@@ -138,7 +138,7 @@ namespace EasyTracker
if (tracker)
{
QMutexLocker l(&tracker->camera_mtx);
- tracker->camera->show_dialog();
+ (void)tracker->camera->show_dialog();
}
else
(void)video::show_dialog(s.camera_name);