summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2013-01-13 11:10:44 +0000
committerPatrick Ruoff <c14-radioactive@19e81ba0-9b1a-49c3-bd6c-561e1906d5fb>2013-01-13 11:10:44 +0000
commit9f7fd1d155128e1d382654d9de1c72f19006e856 (patch)
tree56aa35ed7440625ad5820bc904da77cffd50088b
parent5fd06c5d0a28a861e02f000d95cf82d987465041 (diff)
PT: Camera pitch correction for translation, prepared GUI for release
git-svn-id: svn+ssh://svn.code.sf.net/p/facetracknoir/code@208 19e81ba0-9b1a-49c3-bd6c-561e1906d5fb
-rw-r--r--FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui101
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp15
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp6
-rw-r--r--FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp2
4 files changed, 52 insertions, 72 deletions
diff --git a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui
index a2389f71..0174df23 100644
--- a/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui
+++ b/FTNoIR_Tracker_PT/FTNoIR_PT_Controls.ui
@@ -69,17 +69,17 @@
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QGridLayout" name="gridLayout">
- <item row="0" column="3">
- <widget class="QCheckBox" name="videowidget_check">
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="dynpose_check">
<property name="toolTip">
- <string>Whether to update the content of the VideoWidget</string>
+ <string/>
</property>
<property name="text">
- <string>Show VideoWidget</string>
+ <string>Dynamic Pose Resolution</string>
</property>
</widget>
</item>
- <item row="0" column="0">
+ <item row="0" column="2">
<widget class="QLabel" name="label_39">
<property name="text">
<string>Sleep time</string>
@@ -89,7 +89,7 @@
</property>
</widget>
</item>
- <item row="0" column="1">
+ <item row="0" column="3">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QSpinBox" name="sleep_spin">
@@ -113,20 +113,7 @@
</item>
</layout>
</item>
- <item row="0" column="2">
- <spacer name="horizontalSpacer_11">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0">
+ <item row="1" column="2">
<widget class="QLabel" name="label_43">
<property name="text">
<string>Auto-reset time</string>
@@ -136,7 +123,7 @@
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="1" column="3">
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QSpinBox" name="reset_spin">
@@ -157,17 +144,17 @@
</item>
</layout>
</item>
- <item row="1" column="3">
- <widget class="QCheckBox" name="dynpose_check">
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="videowidget_check">
<property name="toolTip">
- <string/>
+ <string>Whether to update the content of the VideoWidget</string>
</property>
<property name="text">
- <string>Dynamic Pose Resolution</string>
+ <string>Show VideoWidget</string>
</property>
</widget>
</item>
- <item row="1" column="2">
+ <item row="1" column="1">
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -180,6 +167,32 @@
</property>
</spacer>
</item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0">
+ <widget class="QPushButton" name="reset_button">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Reset the tracker's internal state</string>
+ </property>
+ <property name="text">
+ <string>Reset</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
@@ -499,36 +512,6 @@
</layout>
</widget>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_10">
- <item>
- <widget class="QPushButton" name="center_button">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Center the tracker</string>
- </property>
- <property name="text">
- <string>Center</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="reset_button">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="toolTip">
- <string>Reset the tracker's internal state</string>
- </property>
- <property name="text">
- <string>Reset</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
@@ -1654,7 +1637,7 @@
</rect>
</property>
<property name="text">
- <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FTNoIR PointTracker Plugin&lt;br/&gt;Version 1.0 beta&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;by Patrick Ruoff&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://ftnoirpt.sourceforge.net/&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline; color:#0000ff;&quot;&gt;Manual (external)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;FTNoIR PointTracker Plugin&lt;br/&gt;Version 1.0&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;by Patrick Ruoff&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://ftnoirpt.sourceforge.net/&quot;&gt;&lt;span style=&quot; font-weight:600; text-decoration: underline; color:#0000ff;&quot;&gt;Manual (external)&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@@ -1715,17 +1698,13 @@
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>sleep_spin</tabstop>
- <tabstop>videowidget_check</tabstop>
<tabstop>reset_spin</tabstop>
- <tabstop>dynpose_check</tabstop>
<tabstop>chkEnableRoll</tabstop>
<tabstop>chkEnablePitch</tabstop>
<tabstop>chkEnableYaw</tabstop>
<tabstop>chkEnableX</tabstop>
<tabstop>chkEnableY</tabstop>
<tabstop>chkEnableZ</tabstop>
- <tabstop>center_button</tabstop>
- <tabstop>reset_button</tabstop>
<tabstop>camindex_spin</tabstop>
<tabstop>res_x_spin</tabstop>
<tabstop>res_y_spin</tabstop>
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
index e9394eff..5b77da69 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt.cpp
@@ -201,7 +201,14 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
FrameTrafo X_CH = X_CM * X_MH;
Matx33f R = X_CH.R * X_CH_0.R.t();
- Vec3f t = X_CH.t - X_CH_0.t;
+ Vec3f t = X_CH.t - X_CH_0.t;
+
+ // correct for camera pitch
+ Matx33f R_CP( 1, 0, 0,
+ 0, cos(deg2rad*cam_pitch), sin(deg2rad*cam_pitch),
+ 0, -sin(deg2rad*cam_pitch), cos(deg2rad*cam_pitch));
+ R = R_CP * R * R_CP.t();
+ t = R_CP * t;
// get translation(s)
if (bEnableX) {
@@ -213,12 +220,6 @@ bool Tracker::GiveHeadPoseData(THeadPoseData *data)
if (bEnableZ) {
data->z = t[2] / 10.0;
}
-
- // correct for camera pitch
- Matx33f R_CP( 1, 0, 0,
- 0, cos(deg2rad*cam_pitch), sin(deg2rad*cam_pitch),
- 0, -sin(deg2rad*cam_pitch), cos(deg2rad*cam_pitch));
- R = R_CP * R * R_CP.t();
// translate rotation matrix from opengl (G) to roll-pitch-yaw (R) frame
// -z -> x, y -> z, x -> -y
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp
index 83c04305..a1531dd7 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dialog.cpp
@@ -105,7 +105,7 @@ TrackerDialog::TrackerDialog()
connect( ui.tcalib_button,SIGNAL(toggled(bool)), this,SLOT(startstop_trans_calib(bool)) );
connect(ui.reset_button, SIGNAL(clicked()), this, SLOT(doReset()));
- connect(ui.center_button, SIGNAL(clicked()), this, SLOT(doCenter()));
+ //connect(ui.center_button, SIGNAL(clicked()), this, SLOT(doCenter()));
connect(ui.ok_button, SIGNAL(clicked()), this, SLOT(doOK()));
connect(ui.cancel_button, SIGNAL(clicked()), this, SLOT(doCancel()));
@@ -314,7 +314,7 @@ void TrackerDialog::registerTracker(ITracker *t)
tracker = static_cast<Tracker*>(t);
if (isVisible() && settings_dirty) tracker->apply(settings);
ui.tcalib_button->setEnabled(true);
- ui.center_button->setEnabled(true);
+ //ui.center_button->setEnabled(true);
ui.reset_button->setEnabled(true);
}
@@ -323,7 +323,7 @@ void TrackerDialog::unRegisterTracker()
qDebug()<<"TrackerDialog:: Tracker un-registered";
tracker = NULL;
ui.tcalib_button->setEnabled(false);
- ui.center_button->setEnabled(false);
+ //ui.center_button->setEnabled(false);
ui.reset_button->setEnabled(false);
}
diff --git a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp
index 9ceaa321..7f58d77d 100644
--- a/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp
+++ b/FTNoIR_Tracker_PT/ftnoir_tracker_pt_dll.cpp
@@ -12,7 +12,7 @@
//-----------------------------------------------------------------------------
void TrackerDll::getFullName(QString *strToBeFilled)
{
- *strToBeFilled = "PointTracker 1.0 beta";
+ *strToBeFilled = "PointTracker 1.0";
}
void TrackerDll::getShortName(QString *strToBeFilled)