scanner icon indicating copy to clipboard operation
scanner copied to clipboard

pose

Open missTL opened this issue 6 months ago • 4 comments

Could you please explain how the direction is defined in the camera pose data collected from odometry.csv? It is different from the definition used in colmap. When I apply it to colmap, errors occur.

missTL avatar Jun 14 '25 13:06 missTL

They should be saved in computer vision/openCV coordinates, that is positive z pointing forward, x axis pointing to the right of the image and y axis pointing downwards in the image.

You can find the code saving this here: https://github.com/strayrobots/scanner/blob/e0e252221048b80d288dc1f264df775aacbe4304/StrayScanner/Helpers/OdometryEncoder.swift#L32

Apple uses OpenGL coordinates, where negative z is forward, x is to the right and y is pointing up. In that function, the coordinates are flipped to account for this.

IIRC correctly, Colmap uses the computer vision coordinates, but I'm not entirely sure nor can I speak for the errors.

kekeblom avatar Jun 16 '25 15:06 kekeblom

Maybe check your data using https://github.com/kekeblom/strayvisualizer to see what is actually logged in odometry.csv and if it makes sense.

kekeblom avatar Jun 16 '25 15:06 kekeblom

Colmap specifies the reconstruction pose of the image as a projection from the world coordinate system to the camera coordinate system of the image, using a quaternion (QW, QX, QY, QZ) and a translation vector (TX, TY, TZ). The quaternion is defined according to the Hamilton convention. Is scanner defined in this way? My phone was set to landscape mode when the photos were taken. Does this have any impact? like this https://github.com/kekeblom/StrayVisualizer/issues/18#issuecomment-1532592083

missTL avatar Jun 19 '25 14:06 missTL

That is indeed the case.

The orientation of your phone will indeed have an effect on the coordinate orientation, but it should not matter. I'm not entirely sure what you are doing though, so can't say for sure.

I'm guessing you are inputting the frames into colmap using the odometry estimates as initial guesses? What happens if you leave the guesses out and just run the photogrammetry? Does it give reasonable output?

It's been a while since I used Colmap, so don't recall the exact details. This script might be helpful which takes datasets from the app and runs it through HLoc, which is built on top of colmap https://github.com/ethz-asl/autolabel/blob/main/scripts/mapping.py

kekeblom avatar Jun 20 '25 07:06 kekeblom