diff options
-rw-r--r-- | tracker-easy/lang/nl_NL.ts | 68 | ||||
-rw-r--r-- | tracker-easy/lang/ru_RU.ts | 68 | ||||
-rw-r--r-- | tracker-easy/lang/stub.ts | 68 | ||||
-rw-r--r-- | tracker-easy/lang/zh_CN.ts | 68 | ||||
-rw-r--r-- | tracker-easy/module.cpp | 2 | ||||
-rw-r--r-- | tracker-easy/settings.h | 6 | ||||
-rw-r--r-- | tracker-easy/tracker-easy-dialog.cpp | 46 | ||||
-rw-r--r-- | tracker-easy/tracker-easy-settings.ui | 228 | ||||
-rw-r--r-- | tracker-easy/tracker-easy.cpp | 85 | ||||
-rw-r--r-- | tracker-easy/tracker-easy.h | 1 |
10 files changed, 495 insertions, 145 deletions
diff --git a/tracker-easy/lang/nl_NL.ts b/tracker-easy/lang/nl_NL.ts index 9c4e1843..775ec4d9 100644 --- a/tracker-easy/lang/nl_NL.ts +++ b/tracker-easy/lang/nl_NL.ts @@ -4,17 +4,13 @@ <context> <name>EasyTracker::Metadata</name> <message> - <source>Easy Tracker 1.0</source> + <source>Easy Tracker 1.1</source> <translation type="unfinished"></translation> </message> </context> <context> <name>UICPTClientControls</name> <message> - <source>PointTracker Settings</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Camera</source> <translation type="unfinished"></translation> </message> @@ -151,79 +147,103 @@ <translation type="unfinished"></translation> </message> <message> - <source>Top Right</source> + <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top Left</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Left</source> + <source>Auto center</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertex count</source> + <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Three vertices</source> + <source>Auto center timeout</source> <translation type="unfinished"></translation> </message> <message> - <source>Four vertices</source> + <source>If no valid pose can be determined after that much time the center pose will be used.</source> <translation type="unfinished"></translation> </message> <message> - <source>Five vertices</source> + <source> ms</source> <translation type="unfinished"></translation> </message> <message> - <source>Center</source> + <source>Easy Tracker Settings</source> <translation type="unfinished"></translation> </message> <message> - <source>Right</source> + <source>Model type:</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> + <source>Hat three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> + <source>Hat four vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> + <source>Hat five vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.0</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> + <source>Clip three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center</source> + <source>Vertices: </source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> + <source>Top:</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center timeout</source> + <source>Right:</source> <translation type="unfinished"></translation> </message> <message> - <source>If no valid pose can be determined after that much time the center pose will be used.</source> + <source>Left:</source> <translation type="unfinished"></translation> </message> <message> - <source> ms</source> + <source>Center:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top right:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top left:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip top:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip middle:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip bottom:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.1</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> <translation type="unfinished"></translation> </message> </context> diff --git a/tracker-easy/lang/ru_RU.ts b/tracker-easy/lang/ru_RU.ts index 6499415f..2ae262a5 100644 --- a/tracker-easy/lang/ru_RU.ts +++ b/tracker-easy/lang/ru_RU.ts @@ -4,17 +4,13 @@ <context> <name>EasyTracker::Metadata</name> <message> - <source>Easy Tracker 1.0</source> + <source>Easy Tracker 1.1</source> <translation type="unfinished"></translation> </message> </context> <context> <name>UICPTClientControls</name> <message> - <source>PointTracker Settings</source> - <translation>Настройки PointTracker</translation> - </message> - <message> <source>Camera</source> <translation>Камера</translation> </message> @@ -151,79 +147,103 @@ <translation type="unfinished"></translation> </message> <message> - <source>Top Right</source> + <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top Left</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Left</source> + <source>Auto center</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertex count</source> + <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Three vertices</source> + <source>Auto center timeout</source> <translation type="unfinished"></translation> </message> <message> - <source>Four vertices</source> + <source>If no valid pose can be determined after that much time the center pose will be used.</source> <translation type="unfinished"></translation> </message> <message> - <source>Five vertices</source> + <source> ms</source> <translation type="unfinished"></translation> </message> <message> - <source>Center</source> + <source>Easy Tracker Settings</source> <translation type="unfinished"></translation> </message> <message> - <source>Right</source> + <source>Model type:</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> + <source>Hat three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> + <source>Hat four vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> + <source>Hat five vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.0</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> + <source>Clip three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center</source> + <source>Vertices: </source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> + <source>Top:</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center timeout</source> + <source>Right:</source> <translation type="unfinished"></translation> </message> <message> - <source>If no valid pose can be determined after that much time the center pose will be used.</source> + <source>Left:</source> <translation type="unfinished"></translation> </message> <message> - <source> ms</source> + <source>Center:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top right:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top left:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip top:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip middle:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip bottom:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.1</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> <translation type="unfinished"></translation> </message> </context> diff --git a/tracker-easy/lang/stub.ts b/tracker-easy/lang/stub.ts index 7b6facec..b10f5885 100644 --- a/tracker-easy/lang/stub.ts +++ b/tracker-easy/lang/stub.ts @@ -4,17 +4,13 @@ <context> <name>EasyTracker::Metadata</name> <message> - <source>Easy Tracker 1.0</source> + <source>Easy Tracker 1.1</source> <translation type="unfinished"></translation> </message> </context> <context> <name>UICPTClientControls</name> <message> - <source>PointTracker Settings</source> - <translation type="unfinished"></translation> - </message> - <message> <source>Camera</source> <translation type="unfinished"></translation> </message> @@ -151,79 +147,103 @@ <translation type="unfinished"></translation> </message> <message> - <source>Top Right</source> + <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top Left</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Left</source> + <source>Auto center</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertex count</source> + <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Three vertices</source> + <source>Auto center timeout</source> <translation type="unfinished"></translation> </message> <message> - <source>Four vertices</source> + <source>If no valid pose can be determined after that much time the center pose will be used.</source> <translation type="unfinished"></translation> </message> <message> - <source>Five vertices</source> + <source> ms</source> <translation type="unfinished"></translation> </message> <message> - <source>Center</source> + <source>Easy Tracker Settings</source> <translation type="unfinished"></translation> </message> <message> - <source>Right</source> + <source>Model type:</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> + <source>Hat three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> + <source>Hat four vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> + <source>Hat five vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.0</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> + <source>Clip three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center</source> + <source>Vertices: </source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> + <source>Top:</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center timeout</source> + <source>Right:</source> <translation type="unfinished"></translation> </message> <message> - <source>If no valid pose can be determined after that much time the center pose will be used.</source> + <source>Left:</source> <translation type="unfinished"></translation> </message> <message> - <source> ms</source> + <source>Center:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top right:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top left:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip top:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip middle:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip bottom:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.1</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> <translation type="unfinished"></translation> </message> </context> diff --git a/tracker-easy/lang/zh_CN.ts b/tracker-easy/lang/zh_CN.ts index bbd8aff1..71fc6368 100644 --- a/tracker-easy/lang/zh_CN.ts +++ b/tracker-easy/lang/zh_CN.ts @@ -4,17 +4,13 @@ <context> <name>EasyTracker::Metadata</name> <message> - <source>Easy Tracker 1.0</source> + <source>Easy Tracker 1.1</source> <translation type="unfinished"></translation> </message> </context> <context> <name>UICPTClientControls</name> <message> - <source>PointTracker Settings</source> - <translation>PointTracker设置</translation> - </message> - <message> <source>Camera</source> <translation>摄像头</translation> </message> @@ -151,79 +147,103 @@ <translation type="unfinished"></translation> </message> <message> - <source>Top Right</source> + <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Top Left</source> + <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Left</source> + <source>Auto center</source> <translation type="unfinished"></translation> </message> <message> - <source>Vertex count</source> + <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> <translation type="unfinished"></translation> </message> <message> - <source>Three vertices</source> + <source>Auto center timeout</source> <translation type="unfinished"></translation> </message> <message> - <source>Four vertices</source> + <source>If no valid pose can be determined after that much time the center pose will be used.</source> <translation type="unfinished"></translation> </message> <message> - <source>Five vertices</source> + <source> ms</source> <translation type="unfinished"></translation> </message> <message> - <source>Center</source> + <source>Easy Tracker Settings</source> <translation type="unfinished"></translation> </message> <message> - <source>Right</source> + <source>Model type:</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">X</span></p></body></html></source> + <source>Hat three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Y</span></p></body></html></source> + <source>Hat four vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-size:12pt;">Z</span></p></body></html></source> + <source>Hat five vertices</source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.0</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> + <source>Clip three vertices</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center</source> + <source>Vertices: </source> <translation type="unfinished"></translation> </message> <message> - <source><html><head/><body><p>Use P3P or AP3P for three and four points setup. Use EPNP or ITERATIVE for five points setup. Inconsistent configuration will result in undefined behavior.</p></body></html></source> + <source>Top:</source> <translation type="unfinished"></translation> </message> <message> - <source>Auto center timeout</source> + <source>Right:</source> <translation type="unfinished"></translation> </message> <message> - <source>If no valid pose can be determined after that much time the center pose will be used.</source> + <source>Left:</source> <translation type="unfinished"></translation> </message> <message> - <source> ms</source> + <source>Center:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top right:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Top left:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip top:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip middle:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source>Clip bottom:</source> + <translation type="unfinished"></translation> + </message> + <message> + <source><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.1</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></source> <translation type="unfinished"></translation> </message> </context> diff --git a/tracker-easy/module.cpp b/tracker-easy/module.cpp index 3a9df22b..8fcfeae1 100644 --- a/tracker-easy/module.cpp +++ b/tracker-easy/module.cpp @@ -6,7 +6,7 @@ namespace EasyTracker { - QString Metadata::name() { return tr("Easy Tracker 1.0"); } + QString Metadata::name() { return tr("Easy Tracker 1.1"); } QIcon Metadata::icon() { return QIcon(":/Resources/easy-tracker-logo.png"); } } diff --git a/tracker-easy/settings.h b/tracker-easy/settings.h index b0f14417..4141ebe0 100644 --- a/tracker-easy/settings.h +++ b/tracker-easy/settings.h @@ -30,6 +30,7 @@ namespace EasyTracker { value<bool> iCustomModelThree{ b, "iCustomModelThree", true }; value<bool> iCustomModelFour{ b, "iCustomModelFour", false }; value<bool> iCustomModelFive{ b, "iCustomModelFive", false }; + value<bool> iClipModelThree{ b, "iClipModelThree", false }; // Custom model vertices value<int> iVertexTopX{ b, "iVertexTopX", 0 }, iVertexTopY{ b, "iVertexTopY", 0 }, iVertexTopZ{ b, "iVertexTopZ", 0 }; @@ -38,7 +39,10 @@ namespace EasyTracker { value<int> iVertexCenterX{ b, "iVertexCenterX", 0 }, iVertexCenterY{ b, "iVertexCenterY", 0 }, iVertexCenterZ{ b, "iVertexCenterZ", 0 }; value<int> iVertexTopRightX{ b, "iVertexTopRightX", 0 }, iVertexTopRightY{ b, "iVertexTopRightY", 0 }, iVertexTopRightZ{ b, "iVertexTopRightZ", 0 }; value<int> iVertexTopLeftX{ b, "iVertexTopLeftX", 0 }, iVertexTopLeftY{ b, "iVertexTopLeftY", 0 }, iVertexTopLeftZ{ b, "iVertexTopLeftZ", 0 }; - + // Clip model vertices + value<int> iVertexClipTopX{ b, "iVertexClipTopX", 0 }, iVertexClipTopY{ b, "iVertexClipTopY", 0 }, iVertexClipTopZ{ b, "iVertexClipTopZ", 0 }; + value<int> iVertexClipMiddleX{ b, "iVertexClipMiddleX", 0 }, iVertexClipMiddleY{ b, "iVertexClipMiddleY", 0 }, iVertexClipMiddleZ{ b, "iVertexClipMiddleZ", 0 }; + value<int> iVertexClipBottomX{ b, "iVertexClipBottomX", 0 }, iVertexClipBottomY{ b, "iVertexClipBottomY", 0 }, iVertexClipBottomZ{ b, "iVertexClipBottomZ", 0 }; value<int> fov{ b, "camera-fov", 56 }; diff --git a/tracker-easy/tracker-easy-dialog.cpp b/tracker-easy/tracker-easy-dialog.cpp index 4a49e194..b0870b50 100644 --- a/tracker-easy/tracker-easy-dialog.cpp +++ b/tracker-easy/tracker-easy-dialog.cpp @@ -68,6 +68,19 @@ namespace EasyTracker tie_setting(s.iVertexTopLeftY, ui.iSpinVertexTopLeftY); tie_setting(s.iVertexTopLeftZ, ui.iSpinVertexTopLeftZ); + // Clip model + tie_setting(s.iVertexClipTopX, ui.iSpinVertexClipTopX); + tie_setting(s.iVertexClipTopY, ui.iSpinVertexClipTopY); + tie_setting(s.iVertexClipTopZ, ui.iSpinVertexClipTopZ); + + tie_setting(s.iVertexClipMiddleX, ui.iSpinVertexClipMiddleX); + tie_setting(s.iVertexClipMiddleY, ui.iSpinVertexClipMiddleY); + tie_setting(s.iVertexClipMiddleZ, ui.iSpinVertexClipMiddleZ); + + tie_setting(s.iVertexClipBottomX, ui.iSpinVertexClipBottomX); + tie_setting(s.iVertexClipBottomY, ui.iSpinVertexClipBottomY); + tie_setting(s.iVertexClipBottomZ, ui.iSpinVertexClipBottomZ); + tie_setting(s.fov, ui.fov); tie_setting(s.debug, ui.debug); @@ -87,10 +100,12 @@ namespace EasyTracker connect(ui.iRadioButtonCustomModelThree, &QRadioButton::clicked, this, &Dialog::UpdateCustomModelControls); connect(ui.iRadioButtonCustomModelFour, &QRadioButton::clicked, this, &Dialog::UpdateCustomModelControls); connect(ui.iRadioButtonCustomModelFive, &QRadioButton::clicked, this, &Dialog::UpdateCustomModelControls); + connect(ui.iRadioButtonClipModelThree, &QRadioButton::clicked, this, &Dialog::UpdateCustomModelControls); tie_setting(s.iCustomModelThree, ui.iRadioButtonCustomModelThree); tie_setting(s.iCustomModelFour, ui.iRadioButtonCustomModelFour); tie_setting(s.iCustomModelFive, ui.iRadioButtonCustomModelFive); + tie_setting(s.iClipModelThree, ui.iRadioButtonClipModelThree); for (unsigned k = 0; k < cv::SOLVEPNP_MAX_COUNT; k++) @@ -111,20 +126,49 @@ namespace EasyTracker ui.iGroupBoxCenter->hide(); ui.iGroupBoxTopRight->hide(); ui.iGroupBoxTopLeft->hide(); + ui.iGroupBoxTop->show(); + ui.iGroupBoxRight->show(); + ui.iGroupBoxLeft->show(); + ui.iGroupBoxClipTop->hide(); + ui.iGroupBoxClipMiddle->hide(); + ui.iGroupBoxClipBottom->hide(); } else if (ui.iRadioButtonCustomModelFour->isChecked()) { ui.iGroupBoxCenter->show(); ui.iGroupBoxTopRight->hide(); ui.iGroupBoxTopLeft->hide(); + ui.iGroupBoxTop->show(); + ui.iGroupBoxRight->show(); + ui.iGroupBoxLeft->show(); + ui.iGroupBoxClipTop->hide(); + ui.iGroupBoxClipMiddle->hide(); + ui.iGroupBoxClipBottom->hide(); } else if (ui.iRadioButtonCustomModelFive->isChecked()) { ui.iGroupBoxCenter->hide(); ui.iGroupBoxTopRight->show(); ui.iGroupBoxTopLeft->show(); + ui.iGroupBoxTop->show(); + ui.iGroupBoxRight->show(); + ui.iGroupBoxLeft->show(); + ui.iGroupBoxClipTop->hide(); + ui.iGroupBoxClipMiddle->hide(); + ui.iGroupBoxClipBottom->hide(); + } + else if (ui.iRadioButtonClipModelThree->isChecked()) + { + ui.iGroupBoxTop->hide(); + ui.iGroupBoxRight->hide(); + ui.iGroupBoxLeft->hide(); + ui.iGroupBoxCenter->hide(); + ui.iGroupBoxTopRight->hide(); + ui.iGroupBoxTopLeft->hide(); + ui.iGroupBoxClipTop->show(); + ui.iGroupBoxClipMiddle->show(); + ui.iGroupBoxClipBottom->show(); } - } diff --git a/tracker-easy/tracker-easy-settings.ui b/tracker-easy/tracker-easy-settings.ui index 451b3e54..d6cc86b6 100644 --- a/tracker-easy/tracker-easy-settings.ui +++ b/tracker-easy/tracker-easy-settings.ui @@ -9,8 +9,8 @@ <rect> <x>0</x> <y>0</y> - <width>465</width> - <height>764</height> + <width>328</width> + <height>923</height> </rect> </property> <property name="sizePolicy"> @@ -20,7 +20,7 @@ </sizepolicy> </property> <property name="windowTitle"> - <string>PointTracker Settings</string> + <string>Easy Tracker Settings</string> </property> <property name="windowIcon"> <iconset> @@ -32,24 +32,8 @@ <property name="autoFillBackground"> <bool>false</bool> </property> - <layout class="QGridLayout" name="gridLayout_9"> - <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> - </property> - <item row="7" column="0"> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - <item row="0" column="0"> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item alignment="Qt::AlignTop"> <widget class="QTabWidget" name="tabWidget"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> @@ -61,7 +45,7 @@ <locale language="English" country="UnitedStates"/> </property> <property name="currentIndex"> - <number>0</number> + <number>2</number> </property> <widget class="QWidget" name="tabTracker"> <attribute name="title"> @@ -548,13 +532,13 @@ <item> <widget class="QGroupBox" name="groupBoxCustomModelType"> <property name="title"> - <string>Vertex count</string> + <string>Model type:</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_4"> <item> <widget class="QRadioButton" name="iRadioButtonCustomModelThree"> <property name="text"> - <string>Three vertices</string> + <string>Hat three vertices</string> </property> <property name="checked"> <bool>true</bool> @@ -564,14 +548,21 @@ <item> <widget class="QRadioButton" name="iRadioButtonCustomModelFour"> <property name="text"> - <string>Four vertices</string> + <string>Hat four vertices</string> </property> </widget> </item> <item> <widget class="QRadioButton" name="iRadioButtonCustomModelFive"> <property name="text"> - <string>Five vertices</string> + <string>Hat five vertices</string> + </property> + </widget> + </item> + <item> + <widget class="QRadioButton" name="iRadioButtonClipModelThree"> + <property name="text"> + <string>Clip three vertices</string> </property> </widget> </item> @@ -581,7 +572,7 @@ <item> <widget class="QGroupBox" name="groupBox"> <property name="title"> - <string/> + <string>Vertices: </string> </property> <property name="flat"> <bool>false</bool> @@ -614,7 +605,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxTop"> <property name="title"> - <string>Top</string> + <string>Top:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_2"> <property name="topMargin"> @@ -665,7 +656,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxRight"> <property name="title"> - <string>Right</string> + <string>Right:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_3"> <item> @@ -713,7 +704,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxLeft"> <property name="title"> - <string>Left</string> + <string>Left:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_4"> <item> @@ -761,7 +752,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxCenter"> <property name="title"> - <string>Center</string> + <string>Center:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_5"> <item> @@ -809,7 +800,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxTopRight"> <property name="title"> - <string>Top Right</string> + <string>Top right:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_6"> <item> @@ -857,7 +848,7 @@ <item> <widget class="QGroupBox" name="iGroupBoxTopLeft"> <property name="title"> - <string>Top Left</string> + <string>Top left:</string> </property> <layout class="QHBoxLayout" name="horizontalLayout_7"> <item> @@ -902,6 +893,159 @@ </layout> </widget> </item> + <item> + <widget class="QGroupBox" name="iGroupBoxClipTop"> + <property name="title"> + <string>Clip top:</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_10"> + <property name="topMargin"> + <number>9</number> + </property> + <item> + <widget class="QSpinBox" name="iSpinVertexClipTopX"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipTopY"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipTopZ"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="iGroupBoxClipMiddle"> + <property name="title"> + <string>Clip middle:</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_9"> + <property name="topMargin"> + <number>9</number> + </property> + <item> + <widget class="QSpinBox" name="iSpinVertexClipMiddleX"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipMiddleY"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipMiddleZ"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="iGroupBoxClipBottom"> + <property name="title"> + <string>Clip bottom:</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_11"> + <property name="topMargin"> + <number>9</number> + </property> + <item> + <widget class="QSpinBox" name="iSpinVertexClipBottomX"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipBottomY"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="iSpinVertexClipBottomZ"> + <property name="suffix"> + <string> mm</string> + </property> + <property name="minimum"> + <number>-65535</number> + </property> + <property name="maximum"> + <number>65535</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> </layout> </widget> <widget class="QWidget" name="tab_3"> @@ -912,7 +1056,7 @@ <item row="0" column="0"> <widget class="QLabel" name="label_10"> <property name="text"> - <string><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.0</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></string> + <string><html><head/><body><p><span style=" font-weight:600;">Easy Tracker<br/>Version 1.1</span></p><p><span style=" font-weight:600;">by Stéphane Lenclud</span></p><p>See <a href="https://github.com/opentrack/opentrack/wiki/Easy-Tracker"><span style=" font-weight:600; text-decoration: underline; color:#9999aa;">documentation on GitHub</span></a></p></body></html></string> </property> <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> @@ -939,10 +1083,22 @@ </widget> </widget> </item> + <item alignment="Qt::AlignBottom"> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Maximum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> </layout> </widget> <tabstops> - <tabstop>tabWidget</tabstop> <tabstop>camdevice_combo</tabstop> <tabstop>res_x_spin</tabstop> <tabstop>res_y_spin</tabstop> diff --git a/tracker-easy/tracker-easy.cpp b/tracker-easy/tracker-easy.cpp index 85b04026..0487d031 100644 --- a/tracker-easy/tracker-easy.cpp +++ b/tracker-easy/tracker-easy.cpp @@ -170,10 +170,15 @@ namespace EasyTracker { MatchFiveVertices(aTopIndex, aRightIndex, aLeftIndex, aTopRight, aTopLeft); } - else + else if (!iSettings.iClipModelThree) { MatchThreeOrFourVertices(aTopIndex, aRightIndex, aLeftIndex, aCenterIndex); } + else + { + // Clip model + MatchClipVertices(aTopIndex, aRightIndex, aLeftIndex); + } } @@ -342,7 +347,56 @@ namespace EasyTracker } } - + /** + */ + void Tracker::MatchClipVertices(int& aTopIndex, int& aMiddleIndex, int& aBottomIndex) + { + //Bitmap origin is top left + iTrackedPoints.clear(); + // Tracked points must match the order of the object model points. + // Find top most point, that's the one with min Y as we assume our guy's head is not up side down + int minY = std::numeric_limits<int>::max(); + for (int i = 0; i < (int)iPoints.size(); i++) + { + if (iPoints[i].y < minY) + { + minY = iPoints[i].y; + aTopIndex = i; + } + } + + + int maxY = 0; + + // Find bottom most point + for (int i = 0; i < (int)iPoints.size(); i++) + { + // Excluding top most point + if (i != aTopIndex && iPoints[i].y > maxY) + { + maxY = iPoints[i].y; + aBottomIndex = i; + } + } + + + // Find center point, the last one + for (int i = 0; i < (int)iPoints.size(); i++) + { + // Excluding the three points we already have + if (i != aTopIndex && i != aBottomIndex) + { + aMiddleIndex = i; + } + } + + // Order matters + iTrackedPoints.push_back(iPoints[aTopIndex]); + iTrackedPoints.push_back(iPoints[aMiddleIndex]); + iTrackedPoints.push_back(iPoints[aBottomIndex]); + } + + /// /// @@ -725,18 +779,29 @@ namespace EasyTracker // We are converting them from millimeters to centimeters. // TODO: Need to support clip too. That's cap only for now. iModel.clear(); - iModel.push_back(cv::Point3f(iSettings.iVertexTopX / 10.0, iSettings.iVertexTopY / 10.0, iSettings.iVertexTopZ / 10.0)); // Top - iModel.push_back(cv::Point3f(iSettings.iVertexRightX / 10.0, iSettings.iVertexRightY / 10.0, iSettings.iVertexRightZ / 10.0)); // Right - iModel.push_back(cv::Point3f(iSettings.iVertexLeftX / 10.0, iSettings.iVertexLeftY / 10.0, iSettings.iVertexLeftZ / 10.0)); // Left - if (iSettings.iCustomModelFour) + if (!iSettings.iClipModelThree) { - iModel.push_back(cv::Point3f(iSettings.iVertexCenterX / 10.0, iSettings.iVertexCenterY / 10.0, iSettings.iVertexCenterZ / 10.0)); // Center + iModel.push_back(cv::Point3f(iSettings.iVertexTopX / 10.0, iSettings.iVertexTopY / 10.0, iSettings.iVertexTopZ / 10.0)); // Top + iModel.push_back(cv::Point3f(iSettings.iVertexRightX / 10.0, iSettings.iVertexRightY / 10.0, iSettings.iVertexRightZ / 10.0)); // Right + iModel.push_back(cv::Point3f(iSettings.iVertexLeftX / 10.0, iSettings.iVertexLeftY / 10.0, iSettings.iVertexLeftZ / 10.0)); // Left + + if (iSettings.iCustomModelFour) + { + iModel.push_back(cv::Point3f(iSettings.iVertexCenterX / 10.0, iSettings.iVertexCenterY / 10.0, iSettings.iVertexCenterZ / 10.0)); // Center + } + else if (iSettings.iCustomModelFive) + { + iModel.push_back(cv::Point3f(iSettings.iVertexTopRightX / 10.0, iSettings.iVertexTopRightY / 10.0, iSettings.iVertexTopRightZ / 10.0)); // Top Right + iModel.push_back(cv::Point3f(iSettings.iVertexTopLeftX / 10.0, iSettings.iVertexTopLeftY / 10.0, iSettings.iVertexTopLeftZ / 10.0)); // Top Left + } } - else if (iSettings.iCustomModelFive) + else { - iModel.push_back(cv::Point3f(iSettings.iVertexTopRightX / 10.0, iSettings.iVertexTopRightY / 10.0, iSettings.iVertexTopRightZ / 10.0)); // Top Right - iModel.push_back(cv::Point3f(iSettings.iVertexTopLeftX / 10.0, iSettings.iVertexTopLeftY / 10.0, iSettings.iVertexTopLeftZ / 10.0)); // Top Left + // Clip model type + iModel.push_back(cv::Point3f(iSettings.iVertexClipTopX / 10.0, iSettings.iVertexClipTopY / 10.0, iSettings.iVertexClipTopZ / 10.0)); // Top + iModel.push_back(cv::Point3f(iSettings.iVertexClipMiddleX / 10.0, iSettings.iVertexClipMiddleY / 10.0, iSettings.iVertexClipMiddleZ / 10.0)); // Middle + iModel.push_back(cv::Point3f(iSettings.iVertexClipBottomX / 10.0, iSettings.iVertexClipBottomY / 10.0, iSettings.iVertexClipBottomZ / 10.0)); // Bottom } infout << "Update model - end"; diff --git a/tracker-easy/tracker-easy.h b/tracker-easy/tracker-easy.h index 0b51f9c7..4510fc7d 100644 --- a/tracker-easy/tracker-easy.h +++ b/tracker-easy/tracker-easy.h @@ -77,6 +77,7 @@ namespace EasyTracker void MatchVertices(int& aTopIndex, int& aRightIndex, int& aLeftIndex, int& aCenterIndex, int& aTopRight, int& aTopLeft); void MatchThreeOrFourVertices(int& aTopIndex, int& aRightIndex, int& aLeftIndex, int& aCenterIndex); void MatchFiveVertices(int& aTopIndex, int& aRightIndex, int& aLeftIndex, int& aTopRight, int& aTopLeft); + void MatchClipVertices(int& aTopIndex, int& aMiddleIndex, int& aBottomIndex); // |