From 0ebf074be440dc5ba30802fdccfc786c6d4acbd7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 22 Jun 2017 07:27:36 +0200 Subject: tracker/pt: replace point extraction algorithm Profiling over a longer time period showed a bottleneck while iterating pixels with `cv::floodFill()'. Contours are actually faster, and we have MeanShift to establish the proper center basing on pixel intensities. --- tracker-pt/ftnoir_tracker_pt_dialog.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp') diff --git a/tracker-pt/ftnoir_tracker_pt_dialog.cpp b/tracker-pt/ftnoir_tracker_pt_dialog.cpp index 98e8e424..c2079c27 100644 --- a/tracker-pt/ftnoir_tracker_pt_dialog.cpp +++ b/tracker-pt/ftnoir_tracker_pt_dialog.cpp @@ -76,15 +76,17 @@ TrackerDialog_PT::TrackerDialog_PT() timer.setInterval(250); connect(&calib_timer, &QTimer::timeout, this, &TrackerDialog_PT::trans_calib_step); - calib_timer.setInterval(100); + calib_timer.setInterval(35); poll_tracker_info_impl(); - connect(this, &TrackerDialog_PT::poll_tracker_info, this, &TrackerDialog_PT::poll_tracker_info_impl, Qt::QueuedConnection); + connect(this, &TrackerDialog_PT::poll_tracker_info, this, &TrackerDialog_PT::poll_tracker_info_impl, Qt::DirectConnection); } void TrackerDialog_PT::startstop_trans_calib(bool start) { + QMutexLocker l(&calibrator_mutex); + if (start) { qDebug() << "pt: starting translation calibration"; @@ -174,6 +176,8 @@ void TrackerDialog_PT::show_camera_settings() void TrackerDialog_PT::trans_calib_step() { + QMutexLocker l(&calibrator_mutex); + if (tracker) { Affine X_CM = tracker->pose(); -- cgit v1.2.3