diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-22 07:58:42 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-10-22 07:58:42 +0200 |
commit | b253d56527365a729c0249918f6c9477893a717e (patch) | |
tree | ee10ce89c268c0566005d25fa4d49ba5cc51da41 /tracker-pt/camera.cpp | |
parent | 4e03f244450cbfd8a5a1cf429515ce0194f66262 (diff) |
tracker/pt: return focal length directly
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r-- | tracker-pt/camera.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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); } } |