From 747dcf7cfbc2498312bdcdbd89eb741493dfb44b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 15 Sep 2013 16:02:20 +0200 Subject: Make every tracker/protocol/filter dialog modal This is since changing the tracker/protocol/filter from a combobox will cause a use-after-free and a nasty crash. --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 3ad9fa40..4fe97e51 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -3,7 +3,7 @@ Form - Qt::NonModal + Qt::ApplicationModal @@ -464,15 +464,18 @@ Rafael Muñoz Salinas <rmsalinas@uco.es> - 370 + 327 200 - 181 + 255 20 https://github.com/rmsalinas/aruco + + Qt::AlignCenter + true -- cgit v1.2.3 From 2323153f0eba6c1079ce91669468cc44c157a484 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 24 Oct 2013 15:37:38 +0200 Subject: aruco-ui: add layout Signed-off-by: Stanislaw Halik --- .../ftnoir_accela_filtercontrols.ui | 108 +-- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 795 +++++++++------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 6 +- 3 files changed, 414 insertions(+), 495 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui index 098213ef..324acdf9 100644 --- a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui +++ b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui @@ -9,8 +9,8 @@ 0 0 - 459 - 207 + 347 + 268 @@ -27,8 +27,8 @@ - 459 - 207 + 6667 + 6666 @@ -48,13 +48,25 @@ + + QFormLayout::ExpandingFieldsGrow + + + 4 + + + 4 + + + 6 + true - + 0 0 @@ -241,45 +253,6 @@ background:none; - - - - - 0 - 0 - - - - - 8 - - - - QFrame::NoFrame - - - <html><head/><body><p align="justify">Accela filter by Stanisław Halik<br/>With kind help from Donovan Baarda</p><p align="right">2012-2013</p></body></html> - - - Qt::RichText - - - false - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true - - - 0 - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - @@ -556,7 +529,52 @@ background:none; - + + + + + 0 + 0 + + + + + 7 + + + + QFrame::NoFrame + + + <html><head/><body><p align="justify">Accela by <a href="https://github.com/sthalik"><span style=" text-decoration: underline; color:#0057ae;">Stanisław Halik</span></a><br/>Help from <a href="https://github.com/dbaarda"><span style=" text-decoration: underline; color:#0057ae;">Donovan Baarda</span></a></p><p align="justify">2012-2013</p></body></html> + + + Qt::RichText + + + false + + + Qt::AlignCenter + + + true + + + 0 + + + 0 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 4fe97e51..c007e93b 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -9,8 +9,8 @@ 0 0 - 593 - 280 + 704 + 273 @@ -21,465 +21,364 @@ - 750 - 280 + 6666 + 6666 HT tracker settings - - - - 10 - 10 - 141 - 16 - - - - Horizontal FOV - - - - - - 130 - 10 - 251 - 22 - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - - - 10 - 40 - 137 - 16 - - - - Frames per second - - - - - - 130 - 40 - 251 - 22 - - - - - Default - + + + -1 + + + + + Distortion coefficients + + - - - 30 - + + + + + 0 + 0 + + + + true + + + QAbstractSpinBox::NoButtons + + + 11 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + 0.000000000000000 + + - - - 60 - + + + + + 0 + 0 + + + + true + + + QAbstractSpinBox::NoButtons + + + 11 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + 0.000000000000000 + + - - - 120 - + + + + + 0 + 0 + + + + true + + + QAbstractSpinBox::NoButtons + + + 11 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + 0.000000000000000 + + - - - - - 10 - 70 - 133 - 16 - - - - Camera name - - - - - - 430 - 250 - 75 - 23 - - - - OK - - - - - - 510 - 250 - 75 - 23 - - - - Cancel - - - - - - 390 - 10 - 101 - 81 - - - - Enable axes - - - - - 10 - 20 - 70 - 17 - - - - RX - - - - - - 10 - 40 - 70 - 17 - - - - RY - - - - - - 10 - 60 - 70 - 17 - - - - RZ - - - - - - 60 - 20 - 70 - 17 - - - - TX - - - - - - 60 - 40 - 70 - 17 - - - - TY - - - - - - 60 - 60 - 70 - 17 - - - - TZ - - - - - - - 130 - 70 - 251 - 22 - - - - - - - 10 - 100 - 128 - 16 - - - - Resolution - - - - - - 130 - 100 - 251 - 22 - - - - - 640x480 - + + + + + 0 + 0 + + + + true + + + QAbstractSpinBox::NoButtons + + + 11 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + 0.000000000000000 + + - - - 320x240 - + + + + + 0 + 0 + + + + true + + + QAbstractSpinBox::NoButtons + + + 11 + + + -1000.000000000000000 + + + 1000.000000000000000 + + + 0.000000000000000 + + - - - 320x200 - + + + + + 0 + 0 + + + + <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 4 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + - - - Default (not recommended!) - + + + + + Default + + + + + 30 + + + + + 60 + + + + + 120 + + + - - - - - 130 - 130 - 171 - 22 - - - - true - - - QAbstractSpinBox::NoButtons - - - 24 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - 10 - 130 - 111 - 16 - - - - Distortion coefficients - - - - - - 130 - 160 - 171 - 22 - - - - true - - - QAbstractSpinBox::NoButtons - - - 24 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - 130 - 190 - 171 - 22 - - - - true - - - QAbstractSpinBox::NoButtons - - - 24 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - 130 - 220 - 171 - 22 - - - - true - - - QAbstractSpinBox::NoButtons - - - 24 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - 130 - 250 - 171 - 22 - - - - true - - - QAbstractSpinBox::NoButtons - - - 24 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - 325 - 133 - 253 - 60 - - - - The ARUCO Library has been developed by -the Ava group of the Univeristy of Cordoba(Spain) -Contact to -Rafael Muñoz Salinas <rmsalinas@uco.es> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - 327 - 200 - 255 - 20 - - - - https://github.com/rmsalinas/aruco - - - Qt::AlignCenter - - - true - - + + + + Camera name + + + + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + + + + Frames per second + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Horizontal FOV + + + + + + + Resolution + + + + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + + + + + + + Enable axes + + + + -1 + + + 6 + + + 0 + + + 6 + + + 0 + + + + + RX + + + + + + + TX + + + + + + + RY + + + + + + + TY + + + + + + + RZ + + + + + + + TZ + + + + + + + diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 4daffe5e..25273f35 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -363,9 +363,11 @@ TrackerControls::TrackerControls() connect(ui.tx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); connect(ui.ty, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); 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.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel())); + //connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK())); //connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings())); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); loadSettings(); settingsDirty = false; } -- cgit v1.2.3 From a2a32cda8e2ed8931a04a20d7422a45538c6c8b3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 26 Oct 2013 23:02:42 +0200 Subject: implement head centroid for aruco Signed-off-by: Stanislaw Halik --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 217 ++++++++------------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 84 ++++++---- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 +- 3 files changed, 124 insertions(+), 179 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index c007e93b..76d750af 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -32,154 +32,7 @@ -1 - - - - Distortion coefficients - - - - - - - - 0 - 0 - - - - true - - - QAbstractSpinBox::NoButtons - - - 11 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - true - - - QAbstractSpinBox::NoButtons - - - 11 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - true - - - QAbstractSpinBox::NoButtons - - - 11 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - true - - - QAbstractSpinBox::NoButtons - - - 11 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - - - - - 0 - 0 - - - - true - - - QAbstractSpinBox::NoButtons - - - 11 - - - -1000.000000000000000 - - - 1000.000000000000000 - - - 0.000000000000000 - - - - + @@ -267,7 +120,7 @@ - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -378,6 +231,72 @@ + + + + Head centroid position + + + Qt::AlignCenter + + + + Qt::AlignHCenter|Qt::AlignTop + + + + + TX + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + TY + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + TZ + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index b532ac9c..7ad80b46 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -120,8 +120,11 @@ void Tracker::load_settings() enableTX = iniFile.value("enable-tx", true).toBool(); enableTY = iniFile.value("enable-ty", true).toBool(); enableTZ = iniFile.value("enable-tz", true).toBool(); - for (int i = 0; i < 5; i++) - dc[i] = iniFile.value(QString("dc%1").arg(i), 0).toFloat(); + + for (int i = 0; i < 3; i++) + { + headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); + } iniFile.endGroup(); } @@ -194,6 +197,7 @@ void Tracker::run() double error = 0; std::vector reprojection; auto kernel = cv::createGaussianFilter(CV_8U, cv::Size(5, 5), 0); + cv::Point2f last_centroid; while (!stop) { if (!camera.read(color_)) @@ -218,7 +222,7 @@ void Tracker::run() cv::Mat dist_coeffs = cv::Mat::zeros(5, 1, CV_32FC1); for (int i = 0; i < 5; i++) - dist_coeffs.at(i) = dc[i]; + dist_coeffs.at(i) = 0; std::vector< aruco::Marker > markers; @@ -239,6 +243,8 @@ void Tracker::run() 3); } + cv::circle(frame, last_centroid, 4, cv::Scalar(0, 0, 0), -1); + auto time = cv::getTickCount(); if ((long) (time / freq) != (long) (last_time / freq)) @@ -271,18 +277,18 @@ void Tracker::run() const float size = 7; cv::Mat obj_points(4,3,CV_32FC1); - obj_points.at(1,0)=-size; - obj_points.at(1,1)=-size; - obj_points.at(1,2)=0; - obj_points.at(2,0)=size; - obj_points.at(2,1)=-size; - obj_points.at(2,2)=0; - obj_points.at(3,0)=size; - obj_points.at(3,1)=size; - obj_points.at(3,2)=0; - obj_points.at(0,0)=-size; - obj_points.at(0,1)=size; - obj_points.at(0,2)=0; + obj_points.at(1,0)=-size + headpos[0]; + obj_points.at(1,1)=-size + headpos[1]; + obj_points.at(1,2)=0 + headpos[2]; + obj_points.at(2,0)=size + headpos[0]; + obj_points.at(2,1)=-size + headpos[1]; + obj_points.at(2,2)=0 + headpos[2]; + obj_points.at(3,0)=size + headpos[0]; + obj_points.at(3,1)=size + headpos[1]; + obj_points.at(3,2)=0 + headpos[2]; + obj_points.at(0,0)=-size + headpos[0]; + obj_points.at(0,1)=size + headpos[1]; + obj_points.at(0,2)=0 + headpos[2]; cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, false, cv::ITERATIVE); @@ -315,6 +321,14 @@ void Tracker::run() error += std::sqrt(x * x + y * y); } + reprojection.clear(); + reprojection.resize(1); + std::vector centroid; + centroid.push_back(cv::Point3f(0, 0, 0)); + cv::projectPoints(centroid, rvec, tvec, intrinsics, dist_coeffs, reprojection); + + last_centroid = reprojection[0]; + //pose[Yaw] -= atan(pose[TX] / pose[TZ]) * 180 / HT_PI; //pose[Pitch] -= atan(pose[TY] / pose[TZ]) * 180 / HT_PI; } @@ -414,6 +428,9 @@ TrackerControls::TrackerControls() connect(ui.tx, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); connect(ui.ty, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); connect(ui.tz, SIGNAL(stateChanged(int)), this, SLOT(settingChanged(int))); + connect(ui.cx, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); + connect(ui.cy, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); + connect(ui.cz, SIGNAL(valueChanged(double)), this, SLOT(settingChanged(double))); //connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(doCancel())); //connect(ui.buttonOK, SIGNAL(clicked()), this, SLOT(doOK())); //connect(ui.buttonSettings, SIGNAL(clicked()), this, SLOT(cameraSettings())); @@ -474,13 +491,18 @@ void TrackerControls::loadSettings() ui.ty->setCheckState(iniFile.value("enable-ty", true).toBool() ? Qt::Checked : Qt::Unchecked); ui.tz->setCheckState(iniFile.value("enable-tz", true).toBool() ? Qt::Checked : Qt::Unchecked); ui.resolution->setCurrentIndex(iniFile.value("resolution", 0).toInt()); - - ui.doubleSpinBox->setValue(iniFile.value("dc0").toDouble()); - ui.doubleSpinBox_2->setValue(iniFile.value("dc1").toDouble()); - ui.doubleSpinBox_3->setValue(iniFile.value("dc2").toDouble()); - ui.doubleSpinBox_4->setValue(iniFile.value("dc3").toDouble()); - ui.doubleSpinBox_5->setValue(iniFile.value("dc4").toDouble()); - + + QDoubleSpinBox* headpos[] = { + ui.cx, + ui.cy, + ui.cz + }; + + for (int i = 0; i < 3; i++) + { + headpos[i]->setValue(iniFile.value(QString("headpos-%1").arg(i)).toDouble()); + } + iniFile.endGroup(); settingsDirty = false; } @@ -519,13 +541,17 @@ void TrackerControls::save() iniFile.setValue("enable-ty", ui.ty->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("resolution", ui.resolution->currentIndex()); - - iniFile.setValue("dc0", ui.doubleSpinBox->value()); - iniFile.setValue("dc1", ui.doubleSpinBox_2->value()); - iniFile.setValue("dc2", ui.doubleSpinBox_3->value()); - iniFile.setValue("dc3", ui.doubleSpinBox_4->value()); - iniFile.setValue("dc4", ui.doubleSpinBox_5->value()); - + + QDoubleSpinBox* headpos[] = { + ui.cx, + ui.cy, + ui.cz + }; + + for (int i = 0; i < 3; i++) + { + iniFile.setValue(QString("headpos-%1").arg(i), headpos[i]->value()); + } iniFile.endGroup(); settingsDirty = false; } diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 8d532b4c..5d3d4ed6 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -35,11 +35,11 @@ private: volatile bool stop; float fov; int camera_index; - float dc[5]; int force_fps, force_width, force_height; void load_settings(); double pose[6]; cv::Mat frame; + double headpos[3]; }; // Widget that has controls for FTNoIR protocol client-settings. -- cgit v1.2.3 From 58989d52c2c0650611d26ab223ccd43f4891bb41 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 29 Nov 2013 10:07:56 +0100 Subject: Implement Aruco pitch change --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 28 ++++++++++++++++++++++++- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 30 ++++++++++++++++++++++----- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 +- 3 files changed, 53 insertions(+), 7 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 76d750af..8cf28057 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 704 - 273 + 308 @@ -294,6 +294,32 @@ + + + + Pitch + + + + + + + ° + + + 2 + + + -60.000000000000000 + + + 60.000000000000000 + + + 0.000000000000000 + + + diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 41bf0edd..ddbdadb0 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -128,6 +128,8 @@ void Tracker::load_settings() { headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); } + headpitch = iniFile.value("pitch", 0).toDouble(); + iniFile.endGroup(); } @@ -328,17 +330,27 @@ void Tracker::run() cv::Rodrigues(rvec, rotation_matrix); - cv::Vec3d foo = cv::RQDecomp3x3(rotation_matrix, junk1, junk2); - { + const double beta = headpitch * M_PI / 180; + double pitch[] = { + 1, 0, 0, + 0, cos(beta), -sin(beta), + 0, sin(beta), cos(beta) + }; + cv::Mat rot(3, 3, CV_64F, pitch); + tvec = rot * tvec; + rotation_matrix = rot * rotation_matrix; + + cv::Vec3d euler = cv::RQDecomp3x3(rotation_matrix, junk1, junk2); + QMutexLocker lck(&mtx); for (int i = 0; i < 3; i++) pose[i] = tvec.at(i); - pose[Yaw] = foo[1]; - pose[Pitch] = -foo[0]; - pose[Roll] = foo[2]; + pose[Yaw] = euler[1]; + pose[Pitch] = -euler[0]; + pose[Roll] = euler[2]; } std::vector repr2; @@ -346,6 +358,11 @@ void Tracker::run() centroid.push_back(cv::Point3f(0, 0, 0)); cv::projectPoints(centroid, rvec, tvec, intrinsics, dist_coeffs, repr2); + { + auto s = cv::Scalar(255, 0, 255); + cv::circle(frame, repr2.at(0), 4, s, -1); + } + last_centroid = repr2[0]; } else @@ -527,6 +544,8 @@ void TrackerControls::loadSettings() headpos[i]->setValue(iniFile.value(QString("headpos-%1").arg(i)).toDouble()); } + ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble()); + iniFile.endGroup(); settingsDirty = false; } @@ -565,6 +584,7 @@ void TrackerControls::save() iniFile.setValue("enable-ty", ui.ty->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("resolution", ui.resolution->currentIndex()); + iniFile.setValue("pitch", ui.pitch_deg->value()); QDoubleSpinBox* headpos[] = { ui.cx, diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 3a2ebeea..1518ba4d 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -40,7 +40,7 @@ private: int force_fps, force_width, force_height; double pose[6]; cv::Mat frame; - double headpos[3]; + double headpos[3], headpitch; cv::VideoCapture camera; }; -- cgit v1.2.3 From 49b2ac5b1c96e47636664439ab260f1ea4239be1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Dec 2013 12:38:59 +0100 Subject: ui: fix tab order Signed-off-by: Stanislaw Halik --- facetracknoir/ftnoir_curves.ui | 23 +- facetracknoir/ftnoir_keyboardshortcuts.ui | 448 ++++++++++----------- .../ftnoir_accela_filtercontrols.ui | 16 + ftnoir_tracker_aruco/aruco-trackercontrols.ui | 415 ++++++++++--------- 4 files changed, 465 insertions(+), 437 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/facetracknoir/ftnoir_curves.ui b/facetracknoir/ftnoir_curves.ui index 2b843303..213e8f9a 100644 --- a/facetracknoir/ftnoir_curves.ui +++ b/facetracknoir/ftnoir_curves.ui @@ -29,8 +29,8 @@ background-color: #ccc; - - + + background-color: #ccc; @@ -763,7 +763,7 @@ - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -779,6 +779,23 @@
qfunctionconfigurator.h
+ + pos_rx + pos_ry + pos_rz + pos_tx + pos_ty + pos_tz + checkBox + tz_altp + ty_altp + tabWidget + ry_altp + buttonBox + rz_altp + rx_altp + tx_altp + diff --git a/facetracknoir/ftnoir_keyboardshortcuts.ui b/facetracknoir/ftnoir_keyboardshortcuts.ui index a189b680..565c0e77 100644 --- a/facetracknoir/ftnoir_keyboardshortcuts.ui +++ b/facetracknoir/ftnoir_keyboardshortcuts.ui @@ -29,241 +29,219 @@ false - - - - 120 - 90 - 100 - 23 - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Cancel - - - - - - 230 - 90 - 100 - 23 - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - OK - - - - - - 5 - 0 - 321 - 75 - - - - - - - - 0 - 0 - - - - Keyboard - - - Qt::AlignCenter - - - false - - - - - - - - 0 - 0 - - - - Center - - - false - - - - - - - - 50 - 16777215 - - - - Shift - - - - - - - - 50 - 16777215 - - - - Ctrl - - - - - - - - 50 - 16777215 - - - - Alt - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically - - - - - - - - 0 - 0 - - - - Toggle - - - false - - - - - - - - 50 - 16777215 - - - - Shift - - - - - - - - 50 - 16777215 - - - - Ctrl - - - - - - - - 50 - 16777215 - - - - Alt - - - - - - - - 90 - 0 - - - - Select Number - - - QComboBox::InsertAlphabetically - - - - - + + + + + + 0 + 0 + + + + Keyboard + + + Qt::AlignCenter + + + false + + + + + + + + 0 + 0 + + + + Center + + + false + + + + + + + + 50 + 16777215 + + + + Shift + + + + + + + + 50 + 16777215 + + + + Ctrl + + + + + + + + 50 + 16777215 + + + + Alt + + + + + + + + 90 + 0 + + + + Select Number + + + QComboBox::InsertAlphabetically + + + + + + + + 0 + 0 + + + + Toggle + + + false + + + + + + + + 50 + 16777215 + + + + Shift + + + + + + + + 50 + 16777215 + + + + Ctrl + + + + + + + + 50 + 16777215 + + + + Alt + + + + + + + + 90 + 0 + + + + Select Number + + + QComboBox::InsertAlphabetically + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + Cancel + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + OK + + + +
diff --git a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui index b4b12061..536cf328 100644 --- a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui +++ b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui @@ -715,6 +715,22 @@ background:none;
+ + rotation_alpha + translation_alpha + order_2nd + order_3rd + spinZoom + deadzone + expt + doubleSpinBox + doubleSpinBox_2 + doubleSpinBox_3 + doubleSpinBox_4 + doubleSpinBox_5 + doubleSpinBox_6 + buttonBox + diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 8cf28057..d4b64c23 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -32,205 +32,6 @@ -1 - - - - - 0 - 0 - - - - <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 4 - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - Default - - - - - 30 - - - - - 60 - - - - - 120 - - - - - - - - Camera name - - - - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - - - - Frames per second - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Horizontal FOV - - - - - - - Resolution - - - - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - - - - - Enable axes - - - - -1 - - - 6 - - - 0 - - - 6 - - - 0 - - - - - RX - - - - - - - TX - - - - - - - RY - - - - - - - TY - - - - - - - RZ - - - - - - - TZ - - - - - - @@ -323,8 +124,224 @@
+ + + + Enable axes + + + + -1 + + + 6 + + + 0 + + + 6 + + + 0 + + + + + RX + + + + + + + TX + + + + + + + RY + + + + + + + TY + + + + + + + RZ + + + + + + + TZ + + + + + + + + + + Resolution + + + + + + + + Default + + + + + 30 + + + + + 60 + + + + + 120 + + + + + + + + Frames per second + + + + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + 0 + 0 + + + + <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 4 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + + + + Camera name + + + + + + + Horizontal FOV + + + + + cameraFOV + cameraFPS + cameraName + resolution + cx + cy + cz + pitch_deg + rx + ry + rz + tx + ty + tz + buttonBox + -- cgit v1.2.3 From 810293b5639f9a3df67c343866544c34eda84192 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Dec 2013 05:44:14 +0100 Subject: implement optional aruco frame smoothing ewma scheme --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 310 +++++++++++++++----------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 53 ++++- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 + 3 files changed, 233 insertions(+), 132 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index d4b64c23..340ed0ad 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 704 - 308 + 399 @@ -32,7 +32,106 @@ -1 - + + + + Horizontal FOV + + + + + + + Enable axes + + + + -1 + + + 6 + + + 0 + + + 6 + + + 0 + + + + + RX + + + + + + + TX + + + + + + + RY + + + + + + + TY + + + + + + + RZ + + + + + + + TZ + + + + + + + + + + Frames per second + + + + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + Head centroid position @@ -124,79 +223,6 @@ - - - - Enable axes - - - - -1 - - - 6 - - - 0 - - - 6 - - - 0 - - - - - RX - - - - - - - TX - - - - - - - RY - - - - - - - TY - - - - - - - RZ - - - - - - - TZ - - - - - - - - - - Resolution - - - @@ -221,48 +247,14 @@ - - + + - Frames per second - - - - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + Resolution - - - - + @@ -293,19 +285,34 @@ - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -316,10 +323,54 @@ - - + + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + + - Horizontal FOV + Frame EWMA @@ -340,7 +391,6 @@ tx ty tz - buttonBox diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 9a8c09d5..fa83955c 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #if defined(_WIN32) # define NO_DSHOW_STRSAFE @@ -129,12 +129,14 @@ void Tracker::load_settings() headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); } headpitch = iniFile.value("pitch", 0).toDouble(); + N_hyst = iniFile.value("ewma", 0).toInt(); iniFile.endGroup(); } Tracker::Tracker() { + N_hyst = 0; layout = nullptr; stop = false; videoWidget = NULL; @@ -192,7 +194,7 @@ void Tracker::run() cv::Mat color, color_, grayscale, rvec, tvec; - const double stateful_coeff = 0.9; + const double stateful_coeff = 0.88; if (!camera.isOpened()) { @@ -209,6 +211,29 @@ void Tracker::run() int fps = 0; int last_fps = 0; cv::Point2f last_centroid; + + bool first_run = true; + + std::vector lasts; + + for (int i = 0; i < N_hyst; i++) + lasts.push_back(cv::Mat()); + + vector weights; + { + const float a = 0.32; + float sum = 0; + float k = 1; + for (int i = 0; i < N_hyst; i++) + { + sum += k; + weights.push_back(k); + k *= 1./(a*N_hyst); + } + for (int i = 0; i < N_hyst; i++) + qDebug() << i << "w" << (weights[i] /= sum); + } + while (!stop) { if (!camera.read(color_)) @@ -217,6 +242,28 @@ void Tracker::run() color_.copyTo(color); cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); + if (first_run) + { + first_run = false; + for (int i = 0; i < N_hyst; i++) + lasts[i] = grayscale; + } + if (N_hyst > 0) + { + cv::Mat hyst(grayscale.rows, grayscale.cols, CV_32F); + hyst.setTo(0); + for (int i = 0; i < N_hyst-1; i++) + lasts[i] = lasts[i+1]; + lasts[N_hyst-1] = grayscale; + for (int i = 0; i < N_hyst; i++) + for (int y = 0; y < grayscale.rows; y++) + for (int x = 0; x < grayscale.cols; x++) + hyst.at(y, x) += (float) lasts[i].at(y, x) * weights[i]; + hyst.convertTo(grayscale, CV_8U); + } + + cv::cvtColor(grayscale, color, cv::COLOR_GRAY2BGR); + const int scale = frame.cols > 480 ? 2 : 1; detector.setThresholdParams(scale > 1 ? 11 : 7, 4); @@ -543,6 +590,7 @@ void TrackerControls::loadSettings() } ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble()); + ui.ewma->setCurrentIndex(iniFile.value("ewma", 0).toInt()); iniFile.endGroup(); settingsDirty = false; @@ -583,6 +631,7 @@ void TrackerControls::save() iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("resolution", ui.resolution->currentIndex()); iniFile.setValue("pitch", ui.pitch_deg->value()); + iniFile.setValue("ewma", ui.ewma->currentIndex()); QDoubleSpinBox* headpos[] = { ui.cx, diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index be2ad3d7..249c8829 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -42,6 +42,8 @@ private: cv::Mat frame; double headpos[3], headpitch; cv::VideoCapture camera; + int N_hyst; + cv::Mat lasts; }; // Widget that has controls for FTNoIR protocol client-settings. -- cgit v1.2.3 From 232c41ad8b34f054583505f83f3b7aa3ebbba2b7 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Dec 2013 06:24:59 +0100 Subject: remove ewma frame support, too little gain --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 109 ++++++++++++-------------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 49 ------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 - 3 files changed, 52 insertions(+), 108 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 340ed0ad..6cc8c29d 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -105,6 +105,45 @@ + + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + @@ -254,6 +293,13 @@ + + + + Frame EWMA + + + @@ -285,30 +331,6 @@ - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - @@ -323,57 +345,30 @@ - - - - - 0 - - - - - 1 - - - - - 2 - - - - - 3 - - + + - 4 + 640x480 - 5 + 320x240 - 6 + 320x200 - 7 + Default (not recommended!) - - - - Frame EWMA - - - diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index c6d45f35..4c900ab4 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #if defined(_WIN32) # define NO_DSHOW_STRSAFE @@ -129,14 +128,12 @@ void Tracker::load_settings() headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); } headpitch = iniFile.value("pitch", 0).toDouble(); - N_hyst = iniFile.value("ewma", 0).toInt(); iniFile.endGroup(); } Tracker::Tracker() { - N_hyst = 0; layout = nullptr; stop = false; videoWidget = NULL; @@ -212,28 +209,6 @@ void Tracker::run() int last_fps = 0; cv::Point2f last_centroid; - bool first_run = true; - - std::vector lasts; - - for (int i = 0; i < N_hyst; i++) - lasts.push_back(cv::Mat()); - - vector weights; - { - const float a = 0.25; - float sum = 0; - float k = 1; - for (int i = 0; i < N_hyst; i++) - { - sum += k; - weights.push_back(k); - k *= 1./(a*N_hyst); - } - for (int i = 0; i < N_hyst; i++) - qDebug() << i << "w" << (weights[i] /= sum); - } - while (!stop) { if (!camera.read(color_)) @@ -242,28 +217,6 @@ void Tracker::run() color_.copyTo(color); cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); - if (N_hyst > 0) - { - if (first_run) - { - first_run = false; - for (int i = 0; i < N_hyst; i++) - lasts[i] = grayscale; - } - cv::Mat hyst(grayscale.rows, grayscale.cols, CV_32F); - hyst.setTo(0); - for (int i = 0; i < N_hyst-1; i++) - lasts[i] = lasts[i+1]; - lasts[N_hyst-1] = grayscale; - for (int i = 0; i < N_hyst; i++) - for (int y = 0; y < grayscale.rows; y++) - for (int x = 0; x < grayscale.cols; x++) - hyst.at(y, x) += lasts[i].at(y, x) * weights[i]; - hyst.convertTo(grayscale, CV_8U); - } - - cv::cvtColor(grayscale, color, cv::COLOR_GRAY2BGR); - const int scale = frame.cols > 480 ? 2 : 1; detector.setThresholdParams(scale > 1 ? 11 : 7, 4); @@ -593,7 +546,6 @@ void TrackerControls::loadSettings() } ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble()); - ui.ewma->setCurrentIndex(iniFile.value("ewma", 0).toInt()); iniFile.endGroup(); settingsDirty = false; @@ -634,7 +586,6 @@ void TrackerControls::save() iniFile.setValue("enable-tz", ui.tz->checkState() != Qt::Unchecked ? true : false); iniFile.setValue("resolution", ui.resolution->currentIndex()); iniFile.setValue("pitch", ui.pitch_deg->value()); - iniFile.setValue("ewma", ui.ewma->currentIndex()); QDoubleSpinBox* headpos[] = { ui.cx, diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 249c8829..be2ad3d7 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -42,8 +42,6 @@ private: cv::Mat frame; double headpos[3], headpitch; cv::VideoCapture camera; - int N_hyst; - cv::Mat lasts; }; // Widget that has controls for FTNoIR protocol client-settings. -- cgit v1.2.3 From fa54d5a4f8a0bf73cad7ebdd3895b8a7467868e6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Dec 2013 09:42:07 +0100 Subject: remove smoothing/ewma remnants --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 100 +++++++------------------- 1 file changed, 27 insertions(+), 73 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 6cc8c29d..629d1bbb 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -105,45 +105,6 @@ - - - - - 0 - - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - 6 - - - - @@ -151,26 +112,7 @@ - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - + Head centroid position @@ -262,6 +204,25 @@ + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + @@ -293,13 +254,6 @@
- - - - Frame EWMA - - - @@ -338,13 +292,6 @@ - - - - Camera name - - - @@ -369,6 +316,13 @@ + + + + Camera name + + + -- cgit v1.2.3 From fbbe79400ddf7397f2ec09e679ac79e139ebb1d5 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 29 Dec 2013 03:35:03 +0100 Subject: aruco: allow for filter only red spectrum --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 204 ++++++++++++++------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 12 +- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 1 + 3 files changed, 120 insertions(+), 97 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 629d1bbb..710a33e1 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 704 - 399 + 339 @@ -112,98 +112,6 @@ - - - - Head centroid position - - - Qt::AlignCenter - - - - Qt::AlignHCenter|Qt::AlignTop - - - - - TX - - - - - - - -200.000000000000000 - - - 200.000000000000000 - - - - - - - TY - - - - - - - -200.000000000000000 - - - 200.000000000000000 - - - - - - - TZ - - - - - - - -200.000000000000000 - - - 200.000000000000000 - - - - - - - Pitch - - - - - - - ° - - - 2 - - - -60.000000000000000 - - - 60.000000000000000 - - - 0.000000000000000 - - - - - - @@ -254,7 +162,7 @@ - + @@ -285,7 +193,7 @@ - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -323,6 +231,112 @@ + + + + Red channel only + + + + + + + Recommended! + + + + + + + Head centroid position + + + Qt::AlignCenter + + + + Qt::AlignHCenter|Qt::AlignTop + + + + + TX + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + TY + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + TZ + + + + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + Pitch + + + + + + + ° + + + 2 + + + -60.000000000000000 + + + 60.000000000000000 + + + 0.000000000000000 + + + + + + diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 4c900ab4..9408de02 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -128,6 +128,7 @@ void Tracker::load_settings() headpos[i] = iniFile.value(QString("headpos-%1").arg(i), 0).toDouble(); } headpitch = iniFile.value("pitch", 0).toDouble(); + red_only = iniFile.value("red-only", true).toBool(); iniFile.endGroup(); } @@ -215,7 +216,13 @@ void Tracker::run() continue; auto tm = cv::getTickCount(); color_.copyTo(color); - cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); + if (red_only) + { + cv::Mat channel[3]; + cv::split(color, channel); + grayscale = channel[2]; + } else + cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY); const int scale = frame.cols > 480 ? 2 : 1; detector.setThresholdParams(scale > 1 ? 11 : 7, 4); @@ -546,7 +553,7 @@ void TrackerControls::loadSettings() } ui.pitch_deg->setValue(iniFile.value("pitch", 0).toDouble()); - + ui.red_only->setChecked(iniFile.value("red-only", true).toBool()); iniFile.endGroup(); settingsDirty = false; } @@ -597,6 +604,7 @@ void TrackerControls::save() { iniFile.setValue(QString("headpos-%1").arg(i), headpos[i]->value()); } + iniFile.setValue("red-only", ui.red_only->isChecked()); iniFile.endGroup(); settingsDirty = false; if (tracker) diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index be2ad3d7..545ad5d0 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -42,6 +42,7 @@ private: cv::Mat frame; double headpos[3], headpitch; cv::VideoCapture camera; + volatile bool red_only; }; // Widget that has controls for FTNoIR protocol client-settings. -- cgit v1.2.3 From f32f731518ffe2a2b3f7463eda6cf01b7e09eab3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 31 Dec 2013 08:43:51 +0100 Subject: resize and cleanup aruco ui --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 256 ++++++++++++-------------- 1 file changed, 122 insertions(+), 134 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 710a33e1..3bf141de 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -9,12 +9,12 @@ 0 0 - 704 - 339 + 630 + 315 - + 0 0 @@ -32,78 +32,8 @@ -1 - - - - Horizontal FOV - - - - - - - Enable axes - - - - -1 - - - 6 - - - 0 - - - 6 - - - 0 - - - - - RX - - - - - - - TX - - - - - - - RY - - - - - - - TY - - - - - - - RZ - - - - - - - TZ - - - - - + + @@ -112,9 +42,6 @@ - - - @@ -131,6 +58,20 @@ + + + + Recommended! + + + + + + + Camera name + + + @@ -155,13 +96,6 @@ - - - - Resolution - - - @@ -193,13 +127,6 @@ - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - @@ -224,39 +151,109 @@ - - + + - Camera name + Red channel only - - + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + - Red channel only + Horizontal FOV - - + + - Recommended! + Resolution - + + + + Enable axes + + + + -1 + + + 6 + + + 0 + + + 6 + + + 0 + + + + + RX + + + + + + + TX + + + + + + + RY + + + + + + + TY + + + + + + + RZ + + + + + + + TZ + + + + + + + - Head centroid position + Head position Qt::AlignCenter - - - Qt::AlignHCenter|Qt::AlignTop - + @@ -266,6 +263,12 @@ + + + 0 + 0 + + -200.000000000000000 @@ -283,6 +286,12 @@ + + + 0 + 0 + + -200.000000000000000 @@ -300,6 +309,12 @@ + + + 0 + 0 + + -200.000000000000000 @@ -308,32 +323,6 @@ - - - - Pitch - - - - - - - ° - - - 2 - - - -60.000000000000000 - - - 60.000000000000000 - - - 0.000000000000000 - - - @@ -347,7 +336,6 @@ cx cy cz - pitch_deg rx ry rz -- cgit v1.2.3 From 4bef8ec6aebad1b709efd7393cb9f4a63b28ebf3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 4 Jan 2014 13:44:39 +0100 Subject: allow aruco to run at 180 hz --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 9 +++++++-- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 3bf141de..3f5a1d2a 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -30,7 +30,7 @@ - -1 + 7 @@ -94,6 +94,11 @@ 120 + + + 180 + + @@ -186,7 +191,7 @@ - -1 + 7 6 diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index b4f35c6f..136a983a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -157,6 +157,9 @@ void Tracker::run() case 3: fps = 120; break; + case 4: + fps = 180; + break; } camera = cv::VideoCapture(s.camera_index); if (r.width) -- cgit v1.2.3 From 55b133b78752137e05aa1437fbe9db83a7324d85 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Jan 2014 17:47:19 +0100 Subject: aruco: allow for changing marker pitch --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 326 ++++++++++++++------------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 21 +- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 4 +- 3 files changed, 189 insertions(+), 162 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 3f5a1d2a..e699eccc 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -32,158 +32,6 @@ 7 - - - - - - - Frames per second - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - - - - Recommended! - - - - - - - Camera name - - - - - - - - Default - - - - - 30 - - - - - 60 - - - - - 120 - - - - - 180 - - - - - - - - - 0 - 0 - - - - <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 4 - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - - - - - Red channel only - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Horizontal FOV - - - - - - - Resolution - - - @@ -250,7 +98,7 @@ - + Head position @@ -331,6 +179,175 @@ + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + + + + Recommended! + + + + + + + Frames per second + + + + + + + + 0 + 0 + + + + <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 4 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + Default + + + + + 30 + + + + + 60 + + + + + 120 + + + + + 180 + + + + + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + + + + + + + Camera name + + + + + + + Red channel only + + + + + + + Horizontal FOV + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Resolution + + + + + + + Marker pitch + + + + + + + -180.000000000000000 + + + 180.000000000000000 + + + @@ -338,6 +355,8 @@ cameraFPS cameraName resolution + red_only + marker_pitch cx cy cz @@ -347,6 +366,7 @@ tx ty tz + buttonBox diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 9c8cd52b..776d443a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -282,19 +282,23 @@ void Tracker::run() const aruco::Marker& m = markers.at(0); const float size = 7; + const double p = s.marker_pitch; + const double sq = sin(p * HT_PI / 180); + const double cq = cos(p * HT_PI / 180); + cv::Mat obj_points(4,3,CV_32FC1); obj_points.at(1,0)=-size + s.headpos_x; - obj_points.at(1,1)=-size + s.headpos_y; - obj_points.at(1,2)=0 + s.headpos_z; + obj_points.at(1,1)=-size * cq + s.headpos_y; + obj_points.at(1,2)=-size * sq + s.headpos_z; obj_points.at(2,0)=size + s.headpos_x; - obj_points.at(2,1)=-size + s.headpos_y; - obj_points.at(2,2)=0 + s.headpos_z; + obj_points.at(2,1)=-size * cq + s.headpos_y; + obj_points.at(2,2)=-size * sq + s.headpos_z; obj_points.at(3,0)=size + s.headpos_x; - obj_points.at(3,1)=size + s.headpos_y; - obj_points.at(3,2)=0 + s.headpos_z; + obj_points.at(3,1)=size * cq + s.headpos_y; + obj_points.at(3,2)=size * sq + s.headpos_z; obj_points.at(0,0)=-size + s.headpos_x; - obj_points.at(0,1)=size + s.headpos_y; - obj_points.at(0,2)=0 + s.headpos_z; + obj_points.at(0,1)=size * cq + s.headpos_y; + obj_points.at(0,2)=size * sq + s.headpos_z; last_roi = cv::Rect(65535, 65535, 0, 0); @@ -468,6 +472,7 @@ TrackerControls::TrackerControls() tie_setting(s.headpos_y, ui.cy); tie_setting(s.headpos_z, ui.cz); tie_setting(s.red_only, ui.red_only); + tie_setting(s.marker_pitch, ui.marker_pitch); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); ui.cameraName->addItems(get_camera_names()); diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 91a5ae8e..4cab84b5 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -27,6 +27,7 @@ struct settings { value camera_index, force_fps, resolution; value red_only; value eyaw, epitch, eroll, ex, ey, ez; + value marker_pitch; settings() : b(bundle("aruco-tracker")), fov(b, "field-of-view", 56), @@ -42,7 +43,8 @@ struct settings { eroll(b, "enable-r", true), ex(b, "enable-x", true), ey(b, "enable-y", true), - ez(b, "enable-z", true) + ez(b, "enable-z", true), + marker_pitch(b, "marker-pitch", 0) {} }; -- cgit v1.2.3 From 2a7bb33871dee1124dd1956fe14503845e8cee3f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Jan 2014 23:45:43 +0100 Subject: aruco: allow for perfect fisheye correction --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 455 +++++++++++++------------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 18 +- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 4 +- 3 files changed, 249 insertions(+), 228 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index e699eccc..7dadb58c 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 630 - 315 + 326 @@ -32,169 +32,42 @@ 7 - - - - Enable axes - - - - 7 + + + + + + + + Default - - 6 + + + + 30 - - 0 + + + + 60 - - 6 + + + + 120 - - 0 + + + + 180 - - - - RX - - - - - - - TX - - - - - - - RY - - - - - - - TY - - - - - - - RZ - - - - - - - TZ - - - - - - - - - - Head position - - - Qt::AlignCenter - - - - - - TX - - - - - - - - 0 - 0 - - - - -200.000000000000000 - - - 200.000000000000000 - - - - - - - TY - - - - - - - - 0 - 0 - - - - -200.000000000000000 - - - 200.000000000000000 - - - - - - - TZ - - - - - - - - 0 - 0 - - - - -200.000000000000000 - - - 200.000000000000000 - - - - + - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 + + + + Frames per second @@ -205,14 +78,7 @@ - - - - Frames per second - - - - + @@ -243,33 +109,41 @@ - - - - - Default - - - - - 30 - - - - - 60 - - - - - 120 - - - - - 180 - - + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + + + + Camera name + + + + + + + Red channel only + + + + + + + Horizontal FOV + @@ -296,28 +170,7 @@ - - - - Camera name - - - - - - - Red channel only - - - - - - - Horizontal FOV - - - - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -331,6 +184,16 @@ + + + + -180.000000000000000 + + + 180.000000000000000 + + + @@ -338,13 +201,164 @@ - - - - -180.000000000000000 + + + + Head position - - 180.000000000000000 + + Qt::AlignCenter + + + + + + TY + + + + + + + TX + + + + + + + + 0 + 0 + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + TZ + + + + + + + + 0 + 0 + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + + 0 + 0 + + + + -200.000000000000000 + + + 200.000000000000000 + + + + + + + + + + Enable axes + + + + 7 + + + 6 + + + 0 + + + 6 + + + 0 + + + + + RX + + + + + + + TX + + + + + + + RY + + + + + + + TY + + + + + + + RZ + + + + + + + TZ + + + + + + + + + + Check if yaw/X interconnect + + + + + + + Fisheye correction @@ -357,6 +371,7 @@ resolution red_only marker_pitch + fisheye_correction cx cy cz diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 776d443a..67c88e3e 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -18,7 +18,8 @@ #include #if defined(_WIN32) -#define NOMINMAX +# undef NOMINMAX +# define NOMINMAX # define NO_DSHOW_STRSAFE # include #else @@ -322,17 +323,13 @@ void Tracker::run() last_roi.width = std::min(grayscale.cols - last_roi.x, last_roi.width); last_roi.height = std::min(grayscale.rows - last_roi.y, last_roi.height); } - - cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, !first, cv::ITERATIVE); + cv::solvePnP(obj_points, m, intrinsics, dist_coeffs, rvec, tvec, !first, cv::ITERATIVE); first = false; - cv::Mat rotation_matrix = cv::Mat::zeros(3, 3, CV_64FC1); - cv::Mat junk1(3, 3, CV_64FC1), junk2(3, 3, CV_64FC1); - cv::Rodrigues(rvec, rotation_matrix); - + { cv::Vec3d euler = cv::RQDecomp3x3(rotation_matrix, junk1, junk2); @@ -350,6 +347,12 @@ void Tracker::run() pose[Yaw] = euler[1]; pose[Pitch] = -euler[0]; pose[Roll] = euler[2]; + + if (s.fisheye_correction) + { + pose[Yaw] -= atan(pose[TX] / pose[TZ]) * 180 / HT_PI; + pose[Pitch] -= atan(pose[TY] / pose[TZ]) * 180 / HT_PI; + } } std::vector repr2; @@ -473,6 +476,7 @@ TrackerControls::TrackerControls() tie_setting(s.headpos_z, ui.cz); tie_setting(s.red_only, ui.red_only); tie_setting(s.marker_pitch, ui.marker_pitch); + tie_setting(s.fisheye_correction, ui.fisheye_correction); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); ui.cameraName->addItems(get_camera_names()); diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 4cab84b5..e32e304a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -28,6 +28,7 @@ struct settings { value red_only; value eyaw, epitch, eroll, ex, ey, ez; value marker_pitch; + value fisheye_correction; settings() : b(bundle("aruco-tracker")), fov(b, "field-of-view", 56), @@ -44,7 +45,8 @@ struct settings { ex(b, "enable-x", true), ey(b, "enable-y", true), ez(b, "enable-z", true), - marker_pitch(b, "marker-pitch", 0) + marker_pitch(b, "marker-pitch", 0), + fisheye_correction(b, "fisheye-correction", false) {} }; -- cgit v1.2.3 From 1f258153f00ed0427a77077775274acd17a9fbe4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Jan 2014 23:52:39 +0100 Subject: resize --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 7dadb58c..59d3f69c 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -9,8 +9,8 @@ 0 0 - 630 - 326 + 615 + 353 -- cgit v1.2.3 From c2b5f86e85698068bd92de0e59e4f7b90c04cd60 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 12 Jan 2014 18:50:44 +0100 Subject: remove fisheye correction based on wrong focal length --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 341 ++++++++++++-------------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 7 - ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 4 +- 3 files changed, 164 insertions(+), 188 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 59d3f69c..03975390 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 615 - 353 + 326 @@ -32,176 +32,7 @@ 7 - - - - - - - - Default - - - - - 30 - - - - - 60 - - - - - 120 - - - - - 180 - - - - - - - - Frames per second - - - - - - - Recommended! - - - - - - - - 0 - 0 - - - - <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> - - - Qt::RichText - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 4 - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - - - - - Camera name - - - - - - - Red channel only - - - - - - - Horizontal FOV - - - - - - - - 640x480 - - - - - 320x240 - - - - - 320x200 - - - - - Default (not recommended!) - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Resolution - - - - - - - -180.000000000000000 - - - 180.000000000000000 - - - - - - - Marker pitch - - - - + Head position @@ -348,17 +179,172 @@ - - + + + + Frames per second + + + + + + + + + + + Default + + + + + 30 + + + + + 60 + + + + + 120 + + + + + 180 + + + + + + - Check if yaw/X interconnect + Recommended! - - + + - Fisheye correction + Camera name + + + + + + + + + + 35.000000000000000 + + + 180.000000000000000 + + + 52.000000000000000 + + + + + + + + 0 + 0 + + + + <html><head/><body><p>The ARUCO Library has been developed by the Ava group of the Univeristy of Cordoba, Spain</p><p>Rafael Muñoz Salinas &lt;<a href="mailto:rmsalinas@uco.es"><span style=" text-decoration: underline; color:#0057ae;">rmsalinas@uco.es</span></a>&gt;</p><p>&lt;<a href="https://github.com/rmsalinas/aruco"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/rmsalinas/aruco</span></a>&gt;</p></body></html> + + + Qt::RichText + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 4 + + + true + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Red channel only + + + + + + + + 640x480 + + + + + 320x240 + + + + + 320x200 + + + + + Default (not recommended!) + + + + + + + + Horizontal FOV + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + -180.000000000000000 + + + 180.000000000000000 + + + + + + + Resolution + + + + + + + Marker pitch @@ -371,7 +357,6 @@ resolution red_only marker_pitch - fisheye_correction cx cy cz diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index 77f794b9..9d484775 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -353,12 +353,6 @@ void Tracker::run() pose[Yaw] = euler[1]; pose[Pitch] = -euler[0]; pose[Roll] = euler[2]; - - if (s.fisheye_correction) - { - pose[Yaw] -= atan(pose[TX] / pose[TZ]) * 180 / HT_PI; - pose[Pitch] -= atan(pose[TY] / pose[TZ]) * 180 / HT_PI; - } } std::vector repr2; @@ -482,7 +476,6 @@ TrackerControls::TrackerControls() tie_setting(s.headpos_z, ui.cz); tie_setting(s.red_only, ui.red_only); tie_setting(s.marker_pitch, ui.marker_pitch); - tie_setting(s.fisheye_correction, ui.fisheye_correction); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); ui.cameraName->addItems(get_camera_names()); diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index e32e304a..4cab84b5 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -28,7 +28,6 @@ struct settings { value red_only; value eyaw, epitch, eroll, ex, ey, ez; value marker_pitch; - value fisheye_correction; settings() : b(bundle("aruco-tracker")), fov(b, "field-of-view", 56), @@ -45,8 +44,7 @@ struct settings { ex(b, "enable-x", true), ey(b, "enable-y", true), ez(b, "enable-z", true), - marker_pitch(b, "marker-pitch", 0), - fisheye_correction(b, "fisheye-correction", false) + marker_pitch(b, "marker-pitch", 0) {} }; -- cgit v1.2.3 From 87f57ad0bdf4ad5495dcc6068d3a0853a4c57a18 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 13 Jan 2014 08:24:15 +0100 Subject: aruco: change allowed scale, now that units are in millimeters --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 12 ++++++------ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index 03975390..e0794eb9 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -64,10 +64,10 @@ - -200.000000000000000 + -10000.000000000000000 - 200.000000000000000 + 10000.000000000000000 @@ -87,10 +87,10 @@ - -200.000000000000000 + -10000.000000000000000 - 200.000000000000000 + 10000.000000000000000 @@ -103,10 +103,10 @@ - -200.000000000000000 + -10000.000000000000000 - 200.000000000000000 + 10000.000000000000000 diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index feb7fb9d..cb44927a 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -286,7 +286,7 @@ void Tracker::run() cv::TermCriteria(cv::TermCriteria::MAX_ITER | cv::TermCriteria::EPS, 20, 1e-2)); - const float size = 7; + const float size = 40; const double p = s.marker_pitch; const double sq = sin(p * HT_PI / 180); -- cgit v1.2.3 From 65facfc7c819a5fc14385aedbb2848eb68bac390 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 15 Jan 2014 19:17:51 +0100 Subject: make all tracker/protocol/filter dialogs non-modal --- FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui | 2 +- ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui | 2 +- ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui | 2 +- ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui | 2 +- ftnoir_protocol_fg/ftnoir_fgcontrols.ui | 2 +- ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui | 2 +- ftnoir_protocol_ft/ftnoir_ftcontrols.ui | 2 +- ftnoir_protocol_ftn/ftnoir_ftncontrols.ui | 2 +- ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui | 2 +- ftnoir_protocol_mouse/ftnoir_mousecontrols.ui | 2 +- ftnoir_protocol_sc/ftnoir_sccontrols.ui | 2 +- ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui | 2 +- ftnoir_protocol_wine/ftnoir_winecontrols.ui | 2 +- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 2 +- ftnoir_tracker_ht/ht-trackercontrols.ui | 2 +- ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui | 2 +- ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui | 2 +- ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui | 2 +- ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) (limited to 'ftnoir_tracker_aruco/aruco-trackercontrols.ui') diff --git a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui index bdbed955..0bbec7e1 100644 --- a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui +++ b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui @@ -3,7 +3,7 @@ UICPTClientControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui index debd1250..c544263d 100644 --- a/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui +++ b/ftnoir_filter_accela/ftnoir_accela_filtercontrols.ui @@ -3,7 +3,7 @@ AccelaUICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui index a1083265..8ee633cc 100644 --- a/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui +++ b/ftnoir_filter_ewma2/ftnoir_ewma_filtercontrols.ui @@ -3,7 +3,7 @@ UICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui b/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui index a9fdec6e..e0c849c9 100644 --- a/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui +++ b/ftnoir_filter_kalman/ftnoir_kalman_filtercontrols.ui @@ -3,7 +3,7 @@ KalmanUICFilterControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui index e351647b..a4092c05 100644 --- a/ftnoir_protocol_fg/ftnoir_fgcontrols.ui +++ b/ftnoir_protocol_fg/ftnoir_fgcontrols.ui @@ -3,7 +3,7 @@ UICFGControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui b/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui index 1ce77862..6cb066bd 100644 --- a/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui +++ b/ftnoir_protocol_fsuipc/ftnoir_fsuipccontrols.ui @@ -3,7 +3,7 @@ UICFSUIPCControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_ft/ftnoir_ftcontrols.ui b/ftnoir_protocol_ft/ftnoir_ftcontrols.ui index bd5980b4..941aaff0 100644 --- a/ftnoir_protocol_ft/ftnoir_ftcontrols.ui +++ b/ftnoir_protocol_ft/ftnoir_ftcontrols.ui @@ -3,7 +3,7 @@ UICFTControls - Qt::ApplicationModal + Qt::NonModal true diff --git a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui b/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui index 429e7046..48679f3c 100644 --- a/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui +++ b/ftnoir_protocol_ftn/ftnoir_ftncontrols.ui @@ -3,7 +3,7 @@ UICFTNControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui index e85e001e..d2b86445 100644 --- a/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui +++ b/ftnoir_protocol_libevdev/ftnoir_libevdev_controls.ui @@ -3,7 +3,7 @@ UICLibevdevControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui b/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui index 540e4f0d..2705fff7 100644 --- a/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui +++ b/ftnoir_protocol_mouse/ftnoir_mousecontrols.ui @@ -3,7 +3,7 @@ UICMOUSEControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_sc/ftnoir_sccontrols.ui b/ftnoir_protocol_sc/ftnoir_sccontrols.ui index 430b3912..87dc8d86 100644 --- a/ftnoir_protocol_sc/ftnoir_sccontrols.ui +++ b/ftnoir_protocol_sc/ftnoir_sccontrols.ui @@ -3,7 +3,7 @@ UICSCControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui b/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui index 94b229fb..2214b887 100644 --- a/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui +++ b/ftnoir_protocol_vjoy/ftnoir_vjoy_controls.ui @@ -3,7 +3,7 @@ UICVJoyControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_protocol_wine/ftnoir_winecontrols.ui b/ftnoir_protocol_wine/ftnoir_winecontrols.ui index 749feb0f..9356c448 100644 --- a/ftnoir_protocol_wine/ftnoir_winecontrols.ui +++ b/ftnoir_protocol_wine/ftnoir_winecontrols.ui @@ -3,7 +3,7 @@ UICFTControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index e0794eb9..1d5a4241 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -3,7 +3,7 @@ Form - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_ht/ht-trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui index 55501ef1..f57022c8 100644 --- a/ftnoir_tracker_ht/ht-trackercontrols.ui +++ b/ftnoir_tracker_ht/ht-trackercontrols.ui @@ -3,7 +3,7 @@ Form - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui index 1acbf93f..e5e41bec 100644 --- a/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui +++ b/ftnoir_tracker_hydra/ftnoir_hydra_clientcontrols.ui @@ -3,7 +3,7 @@ UIHydraControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui index 7522cf31..5d349169 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick_controls.ui @@ -3,7 +3,7 @@ UIJoystickControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui index e868a9c3..a9168239 100644 --- a/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui +++ b/ftnoir_tracker_rift/ftnoir_rift_clientcontrols.ui @@ -3,7 +3,7 @@ UIRiftControls - Qt::ApplicationModal + Qt::NonModal diff --git a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui index fc614477..5c602792 100644 --- a/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui +++ b/ftnoir_tracker_udp/ftnoir_ftnclientcontrols.ui @@ -3,7 +3,7 @@ UICFTNClientControls - Qt::ApplicationModal + Qt::NonModal -- cgit v1.2.3