From b253d56527365a729c0249918f6c9477893a717e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 22 Oct 2017 07:58:42 +0200 Subject: tracker/pt: return focal length directly --- tracker-pt/camera.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tracker-pt/camera.cpp') diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp index 5e00499c..263d6617 100644 --- a/tracker-pt/camera.cpp +++ b/tracker-pt/camera.cpp @@ -22,7 +22,7 @@ QString Camera::get_active_name() const return active_name; } -void CamInfo::get_focal_length(double& fx) const +double CamInfo::get_focal_length() const { const double diag_len = sqrt(double(res_x*res_x + res_y*res_y)); const double aspect_x = res_x / diag_len; @@ -30,7 +30,8 @@ void CamInfo::get_focal_length(double& fx) const const double diag_fov = fov * M_PI/180; const double fov_x = 2*atan(tan(diag_fov*.5) * aspect_x); //const double fov_y = 2*atan(tan(diag_fov*.5) * aspect_y); - fx = .5 / tan(fov_x * .5); + const double fx = .5 / tan(fov_x * .5); + return fx; //fy = .5 / tan(fov_y * .5); //static bool once = false; if (!once) { once = true; qDebug() << "f" << ret << "fov" << (fov * 180/M_PI); } } -- cgit v1.2.3