Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Wrong initialization of panorama coordinates #74

Closed
jwindhager opened this issue May 3, 2020 · 2 comments
Closed

Wrong initialization of panorama coordinates #74

jwindhager opened this issue May 3, 2020 · 2 comments
Labels
bug V2 Issues related to the new imctools v2 release

Comments

@jwindhager
Copy link
Contributor

Consider the following code and output for a panorama instance:

x1, y1 = float(panorama.metadata['SlideX1PosUm']), float(panorama.metadata['SlideY1PosUm'])
x2, y2 = float(panorama.metadata['SlideX2PosUm']), float(panorama.metadata['SlideY2PosUm'])
x3, y3 = float(panorama.metadata['SlideX3PosUm']), float(panorama.metadata['SlideY3PosUm'])
x4, y4 = float(panorama.metadata['SlideX4PosUm']), float(panorama.metadata['SlideY4PosUm'])
x = min(x1, x2, x3, x4)
y = min(y1, y2, y3, y4)
width = max(x1, x2, x3, x4) - x
height = max(y1, y2, y3, y4) - y
print(x, y, width, height)
print(panorama.start_position_x, panorama.start_position_y, panorama.width, panorama.height)
-55.715 112.972 75000.0 25219.775999999998
-55.715 25332.748 75000.0 25219.775999999998

It looks like the current implementation assumes a specific order of the four points in the MCD Panorama metadata. However, to my knowledge, the order is not guaranteed. This might explain the discrepancies observed above.

@jwindhager jwindhager added bug V2 Issues related to the new imctools v2 release labels May 3, 2020
@plankter
Copy link
Contributor

plankter commented May 3, 2020

In your example starting point will be left-bottom point (X3) and i assume it should be left-top (X1). This is a question of a coordinate grid. In order to avoid conclusion, probably it is better to store coordinates of all 4 individual points (like in raw data), instead of starting point and width/height.

@jwindhager
Copy link
Contributor Author

If a rectangle aligned with the coordinate system can be assumed, the computation above will give correct x, y, width, height. Otherwise, I agree re storing the four points individually.

plankter added a commit that referenced this issue May 4, 2020
…'s coordinates (like in raw data) due to some confusion and unclarity which point is served as a center of rotation.
@plankter plankter closed this as completed May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug V2 Issues related to the new imctools v2 release
Projects
None yet
Development

No branches or pull requests

2 participants