Search Unity

Augmented Image center pose not delivering what expected

Discussion in 'AR' started by rlm3d, Mar 7, 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 perfectly 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.

    Considering these readings, there are a couple of 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 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 noticeable smaller than the real distance (90 cm).

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

    chaosemer

    Official Google Employee

    Joined:
    Jul 5, 2017
    Posts:
    22
    It sounds like ARCore may not have a good estimate of the image's position. Do you continue to get inaccurate positions if you move the device around a bunch? Without any motion, the underlying ARCore system can not estimate the actual depth of the image.

    The best motion for ARCore is purely translational, i.e. move it left to right without rotating.
     
  3. rlm3d

    rlm3d

    Joined:
    Mar 13, 2014
    Posts:
    7
    Thanks Chaosemer for your suggestions! I followed them and this time I got more accurate results, nevertheless after several readings. It means you need to wait some time until you can get some useful readings about the image center position.

    There is another unanswered question related with the meaning of the coordinates. As I wrote before, the coordinates I get make sense as relative coords to the device world coordinate (starting position of the session). The documentation states that the Y-axis points perpendicular out of the image. This doesn't fit with my measurements.