File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -361,11 +361,18 @@ def fieldOfView(self):
361361 if not self .solvedIntrinsics :
362362 return None
363363 focalLength = self .solvedIntrinsics ["focalLength" ]
364+
365+ #We assume that if the width is less than the weight
366+ #It's because the image has been rotated and not
367+ #because the sensor has some unusual shape
368+ sensorWidth = self .solvedIntrinsics ["sensorWidth" ]
369+ sensorHeight = self .solvedIntrinsics ["sensorHeight" ]
370+ if self .imageSize .height () > self .imageSize .width ():
371+ sensorWidth , sensorHeight = sensorHeight , sensorWidth
372+
364373 if self .orientation in (5 , 6 , 7 , 8 ):
365- sensorWidth = self .solvedIntrinsics ["sensorWidth" ]
366374 return 2.0 * math .atan (float (sensorWidth ) / (2.0 * float (focalLength ))) * 180.0 / math .pi
367375 else :
368- sensorHeight = self .solvedIntrinsics ["sensorHeight" ]
369376 return 2.0 * math .atan (float (sensorHeight ) / (2.0 * float (focalLength ))) * 180.0 / math .pi
370377
371378 @Property (type = QUrl , notify = undistortedImageParamsChanged )
You can’t perform that action at this time.
0 commit comments