diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-07 01:01:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2013-04-07 01:01:06 +0200 |
commit | a55ae207560f385ed2b56b452fe56f1e2ecac38a (patch) | |
tree | a4fb17f0d61defba9b70a2e4f9e035d81650e9d3 | |
parent | 2d68f644ccc1b68904f769c21737ae46f70f53fa (diff) |
Better RANSAC params
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 35 | ||||
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.h | 15 | ||||
-rw-r--r-- | ftnoir_tracker_ht/ht-trackercontrols.ui (renamed from ftnoir_tracker_ht/trackercontrols.ui) | 15 |
3 files changed, 50 insertions, 15 deletions
diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index 5db70115..c5e860ee 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -3,7 +3,7 @@ #include "headtracker-ftnoir.h" #include "ftnoir_tracker_ht.h" #include "ftnoir_tracker_ht_dll.h" -#include "ui_trackercontrols.h" +#include "ui_ht-trackercontrols.h" #include "facetracknoir/global-settings.h" #include <cmath> @@ -14,6 +14,15 @@ #endif // delicious copypasta +static void open_settings_dialog(int idx, void* parent) { +#if defined(_WIN32) || defined(__WIN32) + qDebug() << "opening settings"; + if (idx == 0) + idx = 1; +#endif +} + +// delicious copypasta static QList<QString> get_camera_names(void) { QList<QString> ret; #if defined(_WIN32) || defined(__WIN32) @@ -102,19 +111,19 @@ static void load_settings(ht_config_t* config, Tracker* tracker) config->pyrlk_win_size_w = config->pyrlk_win_size_h = 21; config->max_keypoints = 100; config->keypoint_quality = 7; - config->keypoint_distance = 1; - config->keypoint_3distance = 5.5; + config->keypoint_distance = 1.5; + config->keypoint_3distance = 5.0; //config->force_width = 640; //config->force_height = 480; config->force_fps = iniFile.value("fps", 0).toInt(); config->camera_index = iniFile.value("camera-index", -1).toInt(); config->ransac_num_iters = 100; - config->ransac_max_reprojection_error = 4.05; - config->ransac_max_inlier_error = 4.09; + config->ransac_max_reprojection_error = 3.75; + config->ransac_max_inlier_error = 3.8; config->ransac_max_mean_error = 4; config->ransac_abs_max_mean_error = 10; config->debug = 0; - config->ransac_min_features = 0.87; + config->ransac_min_features = 0.85; int res = iniFile.value("resolution", 0).toInt(); if (res < 0 || res >= (int)(sizeof(*resolution_choices) / sizeof(resolution_tuple))) res = 0; @@ -296,9 +305,20 @@ extern "C" FTNOIR_TRACKER_BASE_EXPORT void* CALLING_CONVENTION GetDialog( ) return (ITrackerDialog*) new TrackerControls; } +void TrackerControls::cameraSettings() { + open_settings_dialog(ui.cameraName->currentIndex(), +#if defined(_WIN32) + (HANDLE) winId() +#else + NULL +#endif + ); +} + TrackerControls::TrackerControls() { ui.setupUi(this); + setAttribute(Qt::WA_NativeWindow, true); connect(ui.cameraName, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int))); connect(ui.cameraFPS, SIGNAL(currentIndexChanged(int)), this, SLOT(settingChanged(int))); connect(ui.cameraFOV, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); @@ -310,6 +330,7 @@ TrackerControls::TrackerControls() connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel())); connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK())); + connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings())); loadSettings(); settingsDirty = false; } @@ -339,7 +360,7 @@ void TrackerControls::loadSettings() QSettings iniFile( currentFile, QSettings::IniFormat ); iniFile.beginGroup( "HT-Tracker" ); ui.cameraName->setCurrentIndex(iniFile.value("camera-index", -1).toInt() + 1); - ui.cameraFOV->setValue(iniFile.value("fov", 69).toFloat()); + ui.cameraFOV->setValue(iniFile.value("fov", 52).toFloat()); int fps; switch (iniFile.value("fps", 0).toInt()) { diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index f5d0c271..5a17e4af 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Stanisław Halik <sthalik@misaki.pl> +/* Copyright (c) 2013 Stanislaw Halik <sthalik@misaki.pl> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -11,7 +11,7 @@ #include "stdafx.h" #include "ftnoir_tracker_base/ftnoir_tracker_base.h" #include "headtracker-ftnoir.h" -#include "ui_trackercontrols.h" +#include "ui_ht-trackercontrols.h" #include "video_widget.h" #include "compat/compat.h" #include <QObject> @@ -59,8 +59,8 @@ public: void showEvent ( QShowEvent * event ); void Initialize(QWidget *parent); - void registerTracker(ITracker *tracker) {}; - void unRegisterTracker() {}; + void registerTracker(ITracker *tracker) {} + void unRegisterTracker() {} private: Ui::Form ui; @@ -71,9 +71,10 @@ private: private slots: void doOK(); void doCancel(); - void settingChanged() { settingsDirty = true; }; - void settingChanged(int) { settingsDirty = true; }; - void settingChanged(double) { settingsDirty = true; }; + void settingChanged() { settingsDirty = true; } + void settingChanged(int) { settingsDirty = true; } + void settingChanged(double) { settingsDirty = true; } + void cameraSettings(); }; #endif diff --git a/ftnoir_tracker_ht/trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui index 2f4b1915..968b7dc7 100644 --- a/ftnoir_tracker_ht/trackercontrols.ui +++ b/ftnoir_tracker_ht/ht-trackercontrols.ui @@ -60,7 +60,7 @@ <double>180.000000000000000</double> </property> <property name="value"> - <double>69.000000000000000</double> + <double>52.000000000000000</double> </property> </widget> <widget class="QLabel" name="label_2"> @@ -572,6 +572,19 @@ </property> </widget> </widget> + <widget class="QPushButton" name="buttonSettings"> + <property name="geometry"> + <rect> + <x>10</x> + <y>130</y> + <width>101</width> + <height>23</height> + </rect> + </property> + <property name="text"> + <string>Camera settings</string> + </property> + </widget> </widget> <resources/> <connections/> |