From 36fb747c2293e1fabb1be21d53262e43bb53ed98 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Jul 2015 17:12:29 +0200 Subject: new game support --- bin/settings/facetracknoir supported games.csv | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bin/settings/facetracknoir supported games.csv b/bin/settings/facetracknoir supported games.csv index 2fa70b56..98dba166 100644 --- a/bin/settings/facetracknoir supported games.csv +++ b/bin/settings/facetracknoir supported games.csv @@ -31,6 +31,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 26;ArmA 2 Operation Arrowhead;FreeTrack20;V160;V;vn88holden;0;001ABC224B7783DAF0D500 27;ArmA 3;FreeTrack20;V170;;;7503;001BB69411ABD4E2B39900 28;Armored Assault - Gold Edition;FreeTrack20;V170;;;1303;001CA7F7CAA00814ECA700 +559;Artificial Head;FreeTrack20;V160;;;20380;022F3A9DCD1F7E0D62C000 29;Arvoch Alliance;FreeTrack20;V160;;;14908;001D318F8773BAE29A9300 30;Arvoch Conflict;FreeTrack20;V160;;;14901;001E5C1FDE722DAE2BA900 31;Auditory Displays for the blind;FreeTrack20;V160;;;20035;001F0FC9FF862F9D34BA00 @@ -69,6 +70,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 60;Chopper;FreeTrack20;V160;;;3150;003CC166C8632A32EA2300 61;Clearbox;FreeTrack20;V160;;;20565;003D5C1FDE74279D1DB800 62;CNKFsoft;FreeTrack20;V160;;;20495;003ED7690F6073187B0000 +558;Code 10;FreeTrack20;V160;;;2975;022E45423D22193FF81900 487;Cognitics;FreeTrack20;V160;;;20760;01E715A96D19515BFC1500 63;Colin McRae DiRT 2;FreeTrack20;V170;V;V4Friend;8107;003F7815C5379491C73300 64;Colin McRae Rally 04;FreeTrack20;V160;;;8103;0040D13C2A843DA526A610 @@ -84,6 +86,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 72;Corys;FreeTrack20;V160;;;20550;0048157D78738A342A8D00 73;Counter Strike;FreeTrack20;V160;;;12501;004953FE1E862AB73DA600 74;Crane Simulator;FreeTrack20;V160;;;20048;004A6B62C6A7931972DA00 +567;Cranfield University;FreeTrack20;V160;;;20905;0237A8C5B26E7A38A66500 75;Crashday;FreeTrack20;V160;;;5601;004BD6E585F893D933BA00 76;Creanex Training Simulator;FreeTrack20;V160;;;20205;004CF478D277A40A929A00 77;Creative Labs headset;FreeTrack20;V160;;;20018;004D348B1743E961FA6300 @@ -91,6 +94,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 79;Crysis Mod;FreeTrack20;V160;;;1625;004F90B57839B231A24200 80;Crystal Growth Simulation;FreeTrack20;V160;;;20029;005026F79742FB241A6200 81;Crytek;FreeTrack20;V170;;;2775;0051D5F1EBBAD81C714600 +562;Cypher City;FreeTrack20;V160;;;4250;023259070AE238A9E78100 83;D2x-XL;FreeTrack20;V160;;;16001;00532E20237BEDABEB8A00 84;Dark Horizons Lore;FreeTrack20;V160;;;7901;005487801A852AA7385200 85;Dawn of Aces - Gold Edition;FreeTrack20;V170;;;1304;0055A9ED7700814190DE00 @@ -102,6 +106,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 90;Dead Reckoning;FreeTrack20;V160;;;10401;005A4C2F6752F912D66200 91;Delivery;FreeTrack20;V160;;;15901;005BF3E85B1A8534AE3400 471;Demon Core;FreeTrack20;V160;;;3225;01D7D1DC6052A165A7AC00 +563;Descent: Underground;FreeTrack20;V160;;;4275;023355381D3CCBD801D700 92;DiRT;FreeTrack20;V160;;;8104;005C72456F7523881F1800 93;DiRT 3;FreeTrack20;V170;;;8108;005DABA016ED2DFBDF6F00 94;Door3;FreeTrack20;V160;;;20665;005ED13C2A853DA82F6B00 @@ -136,6 +141,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 116;Eventology;FreeTrack20;V160;;;12201;0074849F8B469C2BAC3600 117;EVOC-101 Training;FreeTrack20;V160;;;20038;00756925967D2088FC6200 118;Evochron Alliance 2.0;FreeTrack20;V160;;;14904;00767A32A1A8735A022900 +557;Evochron Legacy;FreeTrack20;V160;;;14909;022D84A6946770E4EFD800 119;Evochron Legends;FreeTrack20;V160;;;14906;0077D6E585F8B41A12BA00 120;Evochron Mercenary;FreeTrack20;V160;V;Scavenger4711 ;14907;00783752FBC7B42B221A00 121;Evochron Renegades;FreeTrack20;V160;;;14905;0079621E7763FB421A1300 @@ -166,6 +172,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 140;Flying Tigers;FreeTrack20;V160;;;7002;008C91D997F29A930B0200 141;FlyingGuns;FreeTrack20;V160;;;14801;008D7A32A1A882BAA28A00 142;Ford Racing 3;FreeTrack20;V160;;;6901;008E27D5047C2BA62F5800 +561;Forklift Simulator;FreeTrack20;V160;;;20885;02314A30F16DAF63EABB00 542;Fractured Space;FreeTrack20;V170;;;3976;0F88A4D88906429E684E00 143;Free Falcon 4.0;FreeTrack20;V160;;;1901;008F157D78A3B962E55000 144;Free Falcon 4.0: Allied Force;FreeTrack20;V160;;;8901;0090656DD6793CA9325900 @@ -228,6 +235,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 189;Innovatec Simulator;FreeTrack20;V160;;;20036;00BD22FD7935B23DB82C00 190;Insurgency;FreeTrack20;V160;;;9401;00BEB6C61427B3EA744B00 191;Intific;FreeTrack20;V160;;;20655;00BF2BCA747F2AA8309D00 +566;Into the Dungeon;FreeTrack20;V160;;;4375;0236B346990ACCFC047A00 192;iRacing;FreeTrack20;V160;V;vn88holden ;14101;00C0103AF1AA730A236900 193;IREQ Robotic Camera Control;FreeTrack20;V160;;;20027;00C10448E0E8618521EB00 536;ISAMM;FreeTrack20;V160;;;20860;0218303730165E681DB000 @@ -247,6 +255,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 206;Jumpgate Evolution;FreeTrack20;V170;;;15002;00CE5936D4F93DCE0CE700 207;KAF Keymapper;FreeTrack20;V160;;;3101;00CF934348830E87EB8300 476;KAI FLight Simulator;FreeTrack20;V160;;;20725;01DCC522132A5C01EDE500 +560;Keita Head Tracking;FreeTrack20;V160;;;20385;02307E33478667072B0800 208;Key Macro View;FreeTrack20;V160;;;12001;00D016BC08431B1EF90100 209;kiwi.vg;FreeTrack20;V160;;;20395;00D1409A430AB33633E900 521;Kongsberg GlobalSim;FreeTrack20;V160;;;20825;0209B2C573D990BF764700 @@ -433,6 +442,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 361;Steel Beasts 2;FreeTrack20;V160;;;11703;0169DCC441A9443A831A00 362;Steel Beasts Pro;FreeTrack20;V160;;;11701;016A8F54A20833CAA23900 363;Steel Beasts Pro Personal;FreeTrack20;V160;;;11702;016BF3E85B1A9443A73000 +565;Steel Beasts Professional;FreeTrack20;V160;;;4350;02356C64A9AFBB37E56E00 364;Stoked Rider;FreeTrack20;V160;;;14701;016CC166C963EA32997300 365;Storm of War: the Battle of Britain;FreeTrack20;V170;;;11001;016D8F54A68B71F25D0200 495;STRAFT;FreeTrack20;V160;;;3375;01EF1329E014ADF98D6B00 @@ -523,6 +533,7 @@ No;Game Name;Game protocol;Supported since;Verified;By;INTERNATIONAL_ID;FTN_ID 480;Vizard;FreeTrack20;V160;;;20745;01E0C1F20A79D7C0561300 437;VizRD;FreeTrack20;V160;;;20031;01B55485D9825BF1D8AB00 438;Void War;FreeTrack20;V160;;;10001;01B65C1FDE872AA1206600 +564;VR Truck Simulator;FreeTrack20;V160;;;4325;02344CAEE1BC9E243D9F00 477;VRPlayer;FreeTrack20;V160;;;20730;01DD6787E57245201D5000 439;VT08;FreeTrack20;V160;;;1275;01B7B78B06EC9912750200 440;VVVV Plugin;FreeTrack20;V160;;;20075;01B8B1C6648A138C205500 -- cgit v1.2.3 From 8cc9e744da96d9bb5e84b41f3052f69074a05438 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 04:56:53 +0200 Subject: mouse: replace copyright The mouse tracker was entirely rewritten since. --- ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp | 34 +++-------------- ftnoir_protocol_mouse/ftnoir_protocol_mouse.h | 50 ++++--------------------- 2 files changed, 13 insertions(+), 71 deletions(-) diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp index 6b7c52b2..5d9f9689 100644 --- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp +++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.cpp @@ -1,31 +1,9 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of the some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-2011 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* Homepage * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see . * -* * -* FTNoIR_Protocol_Mouse The Class, that communicates headpose-data by * -* generating Mouse commands. * -* Many games (like FPS's) support Mouse-look features, * -* but no face-tracking. * -********************************************************************************/ +/* Copyright (c) 2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #include "ftnoir_protocol_mouse.h" #include "opentrack/plugin-api.hpp" diff --git a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h index 06405e69..95b5f72c 100644 --- a/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h +++ b/ftnoir_protocol_mouse/ftnoir_protocol_mouse.h @@ -1,44 +1,15 @@ -/******************************************************************************** -* FaceTrackNoIR This program is a private project of some enthusiastic * -* gamers from Holland, who don't like to pay much for * -* head-tracking. * -* * -* Copyright (C) 2010-2011 Wim Vriend (Developing) * -* Ron Hendriks (Researching and Testing) * -* * -* http://facetracknoir.sourceforge.net/home/default.htm * -* * -* This program is free software; you can redistribute it and/or modify it * -* under the terms of the GNU General Public License as published by the * -* Free Software Foundation; either version 3 of the License, or (at your * -* option) any later version. * -* * -* This program is distributed in the hope that it will be useful, but * -* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * -* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -* more details. * -* * -* You should have received a copy of the GNU General Public License along * -* with this program; if not, see . * -* * -* FTNoIR_Protocol_Mouse The Class, that communicates headpose-data by * -* generating Mouse commands. * -* Many games (like FPS's) support Mouse-look features, * -* but no face-tracking. * -********************************************************************************/ +/* Copyright (c) 2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #pragma once -#ifndef INCLUDED_MOUSESERVER_H -#define INCLUDED_MOUSESERVER_H #include "ui_ftnoir_mousecontrols.h" -#include -#include -#include -#include #include -#include #include -#include #include "opentrack/plugin-api.hpp" #include "opentrack/options.hpp" using namespace options; @@ -52,9 +23,6 @@ struct settings : opts { {} }; -#define MOUSE_AXIS_MIN 0 -#define MOUSE_AXIS_MAX 65535 - class FTNoIR_Protocol : public IProtocol { public: @@ -90,7 +58,3 @@ public: QString name() { return QString("mouse emulation"); } QIcon icon() { return QIcon(":/images/mouse.png"); } }; - - -#endif//INCLUDED_MOUSESERVER_H -//END -- cgit v1.2.3 From c7baa095275b9936654321b23fc8f46165180d32 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 04:58:33 +0200 Subject: add my own copyright We need copyright on contributions or else it defaults to granting no rights. --- facetracknoir/curve-config.cpp | 10 +++++++++- facetracknoir/options-dialog.cpp | 8 ++++++++ facetracknoir/process_detector.cpp | 8 ++++++++ facetracknoir/process_detector.h | 8 ++++++++ facetracknoir/ui.cpp | 9 +++++++++ facetracknoir/ui.h | 8 ++++++++ ftnoir_filter_accela/ftnoir_filter_accela.h | 6 ++++++ ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp | 6 ++++++ ftnoir_protocol_ft/ftnoir_protocol_ft.cpp | 8 ++++++++ ftnoir_protocol_ft/ftnoir_protocol_ft.h | 8 ++++++++ ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp | 1 + ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 8 ++++++++ ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 2 +- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 2 +- ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp | 6 ++++++ ftnoir_tracker_udp/ftnoir_tracker_udp.cpp | 8 ++++++++ opentrack/camera-names.hpp | 8 ++++++++ opentrack/main-settings.hpp | 8 ++++++++ opentrack/opencv-calibration.hpp | 8 ++++++++ opentrack/opencv-camera-dialog.hpp | 8 ++++++++ opentrack/plugin-api.hpp | 8 ++++++++ opentrack/shortcuts.cpp | 9 ++++++++- opentrack/tracker.cpp | 2 +- 23 files changed, 152 insertions(+), 5 deletions(-) diff --git a/facetracknoir/curve-config.cpp b/facetracknoir/curve-config.cpp index f6c78f79..e199d005 100644 --- a/facetracknoir/curve-config.cpp +++ b/facetracknoir/curve-config.cpp @@ -1,4 +1,12 @@ -#include "./curve-config.h" +/* Copyright (c) 2014-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + +#include "curve-config.h" #include "opentrack/main-settings.hpp" MapWidget::MapWidget(Mappings& m, main_settings& s) : m(m) diff --git a/facetracknoir/options-dialog.cpp b/facetracknoir/options-dialog.cpp index 4489e502..ca4c6c3e 100644 --- a/facetracknoir/options-dialog.cpp +++ b/facetracknoir/options-dialog.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include "options-dialog.hpp" OptionsDialog::OptionsDialog() diff --git a/facetracknoir/process_detector.cpp b/facetracknoir/process_detector.cpp index 8efc0c10..df38eb29 100644 --- a/facetracknoir/process_detector.cpp +++ b/facetracknoir/process_detector.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include "process_detector.h" #include "facetracknoir/ui.h" #include diff --git a/facetracknoir/process_detector.h b/facetracknoir/process_detector.h index 3cebd422..792a941f 100644 --- a/facetracknoir/process_detector.h +++ b/facetracknoir/process_detector.h @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index ac58cce8..8275cb2d 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -21,6 +21,15 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, see . *********************************************************************************/ + +/* Copyright (c) 2013-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include "ui.h" #include "opentrack/tracker.h" #include "opentrack/options.hpp" diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h index 7fa10664..097b2439 100644 --- a/facetracknoir/ui.h +++ b/facetracknoir/ui.h @@ -22,6 +22,14 @@ * with this program; if not, see . *********************************************************************************/ +/* Copyright (c) 2014-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include diff --git a/ftnoir_filter_accela/ftnoir_filter_accela.h b/ftnoir_filter_accela/ftnoir_filter_accela.h index 177e5866..54845bfe 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela.h +++ b/ftnoir_filter_accela/ftnoir_filter_accela.h @@ -1,3 +1,9 @@ +/* Copyright (c) 2012-2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #pragma once #include "ui_ftnoir_accela_filtercontrols.h" #include "opentrack/plugin-api.hpp" diff --git a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp index 2c25ac33..60e5dbd3 100644 --- a/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp +++ b/ftnoir_filter_accela/ftnoir_filter_accela_dialog.cpp @@ -1,3 +1,9 @@ +/* Copyright (c) 2012-2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #include "ftnoir_filter_accela/ftnoir_filter_accela.h" #include #include diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp index 73bf834a..b38b0730 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp @@ -24,6 +24,14 @@ * FTServer FTServer is the Class, that communicates headpose-data * to games, using the FreeTrackClient.dll. ********************************************************************************/ + +/* Copyright (c) 2013-2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #include "ftnoir_protocol_ft.h" #include "csv/csv.h" diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h index b7506c75..f80a511b 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h @@ -24,6 +24,14 @@ * FTServer FTServer is the Class, that communicates headpose-data * * to games, using the FreeTrackClient.dll. * ********************************************************************************/ + +/* Copyright (c) 2013-2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #pragma once #include "ui_ftnoir_ftcontrols.h" #include "opentrack/plugin-api.hpp" diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp index db0165b5..04d5635e 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp @@ -22,6 +22,7 @@ * with this program; if not, see . * * * ********************************************************************************/ + #include "ftnoir_protocol_ft.h" #include #include diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index ef695623..14233f36 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -26,6 +26,14 @@ * SimConnect.dll is a so called 'side-by-side' assembly, so it * * must be treated as such... * ********************************************************************************/ + +/* Copyright (c) 2015 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ + #include "ftnoir_protocol_sc.h" #include "opentrack/plugin-api.hpp" diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index c0ce1f22..b44896e5 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Stanislaw Halik +/* Copyright (c) 2013-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index ae574338..86e8d1b9 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Stanislaw Halik +/* Copyright (c) 2013-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp index 9fe382c3..45cf2f10 100644 --- a/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp +++ b/ftnoir_tracker_joystick/ftnoir_tracker_joystick.cpp @@ -1,3 +1,9 @@ +/* Copyright (c) 2013 Stanislaw Halik + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + */ #include "ftnoir_tracker_joystick.h" #include "opentrack/plugin-api.hpp" #include diff --git a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp index b60e7ccc..bc42f402 100644 --- a/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp +++ b/ftnoir_tracker_udp/ftnoir_tracker_udp.cpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2014, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include "ftnoir_tracker_udp.h" #include "opentrack/plugin-api.hpp" diff --git a/opentrack/camera-names.hpp b/opentrack/camera-names.hpp index fd869e6b..4ae07a9f 100644 --- a/opentrack/camera-names.hpp +++ b/opentrack/camera-names.hpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2014-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index 250d4563..c643929a 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include diff --git a/opentrack/opencv-calibration.hpp b/opentrack/opencv-calibration.hpp index 6dee9908..71f30850 100644 --- a/opentrack/opencv-calibration.hpp +++ b/opentrack/opencv-calibration.hpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include #include diff --git a/opentrack/opencv-camera-dialog.hpp b/opentrack/opencv-camera-dialog.hpp index cd3d38e7..0d4a51af 100644 --- a/opentrack/opencv-camera-dialog.hpp +++ b/opentrack/opencv-camera-dialog.hpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include diff --git a/opentrack/plugin-api.hpp b/opentrack/plugin-api.hpp index 021f5017..b0da4950 100644 --- a/opentrack/plugin-api.hpp +++ b/opentrack/plugin-api.hpp @@ -1,3 +1,11 @@ +/* Copyright (c) 2013-2015, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #pragma once #include "export.hpp" diff --git a/opentrack/shortcuts.cpp b/opentrack/shortcuts.cpp index e81b6bb0..ed1701c7 100644 --- a/opentrack/shortcuts.cpp +++ b/opentrack/shortcuts.cpp @@ -1,7 +1,14 @@ +/* Copyright (c) 2014, Stanislaw Halik + + * Permission to use, copy, modify, and/or distribute this + * software for any purpose with or without fee is hereby granted, + * provided that the above copyright notice and this permission + * notice appear in all copies. + */ + #include "shortcuts.h" #include - #if defined(_WIN32) #include diff --git a/opentrack/tracker.cpp b/opentrack/tracker.cpp index 1ab350d5..e03342e4 100644 --- a/opentrack/tracker.cpp +++ b/opentrack/tracker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2013 Stanislaw Halik +/* Copyright (c) 2012-2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above -- cgit v1.2.3 From d32ba5032b9506e89590d15f82b6d4a484f2bd04 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 05:06:44 +0200 Subject: add my copyright to some more code --- ftnoir_tracker_aruco/ar_video_widget.cpp | 4 +--- ftnoir_tracker_aruco/ar_video_widget.h | 10 ++-------- ftnoir_tracker_ht/ht_video_widget.cpp | 4 +--- ftnoir_tracker_ht/ht_video_widget.h | 15 +++------------ ftnoir_tracker_pt/pt_video_widget.cpp | 3 --- ftnoir_tracker_pt/pt_video_widget.h | 11 +++-------- 6 files changed, 10 insertions(+), 37 deletions(-) diff --git a/ftnoir_tracker_aruco/ar_video_widget.cpp b/ftnoir_tracker_aruco/ar_video_widget.cpp index 2d9e3052..70c26e55 100644 --- a/ftnoir_tracker_aruco/ar_video_widget.cpp +++ b/ftnoir_tracker_aruco/ar_video_widget.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 Patrick Ruoff +/* Copyright (c) 2014 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -7,8 +7,6 @@ #include "ar_video_widget.h" -#include - using namespace std; void ArucoVideoWidget::update_image(const cv::Mat& frame) diff --git a/ftnoir_tracker_aruco/ar_video_widget.h b/ftnoir_tracker_aruco/ar_video_widget.h index 638b0ab4..6df2d626 100644 --- a/ftnoir_tracker_aruco/ar_video_widget.h +++ b/ftnoir_tracker_aruco/ar_video_widget.h @@ -1,24 +1,20 @@ -/* Copyright (c) 2012 Patrick Ruoff +/* Copyright (c) 2014 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. */ -#ifndef VIDEOWIDGET_H -#define VIDEOWIDGET_H +#pragma once #include #include #include #include -#include #include #include -#include #include -// ---------------------------------------------------------------------------- class ArucoVideoWidget : public QWidget { Q_OBJECT @@ -35,5 +31,3 @@ public: void update_image(const cv::Mat& frame); void paintEvent( QPaintEvent*) override; }; - -#endif // VIDEOWIDGET_H diff --git a/ftnoir_tracker_ht/ht_video_widget.cpp b/ftnoir_tracker_ht/ht_video_widget.cpp index 1c5f565c..ef58c98f 100644 --- a/ftnoir_tracker_ht/ht_video_widget.cpp +++ b/ftnoir_tracker_ht/ht_video_widget.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 Patrick Ruoff +/* Copyright (c) 2014 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -7,8 +7,6 @@ #include "ht_video_widget.h" -#include - using namespace std; void HTVideoWidget::update_image(unsigned char *frame, int width, int height) diff --git a/ftnoir_tracker_ht/ht_video_widget.h b/ftnoir_tracker_ht/ht_video_widget.h index be4aee44..054b2cf4 100644 --- a/ftnoir_tracker_ht/ht_video_widget.h +++ b/ftnoir_tracker_ht/ht_video_widget.h @@ -1,27 +1,21 @@ -/* Copyright (c) 2012 Patrick Ruoff +/* Copyright (c) 2014 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. */ +#pragma once -#ifndef VIDEOWIDGET_H -#define VIDEOWIDGET_H - -#include +#include #include #include #include -#include #include #include -#include -// ---------------------------------------------------------------------------- class HTVideoWidget : public QWidget { Q_OBJECT - public: HTVideoWidget(QWidget *parent) : QWidget(parent), fb(), width(0), height(0), fresh(false) { connect(&timer, SIGNAL(timeout()), this, SLOT(update_and_repaint())); @@ -35,7 +29,6 @@ protected slots: painter.drawImage(e->rect(), texture); } void update_and_repaint(); - private: QMutex mtx; QImage texture; @@ -44,5 +37,3 @@ private: int width,height; bool fresh; }; - -#endif // VIDEOWIDGET_H diff --git a/ftnoir_tracker_pt/pt_video_widget.cpp b/ftnoir_tracker_pt/pt_video_widget.cpp index 12f01413..15fc5a86 100644 --- a/ftnoir_tracker_pt/pt_video_widget.cpp +++ b/ftnoir_tracker_pt/pt_video_widget.cpp @@ -9,9 +9,6 @@ #include "pt_video_widget.h" -#include -#include - using namespace cv; using namespace std; diff --git a/ftnoir_tracker_pt/pt_video_widget.h b/ftnoir_tracker_pt/pt_video_widget.h index 09818254..af1d60fd 100644 --- a/ftnoir_tracker_pt/pt_video_widget.h +++ b/ftnoir_tracker_pt/pt_video_widget.h @@ -1,4 +1,5 @@ /* Copyright (c) 2012 Patrick Ruoff + * Copyright (c) 2014 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -8,15 +9,9 @@ #pragma once #include -#include -#include +#include #include -#ifndef OPENTRACK_API -# include -# include -#else -# include -#endif +#include #include #include #include -- cgit v1.2.3 From 1c28600c36d15cf1eb6f8a1816375abf0d4bef31 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 05:06:53 +0200 Subject: ht: fix include --- ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 1 - ftnoir_tracker_ht/stdafx.h | 0 2 files changed, 1 deletion(-) delete mode 100644 ftnoir_tracker_ht/stdafx.h diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index 86992911..2ac614a2 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -1,4 +1,3 @@ -#include "stdafx.h" #include "headtracker-ftnoir.h" #include "ftnoir_tracker_ht.h" #include "ui_ht-trackercontrols.h" diff --git a/ftnoir_tracker_ht/stdafx.h b/ftnoir_tracker_ht/stdafx.h deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3 From 122274fd8e525410653ec4e985f095e0f12eba86 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 05:07:41 +0200 Subject: octopus: update copyright --- pose-widget/glwidget.cpp | 2 +- pose-widget/glwidget.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pose-widget/glwidget.cpp b/pose-widget/glwidget.cpp index ed4560af..8fbe046e 100644 --- a/pose-widget/glwidget.cpp +++ b/pose-widget/glwidget.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Stanislaw Halik +/* Copyright (c) 2013, 2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/pose-widget/glwidget.h b/pose-widget/glwidget.h index f54ae48d..88961fbd 100644 --- a/pose-widget/glwidget.h +++ b/pose-widget/glwidget.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Stanislaw Halik +/* Copyright (c) 2013, 2015 Stanislaw Halik * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above -- cgit v1.2.3 From 9ca2c046cd227cb7b83ac1969ccb2cd0e4ee9862 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 06:04:08 +0200 Subject: calibration file for ps3 eye 75deg --- bin/camera/PS3Eye Camera-56.yml | 22 ++++++++++++++++++++++ bin/camera/PS3Eye Camera-75.yml | 22 ++++++++++++++++++++++ bin/camera/PS3Eye Camera.yml | 22 ---------------------- 3 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 bin/camera/PS3Eye Camera-56.yml create mode 100644 bin/camera/PS3Eye Camera-75.yml delete mode 100644 bin/camera/PS3Eye Camera.yml diff --git a/bin/camera/PS3Eye Camera-56.yml b/bin/camera/PS3Eye Camera-56.yml new file mode 100644 index 00000000..6859d0fb --- /dev/null +++ b/bin/camera/PS3Eye Camera-56.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/13/15 17:45:33" +image_width: 640 +image_height: 480 +board_width: 24 +board_height: 15 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.5119574967224673e+002, 0., 3.2806930334341007e+002, 0., + 7.5112907969240291e+002, 2.2681331450818737e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -2.2741190107950382e-001, 9.4372681451250684e-001, + -4.0955586655475494e-003, -2.6778551080439902e-003, + -1.7969804313130640e+000 ] +avg_reprojection_error: 1.9233386799903629e+000 diff --git a/bin/camera/PS3Eye Camera-75.yml b/bin/camera/PS3Eye Camera-75.yml new file mode 100644 index 00000000..bf8fe0d3 --- /dev/null +++ b/bin/camera/PS3Eye Camera-75.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/20/15 04:51:53" +image_width: 640 +image_height: 480 +board_width: 5 +board_height: 5 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.1311062261797588e+002, 0., 2.8104464540018199e+002, 0., + 7.0668490426304095e+002, 2.7903331411454337e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -2.2697038330479780e-001, 9.3383028790481815e-001, + 1.0716120533882623e-002, -9.0372250512977884e-003, + -1.7702927181212214e+000 ] +avg_reprojection_error: 1.7556161579210681e+000 diff --git a/bin/camera/PS3Eye Camera.yml b/bin/camera/PS3Eye Camera.yml deleted file mode 100644 index 6859d0fb..00000000 --- a/bin/camera/PS3Eye Camera.yml +++ /dev/null @@ -1,22 +0,0 @@ -%YAML:1.0 -calibration_time: "07/13/15 17:45:33" -image_width: 640 -image_height: 480 -board_width: 24 -board_height: 15 -square_size: 1. -flags: 0 -camera_matrix: !!opencv-matrix - rows: 3 - cols: 3 - dt: d - data: [ 7.5119574967224673e+002, 0., 3.2806930334341007e+002, 0., - 7.5112907969240291e+002, 2.2681331450818737e+002, 0., 0., 1. ] -distortion_coefficients: !!opencv-matrix - rows: 5 - cols: 1 - dt: d - data: [ -2.2741190107950382e-001, 9.4372681451250684e-001, - -4.0955586655475494e-003, -2.6778551080439902e-003, - -1.7969804313130640e+000 ] -avg_reprojection_error: 1.9233386799903629e+000 -- cgit v1.2.3 From faae0ab01dd6d9a7ffed39f36c053e236abbcc61 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:07:38 +0200 Subject: add ManyCam fake ps3 eye calibration This helps me with testing using user-sent videos --- bin/camera/ManyCam Video Source-56.yml | 22 ++++++++++++++++++++++ bin/camera/ManyCam Video Source-75.yml | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 bin/camera/ManyCam Video Source-56.yml create mode 100644 bin/camera/ManyCam Video Source-75.yml diff --git a/bin/camera/ManyCam Video Source-56.yml b/bin/camera/ManyCam Video Source-56.yml new file mode 100644 index 00000000..6859d0fb --- /dev/null +++ b/bin/camera/ManyCam Video Source-56.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/13/15 17:45:33" +image_width: 640 +image_height: 480 +board_width: 24 +board_height: 15 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.5119574967224673e+002, 0., 3.2806930334341007e+002, 0., + 7.5112907969240291e+002, 2.2681331450818737e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -2.2741190107950382e-001, 9.4372681451250684e-001, + -4.0955586655475494e-003, -2.6778551080439902e-003, + -1.7969804313130640e+000 ] +avg_reprojection_error: 1.9233386799903629e+000 diff --git a/bin/camera/ManyCam Video Source-75.yml b/bin/camera/ManyCam Video Source-75.yml new file mode 100644 index 00000000..bf8fe0d3 --- /dev/null +++ b/bin/camera/ManyCam Video Source-75.yml @@ -0,0 +1,22 @@ +%YAML:1.0 +calibration_time: "07/20/15 04:51:53" +image_width: 640 +image_height: 480 +board_width: 5 +board_height: 5 +square_size: 1. +flags: 0 +camera_matrix: !!opencv-matrix + rows: 3 + cols: 3 + dt: d + data: [ 7.1311062261797588e+002, 0., 2.8104464540018199e+002, 0., + 7.0668490426304095e+002, 2.7903331411454337e+002, 0., 0., 1. ] +distortion_coefficients: !!opencv-matrix + rows: 5 + cols: 1 + dt: d + data: [ -2.2697038330479780e-001, 9.3383028790481815e-001, + 1.0716120533882623e-002, -9.0372250512977884e-003, + -1.7702927181212214e+000 ] +avg_reprojection_error: 1.7556161579210681e+000 -- cgit v1.2.3 From 8bf58b412d2b9c5cd3f1e1215c5ae9462d494888 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:08:58 +0200 Subject: calibration: rewrite - Intrinsics are floats, not doubles. - Try searching for calibration filename with fov specified first, then without fov. - Grab image width and height from calibration file, don't asume 640x480 --- opentrack/opencv-calibration.hpp | 42 +++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/opentrack/opencv-calibration.hpp b/opentrack/opencv-calibration.hpp index 71f30850..99e6d4c7 100644 --- a/opentrack/opencv-calibration.hpp +++ b/opentrack/opencv-calibration.hpp @@ -14,21 +14,31 @@ #include template -bool get_camera_calibration(const QString& camera_name, cv::Mat& intrinsics, cv::Mat& distortion, int w, int h) +bool get_camera_calibration(const QString& camera_name, cv::Mat& intrinsics, cv::Mat& distortion, int w, int h, int fov) { - QString pathname_ = QCoreApplication::applicationDirPath() + "/camera/" + camera_name + ".yml"; - std::string pathname = pathname_.toStdString(); - cv::FileStorage fs(pathname, cv::FileStorage::READ); - if (!fs.isOpened()) - return false; - cv::Mat intrinsics_, distortion_; - fs["camera_matrix"] >> intrinsics_; - fs["distortion_coefficients"] >> distortion_; - intrinsics_.at(0, 0) *= w / 640.; - intrinsics_.at(2, 0) *= w / 640.; - intrinsics_.at(1, 1) *= h / 480.; - intrinsics_.at(2, 1) *= h / 480.; - intrinsics = intrinsics_; - distortion = distortion_; - return true; + const QString pathnames[] = { + QCoreApplication::applicationDirPath() + "/camera/" + camera_name + "-" + QString::number(fov) + ".yml", + QCoreApplication::applicationDirPath() + "/camera/" + camera_name + ".yml", + }; + for (auto& pathname : pathnames) + { + cv::FileStorage fs(pathname.toStdString(), cv::FileStorage::READ); + if (!fs.isOpened()) + continue; + cv::Mat intrinsics_, distortion_; + fs["camera_matrix"] >> intrinsics_; + fs["distortion_coefficients"] >> distortion_; + int w_, h_; + fs["image_width"] >> w_; + fs["image_height"] >> h_; + double w__ = w_, h__ = h_; + intrinsics_.at(0, 0) *= w / w__; + intrinsics_.at(2, 0) *= w / w__; + intrinsics_.at(1, 1) *= h / h__; + intrinsics_.at(2, 1) *= h / h__; + intrinsics = intrinsics_; + distortion = distortion_; + return true; + } + return false; } -- cgit v1.2.3 From e9b42b3d4eabd1d4fbcdfb990c26f286259be8d2 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:09:44 +0200 Subject: camera: more robust get_info() If camera was barely created and there's no info, grab the first frame to get resolution data. --- ftnoir_tracker_pt/camera.cpp | 10 ++++++++++ ftnoir_tracker_pt/camera.h | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ftnoir_tracker_pt/camera.cpp b/ftnoir_tracker_pt/camera.cpp index 9168a3e4..2e745f2a 100644 --- a/ftnoir_tracker_pt/camera.cpp +++ b/ftnoir_tracker_pt/camera.cpp @@ -61,6 +61,16 @@ void Camera::set_res(int x_res, int y_res) } } +CamInfo Camera::get_info() +{ + if (cam_info.res_x == 0 || cam_info.res_y == 0) + { + cv::Mat tmp; + _get_frame(&tmp); + } + return cam_info; +} + bool Camera::get_frame(float dt, cv::Mat* frame) { bool new_frame = _get_frame(frame); diff --git a/ftnoir_tracker_pt/camera.h b/ftnoir_tracker_pt/camera.h index 63614ded..2c42652a 100644 --- a/ftnoir_tracker_pt/camera.h +++ b/ftnoir_tracker_pt/camera.h @@ -54,8 +54,8 @@ public: bool get_frame(float dt, cv::Mat* frame); // WARNING: returned references are valid as long as object - const CamInfo& get_info() const { return cam_info; } - const CamInfo& get_desired() const { return cam_desired; } + CamInfo get_info(); + CamInfo get_desired() const { return cam_desired; } protected: // get a frame from the camera -- cgit v1.2.3 From eca75bfc0f1b6b990076232f7d27e4d1d2f55dd3 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:09:59 +0200 Subject: aruco: make fov int, not double --- ftnoir_tracker_aruco/aruco-trackercontrols.ui | 41 +++++++++++++-------------- ftnoir_tracker_aruco/ftnoir_tracker_aruco.h | 3 +- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/ftnoir_tracker_aruco/aruco-trackercontrols.ui b/ftnoir_tracker_aruco/aruco-trackercontrols.ui index bc384f39..7e32936c 100644 --- a/ftnoir_tracker_aruco/aruco-trackercontrols.ui +++ b/ftnoir_tracker_aruco/aruco-trackercontrols.ui @@ -33,28 +33,6 @@ - - - - - 0 - 0 - - - - - - - 35.000000000000000 - - - 180.000000000000000 - - - 52.000000000000000 - - - @@ -172,6 +150,25 @@ + + + + + 0 + 0 + + + + + + + 10 + + + 180 + + + diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h index 86e8d1b9..9691a75c 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.h @@ -26,7 +26,8 @@ using namespace options; struct settings : opts { - value fov, headpos_x, headpos_y, headpos_z; + value fov; + value headpos_x, headpos_y, headpos_z; value camera_name; value force_fps, resolution; settings() : -- cgit v1.2.3 From 20827ce134033e2370c6858905d2faca5c240602 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:10:27 +0200 Subject: aruco: follow api change --- ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp index b44896e5..786be62d 100644 --- a/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp +++ b/ftnoir_tracker_aruco/ftnoir_tracker_aruco.cpp @@ -132,7 +132,7 @@ void Tracker::run() double failed = 0; const double max_failed = 1.25; cv::Vec3d rvec, tvec; - double last_fov = -1; + int last_fov = -1; cv::Mat intrinsics = cv::Mat::eye(3, 3, CV_32FC1); cv::Mat dist_coeffs = cv::Mat::zeros(5, 1, CV_32FC1); @@ -161,7 +161,7 @@ void Tracker::run() if (last_fov != s.fov) { last_fov = s.fov; - if (!get_camera_calibration(static_cast(s.camera_name), intrinsics, dist_coeffs, grayscale.cols, grayscale.rows)) + if (!get_camera_calibration(s.camera_name, intrinsics, dist_coeffs, grayscale.cols, grayscale.rows, s.fov)) { intrinsics.at (0, 0) = focal_length_w; intrinsics.at (1, 1) = focal_length_h; -- cgit v1.2.3 From e89c2b1034692eb1365715a089b7035e6d837719 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:13:06 +0200 Subject: pt: change point internal representation Store points as pixel coordinates, not -0.5->0.5. This has no effect on tracking as POSIT is robust enough not to care. --- ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 11 +++++------ ftnoir_tracker_pt/point_extractor.cpp | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 8ccfe2c4..b8f40e50 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -58,7 +58,7 @@ float Tracker_PT::get_focal_length() static constexpr double pi = 3.1415926f; const double diag = sqrt(w * w + h * h)/w, diag_fov = static_cast(s.fov) * pi / 180.; const double fov = 2.*atan(tan(diag_fov/2.0)/sqrt(1. + diag*diag)); - return .5 / tan(.5 * fov); + return w*.5 / tan(.5 * fov); } void Tracker_PT::run() @@ -108,18 +108,17 @@ void Tracker_PT::run() for (unsigned i = 0; i < points.size(); i++) { auto& p = points[i]; - auto p2 = cv::Point(p[0] * frame.cols + frame.cols/2, -p[1] * frame.cols + frame.rows/2); cv::Scalar color(0, 255, 0); if (i == points.size()-1) color = cv::Scalar(0, 0, 255); cv::line(frame, - cv::Point(p2.x - 20, p2.y), - cv::Point(p2.x + 20, p2.y), + cv::Point(p[0] - 20, p[1]), + cv::Point(p[0] + 20, p[1]), color, 4); cv::line(frame, - cv::Point(p2.x, p2.y - 20), - cv::Point(p2.x, p2.y + 20), + cv::Point(p[0], p[1] - 20), + cv::Point(p[0], p[1] + 20), color, 4); } diff --git a/ftnoir_tracker_pt/point_extractor.cpp b/ftnoir_tracker_pt/point_extractor.cpp index e81e3aa0..cc9dbce1 100644 --- a/ftnoir_tracker_pt/point_extractor.cpp +++ b/ftnoir_tracker_pt/point_extractor.cpp @@ -211,8 +211,7 @@ std::vector PointExtractor::extract_points(Mat& frame) for (auto& b : simple_blob::merge(blobs)) { auto pos = b.effective_pos(); - Vec2f p((pos[0] - W/2)/W, -(pos[1] - H/2)/W); - points.push_back(p); + points.push_back(pos); } vector channels_; -- cgit v1.2.3 From 9cc86cf3569ef6e68c4779ee0d96d1ae4ef77ca6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 20 Jul 2015 08:14:15 +0200 Subject: pt: use calibration Issue: #190 --- ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 35 +++++++++++++++++++++++++++++---- ftnoir_tracker_pt/ftnoir_tracker_pt.h | 1 + 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index b8f40e50..be946018 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -12,6 +12,7 @@ #include #include #include "opentrack/camera-names.hpp" +#include "opentrack/opencv-calibration.hpp" using namespace std; using namespace cv; @@ -53,6 +54,9 @@ void Tracker_PT::reset_command(Command command) float Tracker_PT::get_focal_length() { + QMutexLocker l(&camera_mtx); + if (!intrinsics.empty()) + return intrinsics.at(0, 0); CamInfo info = camera.get_info(); const int w = info.res_x, h = info.res_y; static constexpr double pi = 3.1415926f; @@ -92,7 +96,18 @@ void Tracker_PT::run() ever_success |= success; if (success) - point_tracker.track(points, PointModel(s), get_focal_length(), s.dynamic_pose, s.init_phase_timeout); + { + if (!intrinsics.empty()) + { + std::vector points_; + cv::undistortPoints(points, points_, intrinsics, dist_coeffs); + point_tracker.track(points_, PointModel(s), get_focal_length(), s.dynamic_pose, s.init_phase_timeout); + } + else + { + point_tracker.track(points, PointModel(s), get_focal_length(), s.dynamic_pose, s.init_phase_timeout); + } + } { Affine X_CM = pose(); @@ -101,7 +116,6 @@ void Tracker_PT::run() cv::Vec3f p = X_GH.t; // head (center?) position in global space float fx = get_focal_length(); cv::Vec2f p_(p[0] / p[2] * fx, p[1] / p[2] * fx); // projected to screen - points.push_back(p_); } @@ -138,10 +152,23 @@ void Tracker_PT::apply_settings() { qDebug()<<"Tracker:: Applying settings"; QMutexLocker l(&camera_mtx); - QMutexLocker lock(&mutex); camera.set_device_index(camera_name_to_index(s.camera_name)); camera.set_res(s.cam_res_x, s.cam_res_y); camera.set_fps(s.cam_fps); + cv::Mat intrinsics_ = cv::Mat::eye(3, 3, CV_32FC1); + cv::Mat dist_coeffs_ = cv::Mat::zeros(5, 1, CV_32FC1); + intrinsics = cv::Mat(); + dist_coeffs = cv::Mat(); + auto info = camera.get_info(); + if (info.res_x == 0 || info.res_y == 0) + return; + if (get_camera_calibration(s.camera_name, intrinsics_, dist_coeffs_, info.res_x, info.res_y, s.fov)) + { + intrinsics = intrinsics_.clone(); + dist_coeffs = dist_coeffs_.clone(); + qDebug() << s.camera_name << "calibrated"; + } + qDebug()<<"Tracker::apply ends"; } @@ -156,8 +183,8 @@ void Tracker_PT::start_tracker(QFrame *parent_window) video_layout->addWidget(video_widget); video_frame->setLayout(video_layout); video_widget->resize(video_frame->width(), video_frame->height()); - apply_settings(); camera.start(); + apply_settings(); start(); } diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h index 21da9a2c..aeda7dd7 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h @@ -78,6 +78,7 @@ private: Timer time; volatile bool ever_success; + cv::Mat intrinsics, dist_coeffs; static constexpr double rad2deg = 180.0/3.14159265; static constexpr double deg2rad = 3.14159265/180.0; -- cgit v1.2.3