From a3c6f93f18b069afa8d8c854e25c52894863940d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 22 Jul 2015 08:03:07 +0200 Subject: default to the most common protocol/filter pair --- opentrack/main-settings.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentrack/main-settings.hpp b/opentrack/main-settings.hpp index 300c0561..96520fe9 100644 --- a/opentrack/main-settings.hpp +++ b/opentrack/main-settings.hpp @@ -37,7 +37,7 @@ struct main_settings : opts { value center_at_startup, wizard_done; main_settings() : opts("opentrack-ui"), - protocol_dll(b, "protocol-dll", ""), + protocol_dll(b, "protocol-dll", "freetrack 2.0 Enhanced"), a_x(b, "x", TX), a_y(b, "y", TY), a_z(b, "z", TZ), -- cgit v1.2.3 From a2682c3265c4f891e7baf740c08d19e01cd6d8d8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 23 Jul 2015 11:07:17 +0200 Subject: no longer add extra file to modules Modules now link to opentrack-api so this isn't needed --- CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ee0e932c..19fb2668 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,11 +76,8 @@ endif() set_property(GLOBAL PROPERTY USE_FOLDERS OFF) -# qt broken as usual -set(EXTRA-MOCS opentrack/options.hpp) - macro(opentrack_module n dir) - file(GLOB ${n}-c ${dir}/*.cpp ${dir}/*.c ${dir}/*.h ${dir}/*.hpp ${EXTRA-MOCS}) + file(GLOB ${n}-c ${dir}/*.cpp ${dir}/*.c ${dir}/*.h ${dir}/*.hpp) file(GLOB ${n}-res ${dir}/*.rc) foreach(f ${n}-res) set_source_files_properties(${f} PROPERTIES LANGUAGE RC) -- cgit v1.2.3 From 5f7703409b9ea6ded850e4f5382a4ca2983a8a6f Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Jul 2015 07:25:27 +0200 Subject: Revert "pt: change point internal representation" This reverts commit e89c2b1034692eb1365715a089b7035e6d837719. Issue: #199 --- ftnoir_tracker_pt/ftnoir_tracker_pt.cpp | 11 ++++++----- ftnoir_tracker_pt/point_extractor.cpp | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp index 252a7456..8c478824 100644 --- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp +++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp @@ -72,7 +72,7 @@ float Tracker_PT::get_focal_length() const int w = info.res_x, h = info.res_y; const double diag = sqrt(w * w + h * h)/w; const double fov = 2.*atan(tan(diag_fov/2.0)/sqrt(1. + diag*diag)); - return w*.5 / tan(.5 * fov); + return .5 / tan(.5 * fov); } void Tracker_PT::run() @@ -125,17 +125,18 @@ 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(p[0] - 20, p[1]), - cv::Point(p[0] + 20, p[1]), + cv::Point(p2.x - 20, p2.y), + cv::Point(p2.x + 20, p2.y), color, 4); cv::line(frame, - cv::Point(p[0], p[1] - 20), - cv::Point(p[0], p[1] + 20), + cv::Point(p2.x, p2.y - 20), + cv::Point(p2.x, p2.y + 20), color, 4); } diff --git a/ftnoir_tracker_pt/point_extractor.cpp b/ftnoir_tracker_pt/point_extractor.cpp index cc9dbce1..e81e3aa0 100644 --- a/ftnoir_tracker_pt/point_extractor.cpp +++ b/ftnoir_tracker_pt/point_extractor.cpp @@ -211,7 +211,8 @@ std::vector PointExtractor::extract_points(Mat& frame) for (auto& b : simple_blob::merge(blobs)) { auto pos = b.effective_pos(); - points.push_back(pos); + Vec2f p((pos[0] - W/2)/W, -(pos[1] - H/2)/W); + points.push_back(p); } vector channels_; -- cgit v1.2.3 From ca1c7afaf6530c64c118105f167c2d08d6f13e05 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Jul 2015 09:15:00 +0200 Subject: x-plane plugin osx fixes --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fb2668..17179cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,7 +241,9 @@ if(SDK_XPLANE) if(APPLE) SET_TARGET_PROPERTIES(opentrack-xplane-plugin PROPERTIES COMPILE_FLAGS "-iframework ${SDK_XPLANE}/Libraries/Mac/ -DAPL -DXPLM200 -DXPLM210 -framework XPLM -framework XPWidgets" - LINK_FLAGS "-F${SDK_XPLANE}/Libraries/Mac/ -framework XPLM -framework XPWidgets") + LINK_FLAGS "-F${SDK_XPLANE}/Libraries/Mac/ -framework XPLM -framework XPWidgets" + LIBRARY_OUTPUT_NAME "opentrack.xpl" + PREFIX "" SUFFIX "") endif() if(UNIX AND NOT APPLE) target_link_libraries(opentrack-xplane-plugin rt) -- cgit v1.2.3