[reconstruction] ViewpointWrapper: fix uvCenterOffset for rotated images

correctly apply image transformation to principal point correction in uv coordinates.
This commit is contained in:
Yann Lanthony 2019-09-19 12:50:48 +02:00
parent 633b8c0e00
commit ae91f3bcd5
No known key found for this signature in database
GPG key ID: 519FAE6DF7A70642

View file

@ -332,7 +332,12 @@ class ViewpointWrapper(QObject):
uvPP = QVector2D(float(pp[0]) / self.imageSize.width(), float(pp[1]) / self.imageSize.height())
# convert to offset
offset = uvPP - QVector2D(0.5, 0.5)
return offset if self.orientation == 1 else -offset
# apply orientation to principal point correction
if self.orientation == 6:
offset = QVector2D(-offset.y(), offset.x())
elif self.orientation == 8:
offset = QVector2D(offset.y(), -offset.x())
return offset
@Property(type=float, notify=sfmParamsChanged)
def fieldOfView(self):