summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-20 14:29:02 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-20 14:29:02 +0200
commit56dd856405ebf26f8243880035fed2dd688b14a6 (patch)
tree9098f67afb93e7d95f7043a2c909d2f39a1e9c10 /ftnoir_tracker_pt
parent0c1b4510b3f7a744cc4cad94e0d4dde45925269d (diff)
for now remove calibration support
PT tracker returns garbage when calibrating, Z is zero. Maybe can be reverted and fixed later.
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp28
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.h1
-rw-r--r--ftnoir_tracker_pt/point_tracker.cpp9
3 files changed, 3 insertions, 35 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index 48a62c2c..d166ad01 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
@@ -12,7 +12,6 @@
#include <QFile>
#include <QCoreApplication>
#include "opentrack/camera-names.hpp"
-#include "opentrack/opencv-calibration.hpp"
using namespace std;
using namespace cv;
@@ -55,8 +54,6 @@ void Tracker_PT::reset_command(Command command)
float Tracker_PT::get_focal_length()
{
QMutexLocker l(&camera_mtx);
- if (!intrinsics.empty())
- return intrinsics.at<float>(0, 0);
CamInfo info = camera.get_info();
const int w = info.res_x, h = info.res_y;
static constexpr double pi = 3.1415926f;
@@ -99,16 +96,7 @@ void Tracker_PT::run()
if (success)
{
- if (!intrinsics.empty())
- {
- std::vector<cv::Vec2f> 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);
- }
+ point_tracker.track(points, PointModel(s), get_focal_length(), s.dynamic_pose, s.init_phase_timeout);
}
{
@@ -159,20 +147,6 @@ void Tracker_PT::apply_settings()
camera.set_res(s.cam_res_x, s.cam_res_y);
camera.set_fps(s.cam_fps);
camera.start();
- 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";
}
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.h b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
index 97aa54aa..b303a913 100644
--- a/ftnoir_tracker_pt/ftnoir_tracker_pt.h
+++ b/ftnoir_tracker_pt/ftnoir_tracker_pt.h
@@ -72,7 +72,6 @@ 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;
diff --git a/ftnoir_tracker_pt/point_tracker.cpp b/ftnoir_tracker_pt/point_tracker.cpp
index f141fe36..b4283d37 100644
--- a/ftnoir_tracker_pt/point_tracker.cpp
+++ b/ftnoir_tracker_pt/point_tracker.cpp
@@ -259,14 +259,9 @@ int PointTracker::POSIT(const PointModel& model, const PointOrder& order_, float
X_CM.t[1] = order[0][1] * Z0/focal_length;
X_CM.t[2] = Z0;
- return i;
+ //qDebug() << "iter:" << i;
- //Rodrigues(X_CM.R, r);
- //qDebug()<<"iter: "<<i;
- //qDebug()<<"t: "<<X_CM.t[0]<<' '<<X_CM.t[1]<<' '<<X_CM.t[2];
- //Vec3f r;
- //
- //qDebug()<<"r: "<<r[0]<<' '<<r[1]<<' '<<r[2]<<'\n';
+ return i;
}
cv::Vec2f PointTracker::project(const cv::Vec3f& v_M, float f)