diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-23 13:52:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-23 14:16:35 +0100 |
commit | 386795a320f8c007186c41b0d10a4f4281a9c28c (patch) | |
tree | 87c69863c44b7ad1794636102fea0ccc47911b2b /tracker-neuralnet | |
parent | 45e48310779c8adec67de7cf76328aa7bd034466 (diff) |
video/opencv, tracker/nn: add exposure presets
Diffstat (limited to 'tracker-neuralnet')
-rw-r--r-- | tracker-neuralnet/ftnoir_tracker_neuralnet.cpp | 16 | ||||
-rw-r--r-- | tracker-neuralnet/ftnoir_tracker_neuralnet.h | 3 | ||||
-rw-r--r-- | tracker-neuralnet/lang/nl_NL.ts | 4 | ||||
-rw-r--r-- | tracker-neuralnet/lang/ru_RU.ts | 4 | ||||
-rw-r--r-- | tracker-neuralnet/lang/stub.ts | 4 | ||||
-rw-r--r-- | tracker-neuralnet/lang/zh_CN.ts | 4 | ||||
-rw-r--r-- | tracker-neuralnet/neuralnet-trackercontrols.ui | 52 |
7 files changed, 77 insertions, 10 deletions
diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp index d8077326..cbfb3496 100644 --- a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp +++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp @@ -750,6 +750,22 @@ NeuralNetDialog::NeuralNetDialog() : tie_setting(settings_.force_fps, ui_.cameraFPS); #endif + { + const struct { + QString label; + exposure_preset preset; + } presets[] = { + { QStringLiteral("Near (1-4ft)"), exposure_preset::near }, + { QStringLiteral("Far (4-8ft)"), exposure_preset::far }, + { QStringLiteral("Custom"), exposure_preset::ignored }, + }; + + for (const auto& [label, preset] : presets) + ui_.exposure_preset->addItem(label, int(preset)); + + tie_setting(cs_.exposure_preset, ui_.exposure_preset); + } + connect(ui_.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui_.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); connect(ui_.camera_settings, SIGNAL(clicked()), this, SLOT(camera_settings())); diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.h b/tracker-neuralnet/ftnoir_tracker_neuralnet.h index df71a7a8..d44a9953 100644 --- a/tracker-neuralnet/ftnoir_tracker_neuralnet.h +++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.h @@ -20,6 +20,7 @@ #include "compat/timer.hpp" #include "video/camera.hpp" #include "cv/affine.hpp" +#include "video-opencv/settings.hpp" #include <QObject> #include <QThread> @@ -176,6 +177,8 @@ private: Ui::Form ui_; Settings settings_; + dshow_camera_settings cs_; + // Calibration code mostly taken from point tracker QTimer calib_timer_; TranslationCalibrator trans_calib_; diff --git a/tracker-neuralnet/lang/nl_NL.ts b/tracker-neuralnet/lang/nl_NL.ts index 25742b8f..09a2ebd7 100644 --- a/tracker-neuralnet/lang/nl_NL.ts +++ b/tracker-neuralnet/lang/nl_NL.ts @@ -40,6 +40,10 @@ Don't roll or change position.</source> <source>Up</source> <translation type="unfinished"></translation> </message> + <message> + <source>Exposure preset</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>neuralnet_tracker_ns::NeuralNetDialog</name> diff --git a/tracker-neuralnet/lang/ru_RU.ts b/tracker-neuralnet/lang/ru_RU.ts index 5b311a19..3b1bb257 100644 --- a/tracker-neuralnet/lang/ru_RU.ts +++ b/tracker-neuralnet/lang/ru_RU.ts @@ -40,6 +40,10 @@ Don't roll or change position.</source> <source>Up</source> <translation type="unfinished"></translation> </message> + <message> + <source>Exposure preset</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>neuralnet_tracker_ns::NeuralNetDialog</name> diff --git a/tracker-neuralnet/lang/stub.ts b/tracker-neuralnet/lang/stub.ts index 62ce527b..8461ce0f 100644 --- a/tracker-neuralnet/lang/stub.ts +++ b/tracker-neuralnet/lang/stub.ts @@ -40,6 +40,10 @@ Don't roll or change position.</source> <source>Up</source> <translation type="unfinished"></translation> </message> + <message> + <source>Exposure preset</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>neuralnet_tracker_ns::NeuralNetDialog</name> diff --git a/tracker-neuralnet/lang/zh_CN.ts b/tracker-neuralnet/lang/zh_CN.ts index 39a6c0e2..4b24f3db 100644 --- a/tracker-neuralnet/lang/zh_CN.ts +++ b/tracker-neuralnet/lang/zh_CN.ts @@ -40,6 +40,10 @@ Don't roll or change position.</source> <source>Up</source> <translation type="unfinished"></translation> </message> + <message> + <source>Exposure preset</source> + <translation type="unfinished"></translation> + </message> </context> <context> <name>neuralnet_tracker_ns::NeuralNetDialog</name> diff --git a/tracker-neuralnet/neuralnet-trackercontrols.ui b/tracker-neuralnet/neuralnet-trackercontrols.ui index 01fdd4bd..c03f866c 100644 --- a/tracker-neuralnet/neuralnet-trackercontrols.ui +++ b/tracker-neuralnet/neuralnet-trackercontrols.ui @@ -10,21 +10,14 @@ <x>0</x> <y>0</y> <width>445</width> - <height>226</height> + <height>355</height> </rect> </property> <property name="windowTitle"> <string>Tracker settings</string> </property> <layout class="QGridLayout" name="gridLayout"> - <item row="8" column="0"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - <item row="6" column="0"> + <item row="7" column="0"> <widget class="QLabel" name="resolution_display"> <property name="autoFillBackground"> <bool>true</bool> @@ -260,7 +253,7 @@ Don't roll or change position.</string> </layout> </widget> </item> - <item row="4" column="0"> + <item row="5" column="0"> <widget class="QPushButton" name="camera_settings"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> @@ -273,6 +266,45 @@ Don't roll or change position.</string> </property> </widget> </item> + <item row="9" column="0"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QGroupBox" name="groupBox"> + <property name="title"> + <string>Camera settings</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Exposure preset</string> + </property> + </widget> + </item> + <item row="0" column="1"> + <widget class="QComboBox" name="exposure_preset"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> <resources/> |