google-ar / arcore-android-sdk

ARCore SDK for Android Studio
https://developers.google.com/ar
Other
4.95k stars 1.22k forks source link

ARCore's pose matrices #842

Open alexs7 opened 5 years ago

alexs7 commented 5 years ago

I have been looking here:

are these matrices the same as you would get if you had 2D/3D correspondences from a camera frame to a point cloud and ran opencv's solvePnP ?

To rephrase if you had 2D/3D correspondences could you use those matrices to correctly pose an object's point cloud in the current camera frame ?

pro2on commented 3 years ago

@alexs7 , did you find the answer? I'm looking the same.

alexs7 commented 3 years ago

@pro2on my case was a bit different at the end. I had to localise the phone in a point cloud. So yes I did use these poses (the first one) but in combination with some other pose. What exactly are you after ? I might be able to help you

pro2on commented 3 years ago

@alexs7, thank for reply.

My idea - to replace ARCore AugmentedImages with openCV recognition + solvePNP to restore this image in 3D space. So presuming I know the width/height of the image in 3D space in collection mode, how I can restore it back to 3d space in the next session?

At the moment I have results (tvec and rvec) in some strange units, probably in pixels, and do not know how to convert it to the metres.

alexs7 commented 3 years ago

@pro2on Ok so you want to create a plane in 3D space with a coordinate system in the center of it, pretty much using custom images ?

The rotation matrix values and translation values that OpenCV returns can be confusing, for the rotation (or quaternion) I suggest reading this: https://kodkodgames.gitlab.io/rotation_matrices/ The translation is the position of the camera in world space, I am not sure it is in metric. But ARCore's is so this might help.

I will need to know more and look at code to help further. I hope this helps.