summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-11-04 19:03:34 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-03-29 00:04:49 +0200
commit6be234d918664dcabe1b5005e6261287f2321528 (patch)
treef1ce26e228e76573bb1a1d538308b347d314f7cd
parent12b2eab9cd15b25185d03d7774e3138836f342b7 (diff)
tracker/trackhat: add point filter gain limiter
-rw-r--r--tracker-trackhat/dialog.cpp4
-rw-r--r--tracker-trackhat/dialog.ui105
-rw-r--r--tracker-trackhat/lang/nl_NL.ts4
-rw-r--r--tracker-trackhat/lang/ru_RU.ts4
-rw-r--r--tracker-trackhat/lang/stub.ts4
-rw-r--r--tracker-trackhat/lang/zh_CN.ts4
-rw-r--r--tracker-trackhat/trackhat.hpp1
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<slider_value>(), ui.exposure_label,
[this] { ui.exposure_label->setValue((int)*t.exposure); }, Qt::QueuedConnection);
connect(&t.gain, value_::value_changed<slider_value>(), ui.gain_label,
[this] { ui.gain_label->setValue((int)*t.gain); }, Qt::QueuedConnection);
+ connect(&t.point_filter_limit, value_::value_changed<slider_value>(), 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 @@
<x>0</x>
<y>0</y>
<width>365</width>
- <height>388</height>
+ <height>385</height>
</rect>
</property>
<property name="minimumSize">
@@ -67,6 +67,9 @@
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="threshold_label">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@@ -83,6 +86,9 @@
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="exposure_label">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@@ -106,6 +112,9 @@
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="gain_label">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@@ -181,6 +190,9 @@
</item>
<item row="3" column="2">
<widget class="QSpinBox" name="threshold_2_label">
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@@ -289,6 +301,9 @@
<property name="maximum">
<double>999.000000000000000</double>
</property>
+ <property name="value">
+ <double>1.000000000000000</double>
+ </property>
</widget>
</item>
</layout>
@@ -308,7 +323,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <layout class="QHBoxLayout" name="horizontalLayout">
+ <layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
@@ -321,14 +336,45 @@
<property name="bottomMargin">
<number>0</number>
</property>
- <item>
+ <item row="0" column="0">
<widget class="QCheckBox" name="enable_point_filter">
<property name="text">
<string>Point filter</string>
</property>
</widget>
</item>
- <item>
+ <item row="0" column="2">
+ <widget class="QDoubleSpinBox" name="point_filter_label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="buttonSymbols">
+ <enum>QAbstractSpinBox::NoButtons</enum>
+ </property>
+ <property name="suffix">
+ <string> px</string>
+ </property>
+ <property name="decimals">
+ <number>2</number>
+ </property>
+ <property name="maximum">
+ <double>300.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
<widget class="QSlider" name="point_filter_slider">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Maximum">
@@ -344,14 +390,33 @@
</property>
</widget>
</item>
- <item>
- <widget class="QDoubleSpinBox" name="point_filter_label">
+ <item row="1" column="1">
+ <widget class="QSlider" name="point_filter_limit">
<property name="sizePolicy">
- <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximum">
+ <number>99</number>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QDoubleSpinBox" name="point_filter_limit_label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
@@ -361,14 +426,24 @@
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
+ <property name="prefix">
+ <string/>
+ </property>
<property name="suffix">
- <string> px</string>
+ <string/>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="maximum">
- <double>300.000000000000000</double>
+ <double>1.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Limit</string>
</property>
</widget>
</item>
@@ -400,6 +475,18 @@
</item>
</layout>
</widget>
+ <tabstops>
+ <tabstop>exposure_slider</tabstop>
+ <tabstop>gain_slider</tabstop>
+ <tabstop>threshold_slider</tabstop>
+ <tabstop>threshold_2_slider</tabstop>
+ <tabstop>model_type</tabstop>
+ <tabstop>min_point_size</tabstop>
+ <tabstop>max_point_size</tabstop>
+ <tabstop>enable_point_filter</tabstop>
+ <tabstop>point_filter_slider</tabstop>
+ <tabstop>point_filter_limit</tabstop>
+ </tabstops>
<resources>
<include location="trackhat-res.qrc"/>
</resources>
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 @@
<source>Status: %1 points detected. BAD!</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Limit</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>trackhat_module</name>
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 @@
<source>Status: %1 points detected. BAD!</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Limit</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>trackhat_module</name>
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 @@
<source>Status: %1 points detected. BAD!</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Limit</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>trackhat_module</name>
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 @@
<source>Status: %1 points detected. BAD!</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Limit</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>trackhat_module</name>
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<double> max_pt_size{b, "max-point-size", 50};
value<bool> enable_point_filter{b, "enable-point-filter", true };
value<slider_value> point_filter_coefficient{b, "point-filter-coefficient", { 1.5, 1, 4 }};
+ value<slider_value> point_filter_limit { b, "point-filter-limit", { 0.1, 0.01, 1 }};
};
class setting_receiver : public QObject