summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/ftnoir_tracker_pt_dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-06-22 07:27:36 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-06-22 07:27:36 +0200
commit0ebf074be440dc5ba30802fdccfc786c6d4acbd7 (patch)
tree0545c270b4a58ca65b3b1a66466de9521c2a10da /tracker-pt/ftnoir_tracker_pt_dialog.cpp
parentfdbc5017ede5dc0f31e1fa61aa8dc254810558ac (diff)
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.
Diffstat (limited to 'tracker-pt/ftnoir_tracker_pt_dialog.cpp')
-rw-r--r--tracker-pt/ftnoir_tracker_pt_dialog.cpp8
1 files changed, 6 insertions, 2 deletions
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();