#pragma once #include "pt-settings.hpp" #include "cv/numeric.hpp" #include "options/options.hpp" #include "video/camera.hpp" #include #include #include #include #include #include #ifdef __clang__ # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wweak-vtables" #endif const int KPointCount = 3; struct pt_pixel_pos_mixin { using f = numeric_types::f; static std::tuple to_pixel_pos(f x, f y, int w, int h); static std::tuple to_screen_pos(f px, f py, int w, int h); }; struct pt_point_extractor : pt_pixel_pos_mixin { using vec2 = numeric_types::vec2; using f = numeric_types::f; pt_point_extractor(); virtual ~pt_point_extractor(); virtual void extract_points(const cv::Mat& image, cv::Mat& preview_frame, std::vector& points, std::vector& imagePoints) = 0; static f threshold_radius_value(int w, int h, int threshold); }; struct pt_runtime_traits { template using pointer = std::shared_ptr; pt_runtime_traits(); virtual ~pt_runtime_traits(); virtual pointer make_point_extractor() const = 0; virtual QString get_module_name() const = 0; }; template using pt_pointer = typename pt_runtime_traits::pointer; #ifdef __clang__ # pragma clang diagnostic pop #endif