How to measure distance using ARCore?

前端 未结 3 1033
太阳男子
太阳男子 2020-12-02 11:34

Is it possible to calculate distance between two HitResult `s ?

Or how we can calculate real distance (e.g. meters) using ARCore?

3条回答
  •  感动是毒
    2020-12-02 12:11

    You can extract the two HitResult poses using getHitPose() and then compare their translation component (getTranslation()). The translation is defined as

    ...the position vector from the destination (usually world) coordinate frame to the local coordinate frame, expressed in destination (world) coordinates.

    As for the physical unit of this I could not find any remark. With a calibrated camera this should be mathematically possible but I don't know if they actually provide an API for this

提交回复
热议问题