From 7f72f81289026a0b0b8dbfcb233436fcb202b0e2 Mon Sep 17 00:00:00 2001 From: Fabien Servant Date: Wed, 27 Nov 2024 13:23:35 +0100 Subject: [PATCH] Field of view functions works for tall images --- meshroom/ui/reconstruction.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/meshroom/ui/reconstruction.py b/meshroom/ui/reconstruction.py index 3f1acb6cff..74e8fd81cc 100755 --- a/meshroom/ui/reconstruction.py +++ b/meshroom/ui/reconstruction.py @@ -361,11 +361,18 @@ def fieldOfView(self): if not self.solvedIntrinsics: return None focalLength = self.solvedIntrinsics["focalLength"] + + #We assume that if the width is less than the weight + #It's because the image has been rotated and not + #because the sensor has some unusual shape + sensorWidth = self.solvedIntrinsics["sensorWidth"] + sensorHeight = self.solvedIntrinsics["sensorHeight"] + if self.imageSize.height() > self.imageSize.width(): + sensorWidth, sensorHeight = sensorHeight, sensorWidth + if self.orientation in (5, 6, 7, 8): - sensorWidth = self.solvedIntrinsics["sensorWidth"] return 2.0 * math.atan(float(sensorWidth) / (2.0 * float(focalLength))) * 180.0 / math.pi else: - sensorHeight = self.solvedIntrinsics["sensorHeight"] return 2.0 * math.atan(float(sensorHeight) / (2.0 * float(focalLength))) * 180.0 / math.pi @Property(type=QUrl, notify=undistortedImageParamsChanged)