summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-20 12:57:43 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-20 12:57:43 +0200
commit513ef3ab3ad8231b783905f7ddd7a83d6ef1ae1f (patch)
tree1dd26931d132ecf2902a6399111c4d0b2ebaea85 /ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
parent6b6e286d9dcf03bd4d96f7d0acbeb797eecbcfdd (diff)
pt: cleanup some data races
Diffstat (limited to 'ftnoir_tracker_pt/ftnoir_tracker_pt.cpp')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index be946018..013777bc 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -72,6 +72,8 @@ void Tracker_PT::run()
if (!log_file.open(QIODevice::WriteOnly | QIODevice::Text)) return;
QTextStream log_stream(&log_file);
#endif
+
+ apply_settings();
while((commands & ABORT) == 0)
{
@@ -152,9 +154,11 @@ void Tracker_PT::apply_settings()
{
qDebug()<<"Tracker:: Applying settings";
QMutexLocker l(&camera_mtx);
+ camera.stop();
camera.set_device_index(camera_name_to_index(s.camera_name));
camera.set_res(s.cam_res_x, s.cam_res_y);
camera.set_fps(s.cam_fps);
+ camera.start();
cv::Mat intrinsics_ = cv::Mat::eye(3, 3, CV_32FC1);
cv::Mat dist_coeffs_ = cv::Mat::zeros(5, 1, CV_32FC1);
intrinsics = cv::Mat();
@@ -183,8 +187,6 @@ void Tracker_PT::start_tracker(QFrame *parent_window)
video_layout->addWidget(video_widget);
video_frame->setLayout(video_layout);
video_widget->resize(video_frame->width(), video_frame->height());
- camera.start();
- apply_settings();
start();
}