Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Question Spawning a Gameobject with correct position after pose estimation from CPU Image using ARFoundation

Discussion in 'AR' started by RahulJain07, Oct 12, 2023.

  1. RahulJain07

    RahulJain07

    Joined:
    Sep 9, 2020
    Posts:
    15
    I am working on an algorithm which estimates the 6d pose of an object by providing the CPU image ( using
    TryAcquireLatestCpuImage) and the camera intrinsics (TryGetIntrinsics). When i project the object cad with the estimated position and rotation using the same intrinsics I get good results using opengl. But when i spawn the object 3d model in unity using ARFoundation the z position shows an offset. I realized that although arcamerabackground script imposes a projection matriix which is same as when calculating the pose estimates but the image size is changed (the cpu image is 640X480 but in an ARSession the image size is the screen size (2340X1080 on my android device)) of the device due to which the fov changes and I can observe the projection offset. How to take care of the change in fov so that my projection fits.
     
  2. WyattBUnity

    WyattBUnity

    Unity Technologies

    Joined:
    Mar 27, 2023
    Posts:
    31