summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-20 14:31:38 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-20 14:31:38 +0200
commita664f1e0bd8dc6f24ce7bf25406bf9c4bfda7ecd (patch)
tree02d5b445c052eb358f0f1e1cb24f83721b4939b0 /ftnoir_tracker_pt
parentb96ed23aff5d39ef96dfb22d21c6161cda9bcce5 (diff)
parent56dd856405ebf26f8243880035fed2dd688b14a6 (diff)
Merge branch 'unstable' into trackhat-ui
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.cpp34
-rw-r--r--ftnoir_tracker_pt/ftnoir_tracker_pt.h1
-rw-r--r--ftnoir_tracker_pt/point_tracker.cpp9
3 files changed, 3 insertions, 41 deletions
diff --git a/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp b/ftnoir_tracker_pt/ftnoir_tracker_pt.cpp
index dbf9cca0..252a7456 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;
@@ -69,8 +68,6 @@ float Tracker_PT::get_focal_length()
const float diag_fov = static_cast<int>(fov_) * pi / 180.f;
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;
const double diag = sqrt(w * w + h * h)/w;
@@ -112,16 +109,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);
}
{
@@ -198,26 +186,6 @@ void Tracker_PT::apply_settings()
camera.set_res(res_x, res_y);
camera.set_fps(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();
- int fov;
- switch (s.fov)
- {
- default:
- case 0: fov = 56; break;
- case 1: fov = 75; break;
- }
- if (get_camera_calibration("PS3Eye Camera", intrinsics_, dist_coeffs_, res_x, res_y, fov))
- {
- intrinsics = intrinsics_.clone();
- dist_coeffs = dist_coeffs_.clone();
- qDebug() << "calibrated";
- }
- else
- qDebug() << "not 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)