From c1d890fcf3056cd0e45a83130055456d492d723a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 19 Aug 2017 12:11:11 +0200 Subject: tracker/{pt,aruco}: simplify --- tracker-aruco/ftnoir_tracker_aruco.cpp | 8 ++++---- tracker-aruco/ftnoir_tracker_aruco.h | 5 +++-- tracker-pt/ftnoir_tracker_pt.cpp | 8 ++++---- tracker-pt/ftnoir_tracker_pt.h | 13 ++++++------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp index 27d5e94b..962d0060 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.cpp +++ b/tracker-aruco/ftnoir_tracker_aruco.cpp @@ -76,11 +76,11 @@ aruco_tracker::~aruco_tracker() void aruco_tracker::start_tracker(QFrame* videoframe) { videoframe->show(); - videoWidget = qptr(videoframe); - layout = qptr(); + videoWidget = std::make_unique(videoframe); + layout = std::make_unique(); layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(videoWidget.data()); - videoframe->setLayout(layout.data()); + layout->addWidget(videoWidget.get()); + videoframe->setLayout(layout.get()); videoWidget->show(); start(); } diff --git a/tracker-aruco/ftnoir_tracker_aruco.h b/tracker-aruco/ftnoir_tracker_aruco.h index 4b3bde73..fd42d722 100644 --- a/tracker-aruco/ftnoir_tracker_aruco.h +++ b/tracker-aruco/ftnoir_tracker_aruco.h @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -97,8 +98,8 @@ private: cv::VideoCapture camera; QMutex camera_mtx; QMutex mtx; - qshared videoWidget; - qshared layout; + std::unique_ptr videoWidget; + std::unique_ptr layout; settings s; double pose[6], fps, no_detection_timeout; cv::Mat frame, grayscale, color; diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index 83ea094c..66d6f1ec 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -162,11 +162,11 @@ void Tracker_PT::start_tracker(QFrame* video_frame) preview_frame = cv::Mat(video_frame->height(), video_frame->width(), CV_8UC3); preview_frame.setTo(cv::Scalar(0, 0, 0)); - video_widget = qptr(video_frame); - layout = qptr(video_frame); + video_widget = std::make_unique(video_frame); + layout = std::make_unique(video_frame); layout->setContentsMargins(0, 0, 0, 0); - layout->addWidget(video_widget.data()); - video_frame->setLayout(layout.data()); + layout->addWidget(video_widget.get()); + video_frame->setLayout(layout.get()); //video_widget->resize(video_frame->width(), video_frame->height()); video_frame->show(); diff --git a/tracker-pt/ftnoir_tracker_pt.h b/tracker-pt/ftnoir_tracker_pt.h index 4110c9d9..6c2923c0 100644 --- a/tracker-pt/ftnoir_tracker_pt.h +++ b/tracker-pt/ftnoir_tracker_pt.h @@ -11,8 +11,6 @@ #include "api/plugin-api.hpp" #include "ftnoir_tracker_pt_settings.h" -#include - #include "cv/numeric.hpp" #include "camera.h" @@ -21,6 +19,10 @@ #include "cv/video-widget.hpp" #include "compat/util.hpp" +#include +#include +#include + #include #include #include @@ -28,9 +30,6 @@ #include #include #include -#include -#include -#include class TrackerDialog_PT; @@ -72,8 +71,8 @@ private: PointExtractor point_extractor; PointTracker point_tracker; - qshared video_widget; - qshared layout; + std::unique_ptr video_widget; + std::unique_ptr layout; settings_pt s; cv::Mat frame, preview_frame; -- cgit v1.2.3