[ui] fix uvCenterOffset

Fix changes of principal point coord system from https://github.com/alicevision/meshroom/pull/1509.
This commit is contained in:
Fabien Castan 2021-10-14 14:32:00 +02:00 committed by GitHub
parent 1c66c6d9ab
commit cd15a92318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -345,9 +345,7 @@ class ViewpointWrapper(QObject):
return None return None
pp = self.solvedIntrinsics["principalPoint"] pp = self.solvedIntrinsics["principalPoint"]
# compute principal point offset in UV space # compute principal point offset in UV space
uvPP = QVector2D(float(pp[0]) / self.imageSize.width(), float(pp[1]) / self.imageSize.height()) offset = QVector2D(float(pp[0]) / self.imageSize.width(), float(pp[1]) / self.imageSize.height())
# convert to offset
offset = uvPP - QVector2D(0.5, 0.5)
# apply orientation to principal point correction # apply orientation to principal point correction
if self.orientation == 6: if self.orientation == 6:
offset = QVector2D(-offset.y(), offset.x()) offset = QVector2D(-offset.y(), offset.x())