summaryrefslogtreecommitdiffhomepage
path: root/tracker-aruco/ftnoir_tracker_aruco.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-18 12:14:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-19 07:17:22 +0200
commita9b804e18c811c781a099a70b960f5bbde61257d (patch)
tree069a7de35557f4d9ff141d795d287e4ac128f625 /tracker-aruco/ftnoir_tracker_aruco.cpp
parent9fc8ebfd8ab54b9fe1caaf60147dd43a573d67ef (diff)
some: replace hardcoded pi values with the same pi constant
We can't depend on M_PI existing after including cmath.
Diffstat (limited to 'tracker-aruco/ftnoir_tracker_aruco.cpp')
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp
index de26c420..7e635a85 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.cpp
+++ b/tracker-aruco/ftnoir_tracker_aruco.cpp
@@ -14,6 +14,7 @@
#include <opencv2/calib3d.hpp>
#include "opentrack-compat/camera-names.hpp"
#include "opentrack-compat/sleep.hpp"
+#include "opentrack-compat/pi-constant.hpp"
#include <QMutexLocker>
#include <QDebug>
@@ -87,7 +88,7 @@ void Tracker::start_tracker(QFrame* videoframe)
layout = layout_;
}
-#define HT_PI 3.1415926535
+#define HT_PI OPENTRACK_PI
void Tracker::getRT(cv::Matx33d& r_, cv::Vec3d& t_)
{
@@ -181,7 +182,7 @@ bool Tracker::open_camera()
void Tracker::set_intrinsics()
{
- static constexpr double pi = 3.1415926f;
+ static constexpr double pi = OPENTRACK_PI;
const int w = grayscale.cols, h = grayscale.rows;
const double diag_fov = static_cast<int>(s.fov) * pi / 180.;
const double fov_w = 2.*atan(tan(diag_fov/2.)/sqrt(1. + h/(double)w * h/(double)w));