Search Unity

Not clear what Augmented Image center pose is delivering

Discussion in 'AR' started by rlm3d, Mar 5, 2019.

  1. rlm3d

    rlm3d

    Joined:
    Mar 13, 2014
    Posts:
    7
    I am looking at getting the position of the augmented image relative to device pose. For this I am retrieving the augmented image pose and the device pose according to the code below. I have started my session with the device pointing to the centre of the image which is 90 cm approximately in front of the camera. The camera is horizontally and vertically aligned with the centre of the image. The image is detected, and I use the code below to retrieve the device and image centre positions:

    Vector3 devicePosition = Frame.Pose.position;

    Vector imgPosition = image.CenterPose.position

    The values I am getting are below.

    Device position : (-0.01, 0.02, 0.05)

    Image centrer position : (-0.01, 0.02, 0.16)

    From this I see that the image center position XY coordinates are identical to the device XY coordinates, and the difference is only in the Z coordinate. The image center appears to be 11 cm in front of the camera.

    From this I see two things that I don’t understand:

    1. According to ARCore documentation on AugmentedImage CenterPose:

    “The Y-axis points perpendicular out of the image. The X-axis points from left to right on the image, and the Z-axis points from bottom to top on the image.”

    Nevertheless, it doesn’t seem to fit what I get when retrieving the image center position. It seems to me that the image center position is given in coordinates relative to the device world coordinates.

    2. The distance from the image center to the device calculated based on device and image center positions (11 cm) is very different from the real distance (90 cm).

    I would appreciate any comment/hint that could bring answer to these questions.