From 6be234d918664dcabe1b5005e6261287f2321528 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 4 Nov 2021 19:03:34 +0100 Subject: tracker/trackhat: add point filter gain limiter --- tracker-trackhat/dialog.cpp | 4 ++ tracker-trackhat/dialog.ui | 105 +++++++++++++++++++++++++++++++++++++---- tracker-trackhat/lang/nl_NL.ts | 4 ++ tracker-trackhat/lang/ru_RU.ts | 4 ++ tracker-trackhat/lang/stub.ts | 4 ++ tracker-trackhat/lang/zh_CN.ts | 4 ++ tracker-trackhat/trackhat.hpp | 1 + 7 files changed, 117 insertions(+), 9 deletions(-) diff --git a/tracker-trackhat/dialog.cpp b/tracker-trackhat/dialog.cpp index 89e0e427..b4ee945e 100644 --- a/tracker-trackhat/dialog.cpp +++ b/tracker-trackhat/dialog.cpp @@ -30,6 +30,7 @@ trackhat_dialog::trackhat_dialog() tie_setting(t.model, ui.model_type); tie_setting(t.min_pt_size, ui.min_point_size); tie_setting(t.max_pt_size, ui.max_point_size); + tie_setting(t.point_filter_limit, ui.point_filter_limit); // exposure @@ -37,11 +38,14 @@ trackhat_dialog::trackhat_dialog() tie_setting(t.gain, ui.gain_slider); ui.exposure_label->setValue((int)*t.exposure); ui.gain_label->setValue((int)*t.gain); + ui.point_filter_limit_label->setValue(*t.point_filter_limit); connect(&t.exposure, value_::value_changed(), ui.exposure_label, [this] { ui.exposure_label->setValue((int)*t.exposure); }, Qt::QueuedConnection); connect(&t.gain, value_::value_changed(), ui.gain_label, [this] { ui.gain_label->setValue((int)*t.gain); }, Qt::QueuedConnection); + connect(&t.point_filter_limit, value_::value_changed(), ui.point_filter_limit_label, + [this] { ui.point_filter_limit_label->setValue(*t.point_filter_limit); }, Qt::QueuedConnection); // threshold diff --git a/tracker-trackhat/dialog.ui b/tracker-trackhat/dialog.ui index e63fa465..09e3bef9 100644 --- a/tracker-trackhat/dialog.ui +++ b/tracker-trackhat/dialog.ui @@ -7,7 +7,7 @@ 0 0 365 - 388 + 385 @@ -67,6 +67,9 @@ + + Qt::NoFocus + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -83,6 +86,9 @@ + + Qt::NoFocus + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -106,6 +112,9 @@ + + Qt::NoFocus + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -181,6 +190,9 @@ + + Qt::NoFocus + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -289,6 +301,9 @@ 999.000000000000000 + + 1.000000000000000 + @@ -308,7 +323,7 @@ 0 - + 0 @@ -321,14 +336,45 @@ 0 - + Point filter - + + + + + 0 + 0 + + + + Qt::NoFocus + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + true + + + QAbstractSpinBox::NoButtons + + + px + + + 2 + + + 300.000000000000000 + + + + @@ -344,14 +390,33 @@ - - + + - + + 0 + 0 + + + + 99 + + + Qt::Horizontal + + + + + + + 0 0 + + Qt::NoFocus + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -361,14 +426,24 @@ QAbstractSpinBox::NoButtons + + + - px + 2 - 300.000000000000000 + 1.000000000000000 + + + + + + + Limit @@ -400,6 +475,18 @@ + + exposure_slider + gain_slider + threshold_slider + threshold_2_slider + model_type + min_point_size + max_point_size + enable_point_filter + point_filter_slider + point_filter_limit + diff --git a/tracker-trackhat/lang/nl_NL.ts b/tracker-trackhat/lang/nl_NL.ts index f5de5702..9aba000e 100644 --- a/tracker-trackhat/lang/nl_NL.ts +++ b/tracker-trackhat/lang/nl_NL.ts @@ -71,6 +71,10 @@ Status: %1 points detected. BAD! + + Limit + + trackhat_module diff --git a/tracker-trackhat/lang/ru_RU.ts b/tracker-trackhat/lang/ru_RU.ts index f5de5702..9aba000e 100644 --- a/tracker-trackhat/lang/ru_RU.ts +++ b/tracker-trackhat/lang/ru_RU.ts @@ -71,6 +71,10 @@ Status: %1 points detected. BAD! + + Limit + + trackhat_module diff --git a/tracker-trackhat/lang/stub.ts b/tracker-trackhat/lang/stub.ts index f5de5702..9aba000e 100644 --- a/tracker-trackhat/lang/stub.ts +++ b/tracker-trackhat/lang/stub.ts @@ -71,6 +71,10 @@ Status: %1 points detected. BAD! + + Limit + + trackhat_module diff --git a/tracker-trackhat/lang/zh_CN.ts b/tracker-trackhat/lang/zh_CN.ts index f5de5702..9aba000e 100644 --- a/tracker-trackhat/lang/zh_CN.ts +++ b/tracker-trackhat/lang/zh_CN.ts @@ -71,6 +71,10 @@ Status: %1 points detected. BAD! + + Limit + + trackhat_module diff --git a/tracker-trackhat/trackhat.hpp b/tracker-trackhat/trackhat.hpp index 7dce6d76..c844a520 100644 --- a/tracker-trackhat/trackhat.hpp +++ b/tracker-trackhat/trackhat.hpp @@ -40,6 +40,7 @@ struct trackhat_settings : opts value max_pt_size{b, "max-point-size", 50}; value enable_point_filter{b, "enable-point-filter", true }; value point_filter_coefficient{b, "point-filter-coefficient", { 1.5, 1, 4 }}; + value point_filter_limit { b, "point-filter-limit", { 0.1, 0.01, 1 }}; }; class setting_receiver : public QObject -- cgit v1.2.3