summaryrefslogtreecommitdiffhomepage
path: root/opentrack
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 /opentrack
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 'opentrack')
-rw-r--r--opentrack/opencv-calibration.hpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/opentrack/opencv-calibration.hpp b/opentrack/opencv-calibration.hpp
deleted file mode 100644
index 99e6d4c7..00000000
--- a/opentrack/opencv-calibration.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 2015, Stanislaw Halik <sthalik@misaki.pl>
-
- * 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 <QCoreApplication>
-#include <QString>
-#include <QByteArray>
-#include <string>
-#include <opencv2/core.hpp>
-
-template<typename = void>
-bool get_camera_calibration(const QString& camera_name, cv::Mat& intrinsics, cv::Mat& distortion, int w, int h, int fov)
-{
- 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<float>(0, 0) *= w / w__;
- intrinsics_.at<float>(2, 0) *= w / w__;
- intrinsics_.at<float>(1, 1) *= h / h__;
- intrinsics_.at<float>(2, 1) *= h / h__;
- intrinsics = intrinsics_;
- distortion = distortion_;
- return true;
- }
- return false;
-}