From b327eb866272272f2669cca4ea78c4cb489f7298 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 26 Oct 2013 23:56:59 +0200 Subject: auto-reset camera on settings exit. avoid bugs in cv::videocapture Signed-off-by: Stanislaw Halik --- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'ftnoir_tracker_aruco/ftnoir_tracker_aruco.h') diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 5d3d4ed6..61eec096 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -28,6 +28,7 @@ public: bool GiveHeadPoseData(double *data); bool enableTX, enableTY, enableTZ, enableRX, enableRY, enableRZ; void run(); + void load_settings(); private: QMutex mtx; ArucoVideoWidget* videoWidget; @@ -36,10 +37,10 @@ private: float fov; int camera_index; int force_fps, force_width, force_height; - void load_settings(); double pose[6]; cv::Mat frame; double headpos[3]; + volatile bool reset; }; // Widget that has controls for FTNoIR protocol client-settings. @@ -53,14 +54,19 @@ public: void showEvent (QShowEvent *); void Initialize(QWidget *); - void registerTracker(ITracker *) {} - void unRegisterTracker() {} + void registerTracker(ITracker * x) { + tracker = dynamic_cast(x); + } + void unRegisterTracker() { + tracker = nullptr; + } private: Ui::Form ui; void loadSettings(); void save(); bool settingsDirty; + Tracker* tracker; private slots: void doOK(); -- cgit v1.2.3