From 5023b54ba76325bb0b5598d59714bdad2d55d81e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 18 Mar 2019 15:20:09 +0100 Subject: video: add support for camera modules Issue: #910 --- tracker-pt/module/camera.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'tracker-pt/module/camera.h') diff --git a/tracker-pt/module/camera.h b/tracker-pt/module/camera.h index 2ea633d0..02e2fe4d 100644 --- a/tracker-pt/module/camera.h +++ b/tracker-pt/module/camera.h @@ -9,11 +9,11 @@ #include "pt-api.hpp" #include "compat/timer.hpp" +#include "video/camera.hpp" #include #include -#include #include @@ -23,7 +23,7 @@ struct Camera final : pt_camera { Camera(const QString& module_name); - bool start(int idx, int fps, int res_x, int res_y) override; + bool start(const QString& name, int fps, int res_x, int res_y) override; void stop() override; result get_frame(pt_frame& Frame) override; @@ -37,23 +37,16 @@ struct Camera final : pt_camera void show_camera_settings() override; private: + using camera = typename video::impl::camera; + [[nodiscard]] bool get_frame_(cv::Mat& frame); f dt_mean = 0, fov = 30; Timer t; pt_camera_info cam_info; pt_camera_info cam_desired; - QString desired_name, active_name; - - struct camera_deleter final - { - void operator()(cv::VideoCapture* cap); - }; - - using camera_ptr = std::unique_ptr; - - camera_ptr cap; + std::unique_ptr cap; pt_settings s; static constexpr f dt_eps = f{1}/256; -- cgit v1.2.3